Export tile layer as a map data type

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.

Hey @Clamic, welcome to the Tiled forums!

If even infinite mode doesn’t suffice, even though the chunks are quite small, did you consider using object layers instead of tile layers? They could be more suitable when your layers are that sparsely filled.

Otherwise, of course it’s still an option to implement your own export format. If you install a development snapshot you can implement a custom map format in JavaScript.

1 Like