Finally, players can build together. In this update, I implemented player building and destruction into the game, all of course synced across the network. Lovely.
How does it work?
The system is built off of the deterministic nature of the world generation system: from the same starting conditions, any number of clients will always generate the same world. The beauty of this is that I don't actually need to have the server/host generate all the chunks, then send the data to all the clients, as is the case in a certain other block game. Instead, I just need to store the individual modifications made and send those instead.
As an example, when a player breaks a block, in the Bad System it goes like this:
However, in my system it goes like this:
Like all things, this is a trade-off. As you might be able to tell, the second system uses less bandwidth however at the extent of CPU usage. It's more intensive on the processor to have to re-generate the chunk every-time - though to a modern CPU, it's still child's play. However, to me this system is worth it due to the huge amounts of data being saved. This makes it much better suited to the player-hosted architecture used in Build Fight, as I have no guarantee or realistic expectation that the host will be running anything other than a below-average spec PC on below-average WiFi. I think I've managed to strike the right balance here between system and network performance.
Play it now! Build dicks! Etc!
Up next: storing block data, with the primary purpose of being able to destroy blocks gradually rather than instantly.
peterkirkcaldy@gmail.com