Autotiles, how do they work?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Vital

I recently got into godot and game making in general. I’m trying to create a very generic platformer, and tried using the autotiles to make my work go by faster. Here’s the bitmask and tileset, I know there could be more added and not all of them are painted, but I just took the ones I needed for this small project:

The bitmasks

For the most part, it works pretty well.

Example 1

Example 2

However, whenever I try to make a corner, the tiles connecting to it apparently can’t tell which one’s supposed to be there and it just picks whichever one happens to be the icon of the tileset.

Example 1

Example 2

Could anyone explain why this is happening and how to fix it?

:bust_in_silhouette: Reply From: kidscancode

I’m assuming you’ve set the bitmask mode to 3x3 minimal.

You don’t seem to have all the required bitmaps set. 3x3 minimal requires 48 tiles, because that’s how many bit combinations are required to cover all the possible tile arrangements.

Here’s a link to a picture with all the required bitmasks defined:

As you can see, you’re missing some, plus you have duplicates defined in the upper left portion. Autotile does not care (or know) what the tiles look like, it just needs all the correct bitmasks so it knows which one to choose based on the tile’s neighbors.