News for hackers. Stuff that matters.
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @11:29AM (#43633233)
Things I have never thought as a professional multiplayer game developer:

"Phew! I've just finished coding all the complex lag masking netcode myself, you know what I really need next? An in-memory SQL-like database to store my world state!"

Re:SpacetimeDB by cloutiertyler on Wednesday April 09, 2025 @12:05PM (#43633635)
We can and plan to handle the complex lag masking netcode as well. We've just focused so far on games that don't need very sophisticated lag compensation
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @12:28PM (#43633963)
Planning to support complex lag masking netcode as a TODO is not a good sign.
Re:SpacetimeDB by cloutiertyler on Wednesday April 09, 2025 @01:11PM (#43634596)
TODO does not imply no plan or that we haven't thought deeply about the problem. Prioritization is imperative when you're building an MMORPG and a new database with a small team for both.
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @01:38PM (#43634913)
How can you think deeply and plan for something when you don't know what don't know. You can only really understand these things when you've taken a game using these latency hiding techniques into production, and then after this, you'll probably realize that some of your original ideas were wrong. Where does this leave SpacetimeDB then?
Re:SpacetimeDB by cloutiertyler on Wednesday April 09, 2025 @03:45PM (#43636880)
I'd be happy to schedule a chat to talk with you about our plans if you'd like! I'd love to get your thoughts.
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @04:23PM (#43637453)
No thanks! Here are my thoughts. Focus on making your game fun and profitable for your company. Nothing else matters.
Re:SpacetimeDB by cloutiertyler on Wednesday April 09, 2025 @04:46PM (#43637763)
Ah you mean like implementing UDP and supporting complex lag masking netcode before we have to?
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @05:05PM (#43637988)
If a game has no players, does it really matter if it's networked with UDP or TCP?
Re:SpacetimeDB by stronglikedan on Wednesday April 09, 2025 @02:11PM (#43635351)
just because someone doesn't think and plan just like you do, doesn't mean they will not succeed
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @02:26PM (#43635572)
Nice strawman you have there but that's not what I said:

> Things I have never thought as a professional multiplayer game developer: "Phew! I've just finished coding all the complex lag masking netcode myself, you know what I really need next? An in-memory SQL-like database to store my world state!"

Transation: This is not the way multiplayer games are usually made. Solving for problems like latency hiding, competitive integrity and making the game fun are orders of magnitude more difficult than "how do I store my object state on the server".

> How can you think deeply and plan for something when you don't know what don't know. You can only really understand these things when you've taken a game using these latency hiding techniques into production, and then after this, you'll probably realize that some of your original ideas were wrong. Where does this leave SpacetimeDB then?

Translation: The SpacetimeDB devs have not yet shipped a game using client-side prediction techniques. Because of this the entire architecture of SpacetimeDB is suspect. Client-side prediction, latency compensation and delta-encoding over UDP are the things that most influence the structure of game state on the server, and the fact that the team doesn't have experience with these things means that they've almost certainly built SpacetimeDB the wrong way.

Re:SpacetimeDB by cloutiertyler on Wednesday April 09, 2025 @03:47PM (#43636922)
For what it's worth, BitCraft currently ships with client-side prediction. It's just not built into SpacetimeDB yet.

It's relatively simple, but "The SpacetimeDB devs have not yet shipped a game using client-side prediction techniques", is not correct.

Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @04:21PM (#43637418)
Thinking that client-side prediction is "relatively simple" is a bit of a red flag.
Re:SpacetimeDB by Aeolun on Wednesday April 09, 2025 @07:57PM (#43639269)
Man, cynical much? I feel like OP has been honestly trying to engage with you here, and the only thing you’ve been is snippy and abrasive.
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @08:28PM (#43639430)
Look mate, I'm not here to make friends and I don't really care how you "feel" about what I post.

I have enough experience in this space to spot something real vs. hype and horseshit and let me tell you point blank -- there is nothing of value here for people making any sort of serious multiplayer games.

Re:SpacetimeDB by spoiler on Wednesday April 09, 2025 @08:52PM (#43639576)
I mean, they said they'd like to get your expert input on the matter. Why not give them a chance? Maybe you can help them do some much needed course correction—which is what I understood you're staying by reading a bit between the lines.

Maybe you can even negotiate a consultancy fee with them

You can stay sceptical, but try giving them a chance. You might end up surprising eachother!

Aside: I'm getting into indie game dev recently and love your site!

Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @11:43PM (#43640419)
> Maybe you can even negotiate a consultancy fee with them

No thanks!

[dead]
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @11:23PM (#43640299)
If you disagree with my argument, you're welcome to refute it. Instead you make ad hominem attacks and attempt to reframe the discussion by calling me "reactive", "emotional" and "defensive".

What's going on is that we have some people here (SpacetimeDB) making some very bold and incorrect claims about a supposed game changing technology in a domain that I happen to be a world expert in.

I stay silent and a bunch of people try this out, build games with it and it blows their company up because it's a toy product (it's happened before with Improbable).

I call it out and now I'm "emotional" and I'm "attacking" them. oohhh I'm such a horrible person. How do I sleep at night. You can't win :)

Re:SpacetimeDB by LarsDu88 on Thursday April 10, 2025 @02:46AM (#43641316)
This guy is blunt... but he's correct.

This company focused all it's effort in reinventing the part of multi-player games that did not need reinventing.

40 engineers for 5 years. I'm guessing at least 20 million dollars spent. 1 million trailer views... Let's say 100k wishlists, 10,000 sales at 30 LTV. 300k in revenue

This company will need to pivot if the game is not successful.

I would say the db could be pivoted for multi-player Figma style apps rather than games, but the coupling of server and db means you can't scale the db layer the same way you could do with literally every other db solution available s your company scales

Re:SpacetimeDB by Aeolun on Thursday April 10, 2025 @06:25AM (#43642513)
Being correct doesn’t mean you get to be an asshole about it.

At least, not if you want me to not call you out on it.

I get the sentiment, I really do, but being misguided isn’t a crime that’s worth being treated like shit for. Especially when you are trying to learn.

Re:SpacetimeDB by Aeolun on Wednesday April 09, 2025 @07:45PM (#43639192)
I mean, they are dogfooding their own database. If they’re making a MMO game with it presumably the game has latency masking netcode, even if it isn’t in part of the database.
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @08:09PM (#43639334)
And you think that using a product built by some people literally making their first game is a good idea? Please be serious.
Re:SpacetimeDB by cess11 on Thursday April 10, 2025 @06:11AM (#43642441)
"Tyler was a Sr. Data Science Engineer at MZ (the company behind Game of War and Mobile Strike). Prior to working at MZ he was an engineer at Apple. Tyler holds a Masters in Distributed Systems and Machine Learning from Johns Hopkins University."

"Alessandro was a Sr. Software Engineer at Bloomberg, LP where he worked on high throughput distributed pricing systems. He holds a Computer Science and a Biomedical Engineering degree from Johns Hopkins University."

Looks like they've built stuff before.

I don't like this database product because it lacks SDK:s in languages I would touch without getting paid, but I think the idea is sound and rather attractive. For many years I've used Picolisp in a similar way, it bundles an object database with a logic engine and a small Lisp-like programming language, which makes it easy to throw in some data and relations and slap on a web page with standard library widgets.

The BEAM is similar, you push some modules into it and store stuff in ETS and don't bother with RDBMS until you need it. If your data is small or trivially shardable you can get persistence too, with Mnesia.

I'm not so sure they'll be making a lot from that game of theirs, but if their database turns out to be robust it could become competitive with things like Supabase/Firebase and such, because there will be modules for serving web and auth and dashboards and whatnot you can just push in there and you're good to go. One-click-install for applications, similar to cPanel and Wordpress rigs, but less messy on the ops side.

Re:SpacetimeDB by gafferongames on Thursday April 10, 2025 @08:54AM (#43643298)
> Looks like they've built stuff before.

Building "stuff" != shipping games.

Re:SpacetimeDB by cess11 on Friday April 11, 2025 @03:06AM (#43651236)
Game of War and Mobile Strike look like games to me. Casino-like games for handheld devices rather than God of War, but still games, and likely quite latency sensitive due to the gambling-reminiscent aspects. It also seems like that company had the same idea you have, that selling dedicated networks for latency sensitive systems might be profitable.

If you compare the commit messages on your public repos with those on the SpacetimeDB repo, do you notice any differences?

Re:SpacetimeDB by gafferongames on Friday April 11, 2025 @09:49PM (#43660618)
> If you compare the commit messages on your public repos with those on the SpacetimeDB repo, do you notice any differences?

Yes. The open source software that I've written is actually useful.

Re:SpacetimeDB by cess11 on Sunday April 13, 2025 @12:00PM (#43673738)
How do you come to this conclusion based on those commit messages? Show some examples.
Re:SpacetimeDB by pphysch on Wednesday April 09, 2025 @01:01PM (#43634474)
Seems too biased and harsh. The best lag masking and clientside prediction systems I've experienced as a player are those that are closely integrated with the idiosyncratic gameplay mechanics. I would never expect SpacetimeDB to have a one-size-fits-all solution to this, nor for it to be the central focus of their product.
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @01:39PM (#43634925)
Game development is not something you learn by playing games.
Re:SpacetimeDB by pphysch on Wednesday April 09, 2025 @03:50PM (#43636955)
You will implement terrible lag masking and clientside prediction if you aren't looking at it from the UX perspective, because that is literally the only reason these features exist, to trick players into thinking the game signals are moving faster and with greater frequency through the network than is physically possible. Perhaps you would make better games if you considered the user perspective.
Re:SpacetimeDB by gafferongames on Wednesday April 09, 2025 @04:06PM (#43637209)
Thank you for explaining client-side prediction to me, a professional multiplayer game developer. I see the errors in my ways now, and will consult with the real experts, the people who actually play games, to see what they think about game development topics, before posting opinions of my own from now on.
Re:SpacetimeDB by pphysch on Wednesday April 09, 2025 @05:20PM (#43638129)
Happy to help.
Re:SpacetimeDB by smus on Thursday April 10, 2025 @03:01AM (#43641410)
You seem like a joy
Re:SpacetimeDB by lomase on Thursday April 10, 2025 @03:21AM (#43641518)
This is the Internet now, is not worth it, those times are over.
Re:SpacetimeDB by gafferongames on Saturday April 12, 2025 @12:26PM (#43665792)
Forget it Jake, it's hacker news.
Re:SpacetimeDB by TeMPOraL on Wednesday April 09, 2025 @03:37PM (#43636760)
Well, I'm not a professional gamedev, nor did I ever do much multiplayer code, but:

1) AFAIR, the ECS patterns family[0] originally came from MMORPG world, and boiled down to designing your game state to work well with relational databases;

2) Around 6 years ago, while toying with yet another (see [0]) take on ECS for a simple game, and wondering how to query stuff efficiently, it dawned on me that the code I'm writing is basically implementing spacial indices and other such concepts from relational DB world. At that point, I thought to myself, "why continue wasting time Greenspunning[1] a database for the internal state, when I could use a real one?", and followed by "you know what I really need next? An in-memory SQLite database to store all my runtime game state!".

I didn't get very far with my experiment due to constraints of adult life, but I did prove that I can build a basic Roguelike skeleton (2D tile map, entities, walls, collisions) while storing all state in SQLite, and have it run at 60 FPS with half of the frame time to spare for other things, on moderately powerful machine (as of 6 years ago), all without too much optimization (Common Lisp with FFI bindings to libsqlite3 + a simple RLU cache in front of queries).

So it's not at all a stupid idea, IMO :). I would test it further if I had the time.

--

[0] - The term means different things to different people. I've seen at least three distinct gamedev design patterns claiming the name ECS for themselves, all conceptually incompatible with each other. More, if you also consider "whatever Unity/Unreal/Godot/... calls ECS".

Re:SpacetimeDB by insraq on Wednesday April 09, 2025 @05:12PM (#43638050)
Just want to chime in that although this comment is a bit harsh, it does hold a lot of truth. As a game netcode engineer, most of my time is spent on latency hiding techniques and its consequences (for example, we use rollback netcode and lots of efforts are spent on minimizing visual/sound glitches when mispredict, rollback and reconcile). There are lots of middleware that help with this (eg. Photon, SnapNet, etc) but in general there's no silver bullet - it's highly gameplay specific. Even for the same game, the solution can vary depending on different trade-offs (i.e. budget, correctness/anticheat).

As to how to store the game state in memory, it's usually not something that needs much thinking: it's simply done the same way (or similar) as the game's client code. After all, netcode is mostly about efficient state replication and this saves CPU time when replicating it across clients - and gives more CPU time for minimizing bandwidth (like delta encoding, quantization, etc). If you want, you can utilize some techniques like ECS to optimize for CPU cache locality, but it affect gameplay code a lot and would need to get the whole team onboard.

Also, I just noticed the username "gafferongames" - Glenn's blog[1] has been a must-read for netcode engineers. It helped me a lot when I started working on netcode in the 2010s

[1] https://gafferongames.com/

Re:SpacetimeDB by XCSme on Thursday April 10, 2025 @10:18AM (#43644034)
As a gamedev, I don't understand the use-case for SpacetimeDB.

Is it simply to be able to persist the game state?

Re:SpacetimeDB by tomhow on Friday April 11, 2025 @06:17PM (#43659279)
Hey, can you please make your substantive points without shallow dismissals or snark? This is in the site guidelines: https://news.ycombinator.com/newsguidelines.html. Unfortunately you posted a few comments in this thread that have crossed that line.

If you know more than others as a professional multiplayer game developer, that's great, but in that case the thing to do is to share some of what you know, so others can learn. If you don't want to do that, that's fine, but in that case please don't post. Putdowns and swipes only degrade the discussion.

Re:SpacetimeDB by gafferongames on Friday April 11, 2025 @09:42PM (#43660576)
Excuse me Tom, please stop with ad hominem and attack the topic not the poster.
Re:SpacetimeDB by gafferongames on Saturday April 12, 2025 @12:17PM (#43665696)
Tom I'm afraid you're misreading the tone of my posts and their character.

I could post anything objectively true in this thread like "the sky is blue", and some idiot will post a one sentence response that in fact it's not. This idiot likes to be the last person getting snark in responding to a completely reasonable statement of fact or opinion by an expert in the space.

What I do differently is that yes, I do reply to the snark with a rebuttal. Is this rebuttal snarky? Potentially, but is it earned? Definitely.

You're moderator so let me speak to you that way. If you don't let people rebut bullshit in this comment section, you'll just end up with a bunch of uninformed discourse, where the final word is made by some idiot, who doesn't even make multiplayer games and everyone ends up thinking the sky is fucking green. This has real world consequence when future game developers try to build games on poorly made technology, which ruins game studios and people's lives.

Then again, it's hacker news, and what do a bunch of wannabe startup guys know about making games in the first place. Unskilled and unaware of it. Moderate away sir!

Re:SpacetimeDB by dang on Saturday April 12, 2025 @05:06PM (#43667942)
You can "rebut bullshit" without being aggressive and nasty. If someone else is wrong, it's enough to provide correct information respectfully. Putting others down, or slamming their work in a hostile way, doesn't help and degrades this community badly.

https://news.ycombinator.com/newsguidelines.html

Btw, it's quite common for commenters to underestimate the provocation in their own posts and overestimate the provocation in other people's posts. Those two factors can multiply into quite a skew in perception (https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...). I wonder whether this might be a bit of a factor here, if you really don't see how aggressively your comments were coming across.

Re:SpacetimeDB by gafferongames on Saturday April 12, 2025 @06:58PM (#43668588)
In my experience providing detailed information in a response in the comment section on this particular topic (game development and networking) in hacker news comments simply creates more surface area for nitpicking and arguing in response, so I keep to short responses and rebuttals.

In the future, I don't feel that writing anything more here on this topic is a worthwhile use of my time.

Re:SpacetimeDB by ViktorRay on Saturday April 12, 2025 @11:10PM (#43669767)
But I don’t understand. Why not both? You can have a short answer and rebuttal and still be kind and nonaggressive.
Re:SpacetimeDB by gafferongames on Sunday April 13, 2025 @09:33AM (#43672698)
Yes yes, everybody should be the Dalai Lama. But I'm not.

Each comment that I post, kind or not, when it's longer creates a larger attack surface area for people to nitpick and respond to. This in turn creates larger and larger posts I need to make in response.

By the end I need to write whole essays in the comment section, nobody wants this, so I just keep short, and curt so people stop responding.

For example:

> Ah you mean like implementing UDP and supporting complex lag masking netcode before we have to?

I could respond with an entire essay about how lag masking netcode and UDP-based protocols (both accepted and very standard best practices in the game industry) informs the design of data structures on the game server and how you store game state in order to support delta-encoding in a cache efficient way.

I could then explain how this most likely completely invalidates the current design of SpacetimeDB which is surely based around TCP synchronization using events when properties change, which doesn't scale when lots of objects change at the same time, and causes hitching when people play over a combination of latency and some packet loss because of head of line blocking.

But it's just so above the heads of the people reading this comment section, that it will spin off stupid responses like "Hurrrrr. But doesn't World of Warcraft use TCP?".

It's much easier to just realize that the game they're working on will most likely fail (because 99% of multiplayer games released these days do fail, if you haven't noticed, the game industry is in serious crisis), and if the game has no players, does it really matter if it's networked using UDP or TCP? End of discussion.

ps. The last game team that argued UDP vs. TCP with me was the team behind Stormgate backed by Hathora game server hosting. In fact, Hathora even spun up a ridiculous architecture astronaut architecture for this game based around TCP because they didn't know any better.

This team was adamant that they didn't need to use UDP, because they had implemented rollback netcode in an RTS, and TCP would be just fine with rollback netcode and edge termination with AWS global accelerator. This is objectively wrong, but it ended up not mattering, because their average CCU these days on steam is around 10.

Re:SpacetimeDB by pvg on Sunday April 13, 2025 @09:43AM (#43672749)
Yes yes, everybody should be the Dalai Lama. But I'm not.

You're just being asked not to be a jerk to people on a messageboard. It's the same thing being asked of everyone else so that we can have a decent messageboard and it's not difficult.