Prototype icon indicating copy to clipboard operation
Prototype copied to clipboard

Easier testing for map based engine code

Open pcen opened this issue 3 years ago • 0 comments

Writing tests for engine code involving the map is currently difficult, largely due to the fact that the only easy way to get an instance of a GameMap is by loading a save file. Tests based on reading from save files may also prove problematic since more data will be read from saves as the code base progresses, meaning that the baseline for tests relying on save files will change over time. In order to test engine components such as pathing and AI, it would be easier to write tests if controlled map instances could be created in code or via a simple file describing a scenario. The implementation of this may look like functions to create map segments (ie, a 10 x 10 tile map) and to place units or cities on the map, essentially enabling writing headless integration tests in a controlled game.

pcen avatar Apr 09 '22 03:04 pcen