8 points · by memalign · 1y ago · 5 comments
One of the parts of this project I enjoyed the most:
To aid debugging and unit testing, I use a deterministic random number generator called GameRand. In debug mode, I can capture the random seed and log of every action taken in the game. Then I can replay that to reproduce a bug or create a test.
I ended up creating nearly exhaustive test coverage this way.
A write-up with more technical details and links to source code:
Another text-based picture format is XPM2, and is one that I had used sometimes (I wrote a implementation of XPM in C, supporting encoding and decoding all three formats; other implementations I have seen have many limitations and bugs). PCEImage could be used as a simpler format in case you do not need all of the features of XPM (such a a monochrome palette and symbolic colours), although it would also be possible to use a subset of XPM2.