Tile Map Save
I made a start with the functionality to save the tilemap. Currently the tilemap is hardcoded into the game. So there are two steps that need to happen. One being the generation and the other being saving & loading the modified tilemap. So I started with the second step.
Of course I don’t have much time in the train. But I did manage to write a file with some info in it already. Luckily I only have to save the tiles that actually have meaning. Then when loading the tilemap back into the game, it can generate a proper tilemap from only those tiles again. Though it is actually only generating the tile chunks. But yeah, the tile chunk info doesn’t have to be saved.
So what is getting saved to the file? The tile map info, like how big are the chunks and how big is a tile in meters. And tiles that have actual meaning. Uninitialized tiles or tiles that can not be driven (which are tiles with ID 1) won’t be saved to disk. Since these are regenerated at runtime, as chunks get initialized with non-drivable tiles.
Entities are not part of this save & load. It really is only the tilemap. I guess saving the level could be a nice next step once this tilemap system is done. Then we can actually use the editor code to generate levels.