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
Then choose your existing Tileset as Forest
And then you proceed to choose New Autotile for yourself.
Remember to turn on the Grid to get the grid shape
Then highlight the area to be selected. And note who is using my tileset, please choose like me.
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
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.
Well, remember to change the Autotile Bitmask mode to 3×3 and 2×2 if it suits your tileset.
And here I will proceed to enter Bitmask.
This is before:
And after that:
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
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?
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.
And this is the result after I have done it.
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.
Well, if you have the same problem as the picture, it’s because I added the auto tile missing at first.-. Sorry guys
Please add it
Then it will be back to normal
To add a certainty with Autotile, in the toolbar you can select Icon and click on the Sandbox to be sure.
.
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.