I had a dream early this morning:

I was working on the game, same as any other day. Nothing was different or special, it was my same little RGB sprites in my same little void with white boxes. I was working on something stupid. A UI element.

But suddenly people started connecting to the game. New little guys started popping up all over my little white box void. First just a few, but then a ton. Eventually there were dozens of them.

But then they sort of morphed together into one. But more and more and more and more people kept connecting. Instead of new little guys spawning all over the map, it was just one big guy, getting bigger and bigger and bigger and bigger every time a new person connected. Eventually he was looming over me, not the little guy in the game, but me, Charlie, and he was so big he triggered my megalophobia and I woke up.

When I woke up I realized that every time a player is connecting to the server right now, they’re being pushed every bit of info about a character. When 5 players connect, all 5 players get all of the information about the other 4 players even if they’re not going to do anything with it. Initially I thought it would be good to cache this data on the clients, but the massive guy looming over me was the memory leak I was introducing into the system.

So I had to completely shift my mentality.

The game will not eagerly push any data to any clients anymore, whatsoever, unless absolutely necessary for the game to function. Anything else will be pulled on demand as needed from the server. I spent a long time this morning in a couple of MMOs proving that this is how they do it too.

This wasn’t a small undertaking. This required basically gutting and reworking a huge portion of the multiplayer system. A lot of the code was written assuming that the character data for every other character would just be there, available for me to see at any time. I had to rewrite all of it.

It’s for the best, in the end. It helped me to separate some pieces of code which should’ve never been joined, and I had been looking for an excuse to separate anyway.

It’s also a more solid backbone for everything else that will come later.

But boy was it a pain in the ass, and boy did it take a lot of time.

I’m not sure what tomorrow will be. I might hammer out the account select and login system just to say the pre-game stuff is fully done, or I might start working on NPC dialogues.

Please enjoy this visual representation of my dream.