Refactoring and Testing

When I started programming on The Ground Gives Way some time before 2009 it started mostly as an experiment. In fact I first started on an over-ambitious Roguelike, then I started on an under-ambitious Roguelike (too simple, not fun enough) and finally I made The Ground Gives Way. It has grown quite organically and it includes many different styles of code. I guess this is very normal in roguelike programming. Unfortunately it means that the code has become quite ugly…

I am also not happy with the amount of bugs in previous releases, although it is impossible to launch a fully bug-free release, I still feel very uncomfortable whenever someone finds a bug…

Right now I am working on refactoring, cleaning up and generally testing the code. I am not adding much of new features at the moment, but instead work through the code to make it more maintainable and robust. I am also adding design-by-contract to the code and testing functions for most classes. This is for me to be more confident that future releases have less bugs. While these things should ideally have been implemented from the start, I think this is better to do now than not at all.

It is very satisfactory to clean up the code and I get a lot of inspiration from the book Clean Code by Robert C. Martin, I highly recommend it to any developer!

There are few new features implemented as well: the messages are now better colour-coded for hits and misses and you now auto-pickup valuables and equipped ammunition. I don’t currently have any time frame for when a new release will be ready though.


  1. I’m not a coder so I have to admit some of this goes over my head but I get the general idea. 😛 Good idea to get this out of the way sooner than later, as I can imagine letting it build up over time could make it a bigger issue than it needed to be.

    1. Yeah, I haven’t been writing about my coding before, and I’m not sure any coders are reading… Anyway, this is also to let you know that I’m working on the game even if it seems like nothing is happening 😀

Comments are closed