I am currently developing a 2D platformer and wish to make big levels. The issue with this is that the bigger the level - the exponentially larger the level is to save/load since the tile layer data becomes massive. My levels generally only use about 15% of the tiles available in the map, so when my program loads up the game, it is going through a lot of tiles with no gid value which is really inefficient. I am trying to find some sort of way to have the exported level file display tilelayer data in a map data structure. So instead of something like this 1, 2, 0, 0, 0, 0, 0, 0, 0, 6 it would rather read as something like [0, 0] = 1, [0, 1] = 2, [0, 10] = 6 . This would fit the game I am designing much more effectively. So is there any easy way of achieving this?
Ps. I am aware that infinite mode would be an improvement over my current situation but having the data in a map would be much more efficient.