Godot Version
4.3 Stable
Question
Hello!
I am very new to Godot and am experimenting. I am trying to create a random ‘dungeon’ with different rooms. Each room has a theme and a terrain to match it.
I am creating the rooms randomly in code and using: set_cells_terrain_connect(cells,0,Tiles.get(room.type))
to autotile each room with at least a 1 tile gap between each room.
So far, this works well.
However, I am trying to link the rooms with a corridor. The corridor has its own terrain. When I place the corridors, it draws them in the correct place, but the autotile doesn’t choose a tile that looks like they are connected. In other words, the corridor terrain doesn’t see the rooms at either end of it.
All the terrains are part of the same set: Terrain Set 0.
I am sure I read that we should be able to link different terrains as long as they are in the same set, but I cannot figure out how.
I tried making all the terrains the same index, but that meant I couldn’t differentiate them and they were jumbled up.
I tried having the center bit different for each terrain, but the peering bits the same between terrains, but then it wouldn’t even match with anything, even itself.
I tried creating alternate tiles for every combination of corridor/room but that wouldn’t detect the rooms either.
Clearly I have misunderstood something, but I cannot work out what.
Please help!
Edit to add a picture:
Left is what I want to happen, right is what is happening.