I have divided my tiles into separate TileMapLayers. In this example three layers
Ocean
Land
River
The reason for the division is so that I can apply a shader to each layer.
The problem is once tiles are on separate layers, peering bits in the terrain don’t work between layers. The example picture below, it is impossible for the ocean tile to detect a nearby river tile in order to update its tile to show a waterfall. Or at least I think it’s impossible from Godot’s interface.
Is there something I am missing that allows for this kind of behavior? TileMapLayers are designed to encourage separation, but then to not allow terrain matching between them makes it seem like I am doing something wrong, and I am surprised I couldn’t find any comments about this online.
Are you planning to create the tilemap at runtime later on? If that’s the case this would probably be the time to start working on it and do everything in code, where you can easily check tiles at other layers. Otherwise, as far as I know, there is no way to do terrain matching between layers and you’ll have to place the tiles correctly manually.
Yes, I do plan on that. And a relatively simple way to fix this in code in my example is to copy the Ocean and Land tiles to the same layer as the river tiles are on, but the Ocean and Land tiles are transparent on this layer. This seems to be the easiest way to detect this without any extra code checks.
You might consider making an invisible TileMapLayer that’s entirely about terrain generation, maybe using symbolic tiles, and then populate the visible TileMapLayers based on the contents of the invisible one. That way you can have one layer that drives the terrain generation, but proper separation of your layers for drawing/shading.
You might also find that useful for debugging and pathfinding.