Issue with Top-Down Tilemap and Autotile/Terrain Tool

Godot Version

stable: 4.2.1
(not nessesary but: Windows 10 22H2, Ubuntu 23.10 & 22.04)

Question

Hello everyone

Can someone help me with this Terrain/Tileset/Tilemap Problem?

I’m encountering an issue with using Top-Down Tilemaps in Godot and I’m hoping you can help me out. I’ve found an example from older documentation that shows me how to set up a tileset and make use of the Autotile and Terrain Tool. I’ve also attached a screenshot showing the example tile used and the configured terrains (3x3 bitmask).


(matching corners and sides = 3x3 bitmask)

My problem is that some tiles are being incorrectly placed. In particular, this issue arises when I draw a 1 tile wide line. Then, that 1 tile wide line starts and ends with an upward curve. This seems wrong to me. Why do I have to draw the 3x3 bitmask for tile recognition if it’s not going to work correctly?

I found an issue on GitHub stating that this behavior simply isn’t intended. But why? Isn’t this a basic functionality that can be expected? https://github.com/godotengine/godot/issues/87929

I understand that Godot requires a lot of work and dedication, and I don’t mean to downplay that. But I have to be honest, it’s frustrating. Why aren’t these features properly completed? The Polygon Tool for, say, PackedVector2 is also a standard functionality missing, in my opinion. Instead, I was recommended to write my own extension. But the Polygon Tool is already there, isn’t it?

I could of course try to download the Godot editor source code and improve this feature myself and start a pull request, but my programming and algorithm design skills aren’t particularly advanced. Plus, it seems like the development team is already drowning under a flood of pull requests. Current count: 2367 pull requests on GitHub. That’s quite overwhelming!

I love the simplicity of Godot, but some features should just work properly.

Apologies for the rant, but I had to get that off my chest…

Thank you in advance for your help and understanding.

[Edit:]
Or do I need one tile for each bitmask variant = 2^9 tiles? So 81 tiles?

You don’t have to add a tile for every possible bitmask variation, just the ones you intend to use in your game. Some of them are unlikely to look good or work well and the templates you see will generally leave those out.

The problem in your case is that you haven’t masked some of the commonly used tiles correctly.

Take the tile highlighted in the image below for example. In the autotile template which you seem to be using, that tile would be the highlighted one.

Notice that the top-right bit is not set, because you want this tile to be displayed when there is no tile to the North-East.

In your tileset, the top-right bit in that tile is set (circled in green). Notice also that there are a bunch of duplicate tile masks because you have set bits on a bunch of them in that centre section that should be unset (indicated with different colour dots).

1 Like

Super mega thank you very much! :kissing_heart:

I knew it… I’m stupid.