Tileson - A Tiled json parser for Modern C++

@SSBMTonberry
Lol I thought I had the most recent version :sweat_smile:

I got your demo to work! Lol now I need to study it and understand what is going on inside the program. Thank you so, so much for helping me out with this. I really really hope you can find the time to finish this demo

@SSBMTonberry
Hey attached is one of my Tiled maps, well the JSON file of it. Could you look at it and tell me why it’s so different looking then the one in the demo?untitled2.json (105.8 KB)

@Shadow001: I can look at it after work tomorrow. Meanwhile you can see if you get any help from looking at the newest SFML example :slight_smile: I added drawing of image layers, and drawing of the object types of the type “object”. Not far away from having an example for drawing the whole map now, but sadly I have to call it a day. I’ll get back to you tomorrow night :slight_smile:

@Shadow001: I took a quick look at your map, and noticed that you data is base64 encoded. At this point this is not supported by Tileson, so the parser will not know what to do. You should be able to load the map if you go to map properties and change the Tile Layer Format to CSV. Also the Tile Render Order might affect how the tiles are drawn. The demo map uses “Left Down”, while you are using “Right Down”.

I now have a full example that draws all the parts of the demo map using SFML in my latest commit. Now got it building on Linux (GCC) and Windows (using MSVC). Should build on OS X as well, using the homebrew version of llvm, but I have yet to get that verified. I got an old mac lying around, but I won’t have the time to verify that it works today.

@SSBMTonberry
Thank you so much!!! Also thank you so much for all your help and patience!!!

@Shadow001 You’re welcome :slight_smile:

Hi again,

I have a question a little bit off topic:
As soon as I made my render function in a standard game loop, my framerate become too slow to be pleasent to see (8<framerate<20 FPS)

My question: is the idea of rendering all my map (not only the displayed part) is absurd (even for quite small maps (ie. 50x50))? or should I consider a new loop pattern?

50x50 isn’t big at all and should not cause problems. Are you sure you’re rendering the map in a performant way? For example, are you perhaps rendering each tile with its own draw call, instead of batching them into fewer draw calls? Are you perhaps generating the drawable object(s) from the data on every frame, instead of having your drawable(s) created once and reusing it?

(This is very off-topic for this forum though, so I’d recommend taking it to DMs or another forum, as this one doesn’t have an off-topic section.)