How do I upload a level made on LDTK using json?

0 favourites
  • 4 posts
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • Hi,

    I made a level for a game on a level editor called LDTK and it gives the option to save it as a json file and can you load it as json file to Construct 3?

    I am saving it as png at the moment but I just wanted to know can you save it as json and then upload it.

    Thank you

  • You can load it into the json plugin no problem. Then it’s just a matter of taking the data and creating equivalent construct stuff.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Is there a more detailed answer than this? I noticed LDTK seems a way ahead of Tiled these days..

    For example;

    Do I still use a tileset or individual sprites?

    How are layers handled?

    How are atlasses handled?

    Should I use javascript or events? There is a js library in ldtk.

    Has anyone written an importer before for c3? Have you actually done this? Is there a step by step guide anywhere?

    If the JSON format is consistent it seems like something the community needs doing once only and so might have already been done..

    Cheers

  • Not really.

    If the level data is in a grid then presumably you could load it into construct as a tilemap, otherwise as sprites. Tilemap is problematic if you can’t load a different image at runtime in construct. So probably you’d have to create tilemaps and sprites with the relevant textures first then parse the level data from JSON.

    Layers? You’d need to someone match up construct features with LDTK features. Construct is limited with what you can create or modify at runtime. Guess you could create a construct layer for every layer but that would be up to you.

    Atlases? Construct does its own atlases and you can’t really replace them at runtime. That’s why I said first create objects with the relevant textures then parse the json. Alternately you could load the texture atlas into a sprite and use distort maps to select sub textures. TiledBackground is another option but replacing texture at runtime is per instance with that.

    You could use events or JavaScript. Js is only an advantage if you make your own plugin here to be better tailored for LDTK features.

    If someone hasn’t posted a converter before it probably hasn’t been done.

    Even Tiled doesn’t have a full loader. Construct only lets you load a small subset of tiled features that match with tilemap features.

    In general getting the info out of the LDTK json should be straightforward enough once you start doing it. It’s the visual aspect that would require some creativity to do in construct imo.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)