Tech Notes, Data Architecture

highly technical post for myself - don't bother to read this!

I'm thinking about how to build a mutliplayer procedurally generated game, and specifically how to organize the data for the game, so that it's easy to save and load, easy to transfer over the network, and works well with a "node tree" of a typical game engine (unity/unreal/godot).

So, what I loved about the entity collection the way we use it in wildermyth, is how it so simply and concisely encapsulates ALL THE DATA in a domain.

Does a thing need to be saved and loaded? Then it's in an entity. Does it need to be displayed by rendering systems? It's an entity. It made for a very clear and simple organization of things.

Ok, so, node trees are a bit different. They're hierarchical for one thing. They're inheritance driven. I'm not here to fight that, the whole point of using a modern game engine is to benefit from it, so if that's how things need to be organized in order to render/physics, that's probably totally fine.

But like, say I'm loading a game. I need to take all the data in the file, and use it construct a node tree. How is the data organized in the file? How is it organized when we send it over the wire for multiplayer? Backing up, how does it go from being generated, to being displayed? There has to be a recipe at some point for making the node tree.

And the data should presumably in a way that makes that easy, and in a way that's useful for any "headless" work we need to do. It's not totally clear if there is much/any headless work to do? But let's think about that, too...

I like the idea, in theory at least, of maintaining a server/client setup, so that the data and logical flow of single-player is exactly the same as multiplayer. This would please me enormously. What that would mean, perhaps, is keeping a set of entities that is just the servers. The client sends messages to the server, and the server sends messages back, and the client updates the node tree.

This is a bit different / extra, from how multiplayer generally works in a modern game engine? It seems like there's not expected to be a separate data domain, when playing single player. I wonder if I can have the extra data domain without introducing performance issues? Probably. It would be easy to run game logic on the server's copy of the data, and send updates to all the clients.

There is some weirdness with physics. Physics is really going to want to operate on the node tree, right? And then you're going to basically use the results of the physics on the host machine, but not those from multiplayer clients. So, maybe the "server data" isn't really that independent. But it still might be useful for having a clean definition of what gets saved/transferred.

I feel like getting a multiplayer / save / load thing working early would remove a lot of fear and doubt from my mind, so I might work on that.

Comments