Did a bit of work cleaning up my code, as mentioned previously I am going to leave the graphics until later because I started to get too caught up in it and lost focus on the the functionality I need to make the client usable to actually play the game.
But I couldn’t stop tinkering so I abstracted the fixed terrain rendering code, now I have a
TerrainRenderer base class that the RoomGraphicsScene uses and I’ve implemented two sub-classes
ClassicTerrainRenderer (to do the basic blocky graphics like the official client) and
TiledTerrainRenderer to do the fancier tiled terrain rendering … So now I can switch between them by just instantiating one or other of the classes. This way I can concentrate on the core functionality and if I get motivation, feel creative or find a nice tileset, I can do a little work on the tiled terrain renderer and switch back to the basic terrain when I want to work on game mechanics.
Not content with that I decided to upgrade my test server to make it more stable so that I can run the simulation 24/7. The default install uses a file system based database called
Loki which is not very performant. There’s a mod available to allow the game server to use MongoDb instead so I figured last night was as good a time as any to make the switch.
Long story short, fun and games with
NPM followed and I ended up with a broken server. For some reason every time I tried to install the server mods over the base install
NPM would trigger the uninstall process for the server … which resulted in half the packages being removed.
Anyway, after reading bug reports about the same issue (which was supposed to be fixed in the previous major release) and several hours of swearing and declaring my hatred for NodeJS, I have my server working again and it’s using MongoDB.
The good news is, with MongoDB it’s performing a lot better. Usually the server would slow down and the game ticks would lag after a few hours, now it’s been running over 16 hours and the Creeps are still flying around the room.
I’m going to leave the Creeps building some test infrastructure for me while I go have some Christmas dinner with my family.
Happy Christmas all