So I’m supposed to be caching data now?

That’s it. That’s the thought.

So I’m currently figuring out how to make a multiplayer game better. The netcode for Life Not Supported works to a degree but is no where near as ironclad as I’d like. There’s a stupid bug where if a client leaves the game. Sometimes they can come back with an empty inventory or in a position that they weren’t expecting.

Turns out, I should be caching player data as the game goes on (and when a client leaves). Then when a client joins the game, I can check the cache for some previous data that’s more up-to-date than anything on file. I’ve just tested this out with rejoining, alt-F4-ing clients and it just works great. This will hopfully change the rigidity of future games that I make.

Unfortunatly, as much as I would like to re-write Life Not Supported some day – it’s not likely to happen. Even something as seemingly little as this goes against how the netcode for Life Not Supported it set up. That game writes everything to file as it happens but sometimes also not wuite when it happens. A lot of lessons learned, with a lot more to come.

I bet this is like gamedev 101 but here we are…

Leave a comment