go-tiled
go-tiled copied to clipboard
[Feature] Infinite maps
go-tiled currently has no functionality to load infinite maps and will panic when this is attempted:
panic: illegal base64 data at input byte 0
Can you provide small sample tmx file for that?
I've taken a look at this issue and looks like the problem is that Tiled uses a different format for infinite maps.
<data encoding="csv">
<chunk x="0" y="0" width="16" height="16">
...
</chunk>
<chunk x="16" y="0" width="16" height="16">
...
</chunk>
<chunk x="32" y="0" width="16" height="16">
..
</chunk>
We can "easily" parse all the chunks and load everything into layer.Tiles but I'm worried about really big maps. I think there should be a way to get data as chunks.
My initial proposal after 10 minutes of thinking is to add a new type "Chunk" that will store a slice with the tiles of that chunk pointing to the layer.Tiles slice. This way we keep compatibility for simple maps and allow a controlled way of parsing huge maps.