-
Notifications
You must be signed in to change notification settings - Fork 30
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
Expected values removed from tiledmap data format version 1.10.2 #111
Comments
Hello, @twje, and thanks for your issue 🙂 Could you post a |
Hi @SSBMTonberry. Attached is a zip file that consists of a tiled map with a single embedded tileset based on a collection of images and one tile layer. Unlike tilesets based on a single image, spritesheet, where It's also curious to note that |
Thanks, @twje 🙂 As stated in the Sounds like I should prioritize getting that issue done soon... If you are interested in looking into this, just tell me, and I'll assign the #30 task to you :) |
The fix has been applied in a personal project. I am happy to clean up the code and push a pull request. However, it might be until next week before I find the time to complete it. |
Feel free to do it whenever you have the time 🙂 |
Do you have a preference on updating the demo maps to showcase this feature? The options are, add a tileset based on a collection of images, to an exisiting map or create a new map. |
I would prefer if you created a new map to showcase this feature. That way it cannot affect any of the previous demos, and I think it's a bit cleaner that way 🙂 |
There is a bug when adding missing tiles that do not have property data. Tileset::generateMissingTiles adds missing tiles based on the Gid. However, two Tile instance is added for a given tile if it has properties. Similarly, the same also applies to tiles from an image collection tileset. One caveat to note is that this bug only manifests for tilesets with a first Gid that is not 1. Attached is a For example, consider a tileset with a first gid of 10 and and single tile that has property data:
There should be one Tile instance:
The solution is to amend Exisiting Code
Revised Code
The code change does not break the exisiting unit tests or demo test maps. As this bug is on the critical path of implementing the image collection tileset feature, I can fix it as part of this feature or raise a separate issue for it. Somewhat related, I am curious why you chose to represent tile ids starting at 1 and not 0? |
@twje : If it's critical for the feature to work, you are welcome to include it in the same PR, but if it were unrelated to the feature, I would have liked it to be in a separate issue 🙂 The main reason why |
Hi @SSBMTonberry, This fix would also address issue #110. In a tileset, the IDs of tiles are local, which allows them to reference one another within the same tileset, for example, animation frames. At the moment, missing tiles are being assigned a global ID for their local ID. It's an interesting and somewhat tricky bug because it only shows up under specific conditions: when the first global ID (gid) of a tileset isn't set to 1, and there is no metadata for the tile. I will push a PR for #110 instead of creating a new issue. |
A PR for #110 has been pushed |
PR #117 to add support for Image Collecton Tilesets has been pushed |
The parse fails due to values removed from tiledmap data format in version 1.10.2.
For image tilesets, the json values
imagewidth
,imageheight
andimage
are not present. These are only available for spritesheet tilesets denoted by when the number of columns is greater than 0.In addition, Tile::performDataCalculations() throws a division by zero exception for image tilesets when
columns
is 0.The text was updated successfully, but these errors were encountered: