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

Investigate multiple tilesets #54

Open
bcvery1 opened this issue Mar 27, 2019 · 2 comments
Open

Investigate multiple tilesets #54

bcvery1 opened this issue Mar 27, 2019 · 2 comments
Labels
enhancement New feature or request info needed This issue requires more information adding priority:medium Required for this release

Comments

@bcvery1
Copy link
Owner

bcvery1 commented Mar 27, 2019

TilePix has not been tested using multiple tilesets. This should be something which is tested (manually and with test assets!) to ensure at the very least a sensible error is returned, but ideally that it is handled correctly.

If any sort of code change is required, should be created in a separate issue first, this issue is for investigation only.

@bcvery1 bcvery1 added enhancement New feature or request info needed This issue requires more information adding labels Mar 27, 2019
@bcvery1 bcvery1 added this to the v0.4.0 release milestone Mar 27, 2019
@bcvery1
Copy link
Owner Author

bcvery1 commented Apr 10, 2019

Looks like this will be relatively easy. Each tileset has a firstgid attribute which indicates the first ID relating to this tileset. So the first tileset may start with 1, and the second with 216, for example.

Need to alter the sprite setting to use the other tilesets if the GID is high enough.

@bcvery1 bcvery1 added priority:medium Required for this release and removed priority:medium Required for this release labels Apr 10, 2019
@LordEidi
Copy link

Have you worked on this yet? While debugging a division by zero exception in tilelayer.go > Draw() I stumbled over the underlying problem. That's at least what I think.

So I have that map containing a few Layers and some Layers contain sprites from different TileSets. When loading the map somewhen code runs through tileset.go > getTileset() where the function returns useMultipleTilesets = true. That results in tilepix.go > Read() to not set the TileLayer's Tileset on line 132 because execution jumps out of the for loop before doing so.

I have to admit, I only played around with tilepix for a few hours and am a bit lost how to solve this.

From what I understand, we would have to have links to multiple TileSets on every TileLayer. But there is a link between TileSets and Batches. Which means that we also would need to have multiple Batches per TileLayer.

I get the impression that TileSets and Batches should be stored globally and only be referenced in TileLayers to not have the same sprites in memory multiple times. This would also make two things simpler: Using sprites "outside" of tilepix and managing animated sprites.

Looking forward to your comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request info needed This issue requires more information adding priority:medium Required for this release
Projects
None yet
Development

No branches or pull requests

2 participants