Creating Tilemap Templates

Godot Version

4.2.2 Stable

Question

Hello everyone!

I have four questions, but before that here is the context. I am creating a roguelike similar to Isaac. I am currently working on room generation and I now want to, for a room of a particular size, create custom layouts and templates it could choose from. I am using the tilemap to create an individual room but it is saved a scene which because cumbersome fast.

  1. Is it possible to save the particular tiles I have drawn as a resource? As said, I’m making dozens of layouts and templates but saving them as a resource would make the way I spawn 2d nodes and the dungeon much easier.

  2. If the previous is possible, is it possible to change the visual of the layout by simply feeding a different tileset?

  3. How could I place tiles that signal to the scene, “An enemy needs to spawn here” or loot. I can handle the spawning but having the tilemap broadcast this need and fetch that information when loaded from a resource is where I am a bit dubious.

  4. In order to toggle doors open or closed and their collision as well, how do I fetch the particular information for a door when it has properties such as “locked” from a tilemap? Should I create a separate class that stores the properties and exact cell of the door in order to communicate visual changes explicitly?

Thanks for all the help!

1 Like
  1. Yeah it is possible, read this page
  2. Yeah
  3. Yes it is possible as create a scene of area that when player entered it, then it will emit a signal of spawn enemy. It is possible to using a scene in tilemap not only tiles
  4. Think and study

Thank you for your answer. Unfortunately it doesn’t help me much. I am asking if a Tilemap’s data, not the TileSet, can be saved as a resource.

The other answers I will find out on my own. Thanks.

1 Like

I think it can be possible by .json data save/loading,
If it not help you then search “godot save tilemap data” in Google
As of my knowledge, there is no way to save it as a resource however there are many plugins on it I think

  1. I don’t know about saving them as separate resources but in the TileMap editor, you can create patterns of tiles. I think you can only create a pattern of tiles that are on the same layer so I don’t know if it that will be enough. You would need to create separate patterns for floors, walls etc. (assuming they must be on different layers). Creating patterns is very unintuitive so you might want to watch a tutorial.

  2. You can just change the texture(s) of your TileSetAtlasSource(s).

  3. Scene tiles or a custom data layer.

  4. Create a custom data layer. Name it “locked”, select bool as the type and set it true for locked door tiles.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.