Hello everyone, you have come to part 5 of the game programming series Godot. And in this tutorial, I will guide you to create tilemaps using a more advanced function, Auto tile. Before that, I also had a tutorial article on how to use Autotile, but at that time my knowledge was still very weak so there were a lot of mistakes and now I will guide you again in a more specific and detailed way.
📢 Join the channel Telegram belong to AnonyViet
Update new articles, cool tools and IT tips fastest
In this article, I will help you how to create Autotile, and for those who don’t know, this Autotile can help you design your Level automatically instead of doing it manually in lesson 4. It’s also very easy, not difficult at all.
Create Autotile
1 . Create Autotile
First, access Tileset in the Inspector Tab of Node Tilemap
![[Godot RPG]#5: Autotile [Godot RPG]#5: Autotile](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-09-36.png)
Then select your existing Tileset as Forest
![[Godot RPG]#5: Autotile - Godot Engine 28 game programming [Godot RPG]#5: Autotile - Godot Engine 26 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-10-28.png)
And then you proceed to choose New Autotile for yourself.
![[Godot RPG]#5: Autotile - Godot Engine 29 game programming [Godot RPG]#5: Autotile - Godot Engine 27 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-11-20.png)
Remember to turn on the Grid to get a grid shape
![[Godot RPG]#5: Autotile - Godot Engine 30 game programming [Godot RPG]#5: Autotile - Godot Engine 28 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-11-55.png)
Then blacken the area that needs to be selected. And note that anyone who is using my tileset should choose like me.
![[Godot RPG]#5: Autotile - Godot Engine 31 game programming [Godot RPG]#5: Autotile - Godot Engine 29 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-13-02.png)
For other tilesets, you will have to base on their size to have tilesets of 16×16,8×8,32×32,64×64.
You must adjust accordingly Snap Options – Step et Selected Tile – Subtile Size
![[Godot RPG]#5: Autotile - Godot Engine 33 game programming [Godot RPG]#5: Autotile - Godot Engine 31 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-15-08.png)
2 . Create Bitmasks
Next, click on Bitmask on the tool box selection.
Here will be the most important part of creating an Autotile. One error is a mile away.![[Godot RPG]#5: Autotile - Godot Engine 34 game programming [Godot RPG]#5: Autotile - Godot Engine 32 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-15-52.png)
Oh, remember to set the Autotile Bitmask mode to 3×3 and 2×2 is also fine if it suits your tileset.![[Godot RPG]#5: Autotile - Godot Engine 35 game programming [Godot RPG]#5: Autotile - Godot Engine 33 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-17-04.png)
And here I will proceed to fill in the Bitmask.
This was before:
![[Godot RPG]#5: Autotile - Godot Engine 36 game programming [Godot RPG]#5: Autotile - Godot Engine 34 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-16-51.png)
And then:
![[Godot RPG]#5: Autotile - Godot Engine 37 game programming [Godot RPG]#5: Autotile - Godot Engine 35 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-18-05.png)
Here, that color bitmask means: It is a navigation tool, or in other words for you to easily understand, it links this tile to another tile.
Give an example to illustrate Godot: here I have a tile and this tile when you put it down will display it first because it is not linked to anyone.
![[Godot RPG]#5: Autotile - Godot Engine 38 game programming [Godot RPG]#5: Autotile - Godot Engine 36 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-21-51.png)
![[Godot RPG]#5: Autotile - Godot Engine game programming 39 [Godot RPG]#5: Autotile - Godot Engine 37 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-23-25.png)
And here I will place another tile next to it and they are linked together via bitmask.
So now I’ll try removing the bitmask associated with the tile on the right?
![[Godot RPG]#5: Autotile - Godot Engine 40 game programming [Godot RPG]#5: Autotile - Godot Engine 38 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-23-01.png)
![[Godot RPG]#5: Autotile - Godot Engine 41 game programming [Godot RPG]#5: Autotile - Godot Engine game programming 39](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-24-23.png)
And below will be the result when you remove the bitmask linking the tile on the right.
Because it loses the link bitmask it cannot find the tile it needs to connect to and it will display the default icon.
Note: Many people, even though they draw the full bitmask, still get the problem like the one below, it’s because you drew it wrong or because the bitmask is wrong or because you drew too little or too much.
![[Godot RPG]#5: Autotile - Godot Engine 42 game programming [Godot RPG]#5: Autotile - Godot Engine 40 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-25-03.png)
And this is the result after I finished doing it.
![[Godot RPG]#5: Autotile - Godot Engine 43 game programming [Godot RPG]#5: Autotile - Godot Engine 41 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-32-41.png)
3 .Create Single Tile
Well, to have a grass tile, you should create a Single Tile that is a grass tile, don’t add an Autotile to it and then lift it up and you’re done.
![[Godot RPG]#5: Autotile - Godot Engine 44 game programming [Godot RPG]#5: Autotile - Godot Engine 42 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-32-19.png)
Well, if you have the same problem as the photo, it’s because I initially added the missing auto tile.-. I’m sorry, I’m sorry![[Godot RPG]#5: Autotile - Godot Engine 45 game programming [Godot RPG]#5: Autotile - Godot Engine 43 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-36-52.png)
Please add it
![[Godot RPG]#5: Autotile - Godot Engine 46 game programming [Godot RPG]#5: Autotile - Godot Engine 44 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-38-15.png)
Then it will return to normal
![[Godot RPG]#5: Autotile - Godot Engine 47 game programming [Godot RPG]#5: Autotile - Godot Engine 45 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-38-44.png)
To make sure with Autotile, in the toolbar you can select Icon and click on the Sand box to make sure.
.![[Godot RPG]#5: Autotile - Godot Engine 48 game programming [Godot RPG]#5: Autotile - Godot Engine 46 game programming](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-42-00.png)
Summary.
Ok so I have finished guiding the 5th lesson. Hopefully through this article you will gain new knowledge in designing Levels with Autotile for your game with Godot. Autotile is a function that is used a lot, so please remember it so you don’t forget it.
Frequently asked questions
What is Autotile in Godot and why should I use it?
Autotile is a feature in Godot Engine that helps you create game maps automatically, saving time and effort compared to placing each tile manually. It connects background tiles together based on the bitmask, creating seamless and natural edges.
How to edit Bitmask for Autotile effectively?
Bitmask editing requires high precision. Make sure you have selected the correct mode (e.g. 3×3 or 2×2) that matches the tileset size. Each tile in the Bitmask represents a direction (top, bottom, left, right), which needs to be colored correctly for the background tiles to connect properly. Small errors in the Bitmask can lead to unexpected results.
What should I do if my Autotile is not displaying properly?
Please check the tileset size, Bitmask mode, and especially the accuracy of the Bitmask. Make sure you have selected the correct “Subtile Size” and “Step” in the “Snap Option” section. If you still have problems, check to see if there are missing or excess tiles in Autotile.







