ldtk icon indicating copy to clipboard operation
ldtk copied to clipboard

Creating an export from LDtk to Gamemaker Studio 2 rooms

Open Ailwuful opened this issue 3 years ago • 10 comments
trafficstars

This is a request to make an export option from LDtk to create room files that can directly be used in Gamemaker. The room.yy files from Gamemaker are already a JSON file, and it should be fairly simple to make an export for it. Here’s a link for the room file from Gamemaker for you to check out. It’s a pretty small file, it has only an Instance, Tile and Background layer. And the room is 4x4 tiles.

And here's a link to a document of me trying to explain to my best ability how you can create the room file.

I'll love it if you can do this.

Ailwuful avatar Mar 25 '22 08:03 Ailwuful

I wonder if YoYo games made some documentation on creating GMS rooms via JSON? It would certainly be cool if there's an official resource on that 🙂

Cammin avatar Mar 25 '22 20:03 Cammin

There doesn't seem to be. I could put a request for a documentation topic from the website. But the room file is pretty straightforward. There may be a lot of fields for customization that Gamemaker has but a lot of it doesn't get generally used. They can just stay as default values. If any questions arise from what certain variables are, I should be able to answer.

Ailwuful avatar Mar 25 '22 21:03 Ailwuful

Tiled does this so if this feature is considered, that might be a good place to get some information from as well. Here is their docs page on the export: https://doc.mapeditor.org/en/latest/manual/export-yy/

The room files are decently straight-forward, but I'm sure if you run into any snags, you'd be able to contact the creator of Tiled as well.

FaultyFunctions avatar Mar 30 '22 06:03 FaultyFunctions

Thanks for these info :) The Tiled author was super helpful and nice every time I had the occasion to chat with him, so I won't hesitate to get in touch if I have any issue with the yy format.

deepnight avatar Mar 30 '22 08:03 deepnight

I started working on something, but I would need more examples to reverse-engineer the format.

I especially need something like that:

  • a room with a Tile layer and an Object layer (ie. the equivalent of Entities, not sure about the name)
  • a tileset

I would need all the .yy files from such project :)

Side question: is there any equivalent of the IntGrid layers in GMS?

deepnight avatar Mar 30 '22 12:03 deepnight

Hi. This makes me very excited! I did link a download to a room file. I just noticed I can drag the file here, though. I'll do that. I'm putting a lot of files, including a pdf to the document I wrote in case you prefer it. Gamemaker files.zip

There's no equivalent to an IntGrid layer in GMS. If someone wanted to use the IntGrid in their game they would have to code something to use it. Personally I did something similar but by just reading the first layer of tiles, I always delete the IntGrid values layer since it has no use to me. Regardless, I don't think anyone expects an IntGrid layer to come along the export, but I can see how it could be useful to some people.

Let me know if you need any help.

Ailwuful avatar Mar 30 '22 19:03 Ailwuful

I am very excited about this feature. Is this already in the beta or no?

HeadClot avatar Mar 31 '22 00:03 HeadClot

I am very excited about this feature. Is this already in the beta or no?

Not at all, available for now :) This will require quite a lot of work, so I can't give any estimate for now unfortunately.

deepnight avatar Mar 31 '22 08:03 deepnight

I am very excited about this feature. Is this already in the beta or no?

Not at all, available for now :) This will require quite a lot of work, so I can't give any estimate for now unfortunately.

No problem! Take your time then :)

HeadClot avatar Mar 31 '22 08:03 HeadClot

Just adding a note here for anyone who stumble upon this: https://github.com/Gamer-XP/LDTK2GMS2Pipeline I've written an external tool that allows to convert data back-forth between GM and LDTK. You can try using it if you need.

Gamer-XP avatar Mar 08 '24 17:03 Gamer-XP