• 2D
  • Doing a platformer with Tiled

Hey,

I just recently found out about Godot, and it seems to me to me more powerful than what I initially thought. To play around and learn it, I'm working on a platform idea.

Now, I really like Tiled, and the idea of using that as an "level editor", instead of doing the level in Godot. I'm thinking that it would be smart to somehow "paint" the level in Tiled, and then (with some code logic too) read that level in and add things programmatically. I noticed it's possible to add "custom properties" which would be added soon here too (hopefully) https://github.com/vnen/godot-tiled-importer/issues/12 . Using this I plan of putting things on different tile layers in Tiled, with custom properties where I then in Godot can use this to add things per layer. Do you experts here think this is a good approach or am I missing a smarter way? Personally I would have liked a way to add a custom attribute to tiles themselves instead, but don't see a way to do it. That way I think it would be easier to add things like adding StaticBody2D and Collision2D nodes.

One of the big reasons I like this approach is that this way it would be rather easy to change tileset, because if I do everything in Godot, it will be hard to change tileset later. With the whole level separated, and things added to it in code, Tiled really would work like a flexible "level editor".

What are your thoughts on this? How would I go on doing this?

Thanks!

If all you want is collision, Godot support those on TileMaps and my plugin imports the shapes made in Tiled's collision editor.

Now, if you want to make more stuff, like replacing certain tiles by enemies, making dynamic exits, etc. you may be able to generate the map from a Tiled import. Godot does not support metadata per tile (at least not yet), but you can make specific layers for the dynamic elements.

I would also advise to make this generation offline, since you're hand-designing the levels anyway. Making the generation in the game itself might make it too slow.

Ah, Hi! You are the guy that does the plugin too. How handy. :)

Well, so, it might actually help then if when importing, the plugin could also generate nodes per tile. If the importer could have an option to specify what nodes to attach, that would help I think. Especially if if were possible per layer. I couldn't make the imported scene actually interact with the RigidBody2D I had in the scene. I'm guessing since the tiles were missing StaticBody2D and Collision2D (and RectangleShape2D)?

10 days later

Forgot to answer this, sorry.

I don't think that adding a lot of options to tweak the tiles/maps is a good idea. It would make the plugin unnecessarily complicated and it wouldn't quite accommodate different workflows.

What I propose instead is to support a post-import script. So you can take the data and generate what you need from it. This would allow to make very complex things without making the plugin itself complex and it would remove the need to manual processing of the input.

This would be similar to how Godot import scenes from Collada files.