Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Infinite maps #10

Open
k80w opened this issue Jun 30, 2019 · 3 comments
Open

[Feature] Infinite maps #10

k80w opened this issue Jun 30, 2019 · 3 comments

Comments

@k80w
Copy link

k80w commented Jun 30, 2019

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
@lafriks
Copy link
Owner

lafriks commented Jul 17, 2019

Can you provide small sample tmx file for that?

@k80w
Copy link
Author

k80w commented Jul 21, 2019

Can you provide small sample tmx file for that?

Here's a TMX

@MetalBlueberry
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants