Godot Version
Godot 4.6.1
Question
I need to convert a TileMapLayer to an array of plain integers representing the tile indexes, eg. [0, 1, 2, …]. This needs to be quickly done at runtime so I would prefer to process the raw tile data instead of calling a method on each tile. I know TileMapLayer.tile_map_data contains the raw data of the map, but what is the format of this byte array?
For instance, if I have a map with a single atlas source and I place tiles 0, 1, 2 in the upper-left corner I get out the byte array [0, 0, 0, 0, 13, 0, 0, 0, 1, 0, 0, 0, 0 …]. I would assume the map is a bunch of 32-bit unsigned little endian integers but it seems like a lot more is stored there…