Hello everyone, you have come to part 5 in the game programming series with Godot. And in this tutorial I will guide you to create tilemap using a more advanced function that is Auto tile. Before that, I also had a tutorial on using Autotile, but at that time, my knowledge was very weak, so it was wrong and now I will guide you in a more specific and detailed way.
| Join the channel Telegram of the AnonyViet 👉 Link 👈 |
In this article, I will help you create this Autotile and Autotile for those of you who don’t know, it can help you Design your Level automatically instead of doing it manually in lesson 4. It is also very easy and not difficult at all.
Create Autotile
first . Create Autotile
First, go to Tileset in the Inspector Tab of Node Tilemap
![[Godot RPG]#5: Autotile - Game programming Godot Engine 27 [Godot RPG]#5: Autotile - Game Programming Godot Engine 25](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-09-36.png)
Then choose your existing Tileset as Forest
![[Godot RPG]#5: Autotile - Game Programming Godot Engine 28 [Godot RPG]#5: Autotile - Game programming Godot Engine 26](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 - Game programming Godot Engine 29 [Godot RPG]#5: Autotile - Game programming Godot Engine 27](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-11-20.png)
Remember to turn on the Grid to get the grid shape
![[Godot RPG]#5: Autotile - Game programming Godot Engine 30 [Godot RPG]#5: Autotile - Game Programming Godot Engine 28](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-11-55.png)
Then highlight the area to be selected. And note who is using my tileset, please choose like me.
![[Godot RPG]#5: Autotile - Game programming Godot Engine 31 [Godot RPG]#5: Autotile - Game programming Godot Engine 29](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-13-02.png)
For other tilesets you will have to base on its size there will be tileset of 16×16.8×8.32×32.64×64
You have to adjust accordingly Snap Options – Step and Selected Tile – Subtile Size
![[Godot RPG]#5: Autotile - Game Programming Godot Engine 33 [Godot RPG]#5: Autotile - Game programming Godot Engine 31](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-15-08.png)
2 . Create Bitmask
Next, click on Bitmask on the toolbox selection.
Here will be the most important part of creating Autotile wrong one mile is going a mile.![[Godot RPG]#5: Autotile - Game programming Godot Engine 34 [Godot RPG]#5: Autotile - Game programming Godot Engine 32](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-15-52.png)
Well, remember to change the Autotile Bitmask mode to 3×3 and 2×2 if it suits your tileset.![[Godot RPG]#5: Autotile - Game programming Godot Engine 35 [Godot RPG]#5: Autotile - Game Programming Godot Engine 33](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-17-04.png)
And here I will proceed to enter Bitmask.
This is before:
![[Godot RPG]#5: Autotile - Game programming Godot Engine 36 [Godot RPG]#5: Autotile - Game programming Godot Engine 34](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-16-51.png)
And after that:
![[Godot RPG]#5: Autotile - Game programming Godot Engine 37 [Godot RPG]#5: Autotile - Game programming Godot Engine 35](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-18-05.png)
Here, that color bitmask means: Is a navigation tool or in other words for you to understand, it is easy to link this tile with another tile.
For an example to illustrate Godot: here I have a tile and this tile when you put it down will show it first because it is not linked to anyone
![[Godot RPG]#5: Autotile - Game programming Godot Engine 38 [Godot RPG]#5: Autotile - Game programming Godot Engine 36](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-21-51.png)
![[Godot RPG]#5: Autotile - Game Programming Godot Engine 39 [Godot RPG]#5: Autotile - Game programming Godot Engine 37](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-23-25.png)
And here I will put another tile next to it and they are linked together through bitmask.
So now what if I try to remove the bitmask associated with the right tile?
![[Godot RPG]#5: Autotile - Game programming Godot Engine 40 [Godot RPG]#5: Autotile - Game programming Godot Engine 38](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-23-01.png)
![[Godot RPG]#5: Autotile - Game programming Godot Engine 41 [Godot RPG]#5: Autotile - Game Programming Godot Engine 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 associated with the right tile.
Since it loses its associated bitmask it cannot find the tile to connect to and it will display the default icon.
Note: Many of you, despite drawing a full bitmask, but still get the same problem as below, it’s because you drew it wrong or because the bitmask was wrong or you drew too little or too much.
![[Godot RPG]#5: Autotile - Game programming Godot Engine 42 [Godot RPG]#5: Autotile - Game programming Godot Engine 40](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-25-03.png)
And this is the result after I have done it.
![[Godot RPG]#5: Autotile [Godot RPG]#5: Autotile](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, please create a Single Tile that is a grass Tile, but don’t add the Autotile to it and it’s done.
![[Godot RPG]#5: Autotile - Game programming Godot Engine 44 [Godot RPG]#5: Autotile - Game programming Godot Engine 42](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-32-19.png)
Well, if you have the same problem as the picture, it’s because I added the auto tile missing at first.-. Sorry guys![[Godot RPG]#5: Autotile - Game programming Godot Engine 45 [Godot RPG]#5: Autotile - Game Programming Godot Engine 43](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-36-52.png)
Please add it
![[Godot RPG]#5: Autotile - Game programming Godot Engine 46 [Godot RPG]#5: Autotile - Game Programming Godot Engine 44](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-38-15.png)
Then it will be back to normal
![[Godot RPG]#5: Autotile - Game Programming Godot Engine 47 [Godot RPG]#5: Autotile - Game programming Godot Engine 45](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-38-44.png)
To add a certainty with Autotile, in the toolbar you can select Icon and click on the Sandbox to be sure.
.![[Godot RPG]#5: Autotile - Game programming Godot Engine 48 [Godot RPG]#5: Autotile - Game programming Godot Engine 46](https://anonyviet.com/wp-content/uploads/2021/04/05-04-2021-12-42-00.png)
Summary.
Ok, so I’ve finished the 5th tutorial. Hopefully through this article you will draw a new knowledge in Level design with Autotile for your game with Godot. Autotile is a function that is used a lot, so please remember it before you forget it.







