You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've been banging my head against a wall (ha!) trying to successfully parse collision data from a tiled map and at first I thought it must be me :-)
Now I'm not so sure..
the issue is with collision data added to a tileset using tiled's collision editor to add a collision object (rectangle).
what I think should be possible is something like:
this is what is done in the example 'examples_cute_gl_and_tiled_and_spritebatch' print_ functions too.
Using those is also a good way to reproduce it:
using that example's code (just add a return after the call to test_map("test_map.json")) since we don't care about the rest, load the example provided tilemap and observe the printed output.
now open the map with tiled, edit its tileset and add a collision rectangle to any of the tiles, save both the set and the map.
(I've attached that file for convenience, edited with tiled 1.11.0, the collision is added to the 'sign' tile.)
run the test code again, it should crash when it tries to print_tilesets->print_layer(tile->objectgroup)->print_objects(layer->objects).
it crashes with an access violation, leading me to suspect that perhaps something is not being allocated correctly somewhere.
For context:
what I'm actually trying to do, is parse the map data so I can render each tile (works perfectly!) and at the same time, for each tile, lookup its tileset and in it any collision 'objects' and then save that out to some separate container for later processing
Hi there, I don't super actively work on cute_tiled these days since I'm not using it to make any games currently. Did you notice cute_tiled is made to work with 1.5.0? 1.11 is quite a lot newer, so things might not be matching perfectly. This would probably require some debugging and testing to make sure it's working with the newest Tiled version, which isn't something I can myself spend time on currently.
Yeah, I am aware that its not (tested/built with) for newer versions, which is a shame since (afaik) its currently the only 'easy' single header library for doing this (in c), but I guess priorities change and all our time is limited... 😅
To be clear, stuff does work as is even with the newest tiled version (at least the parts I'm using...).
I'm able to parse the information I need from the exported tiled map, and if I access these things 'separately' (as in iterate over the tilesets, store the per-tile collision/object info, then iterate over the different layers for rendering somewhere else.
It just seems like accessing the tileset while going over the layers somehow breaks, not quite sure..
Uh oh!
There was an error while loading. Please reload this page.
Hi, I've been banging my head against a wall (ha!) trying to successfully parse collision data from a tiled map and at first I thought it must be me :-)
Now I'm not so sure..
the issue is with collision data added to a tileset using tiled's collision editor to add a collision object (rectangle).
what I think should be possible is something like:
this is what is done in the example 'examples_cute_gl_and_tiled_and_spritebatch' print_ functions too.
Using those is also a good way to reproduce it:
using that example's code (just add a return after the call to test_map("test_map.json")) since we don't care about the rest, load the example provided tilemap and observe the printed output.
now open the map with tiled, edit its tileset and add a collision rectangle to any of the tiles, save both the set and the map.
(I've attached that file for convenience, edited with tiled 1.11.0, the collision is added to the 'sign' tile.)
run the test code again, it should crash when it tries to print_tilesets->print_layer(tile->objectgroup)->print_objects(layer->objects).
it crashes with an access violation, leading me to suspect that perhaps something is not being allocated correctly somewhere.
For context:
what I'm actually trying to do, is parse the map data so I can render each tile (works perfectly!) and at the same time, for each tile, lookup its tileset and in it any collision 'objects' and then save that out to some separate container for later processing
test_cute_tiled.json
The text was updated successfully, but these errors were encountered: