Hello folks! This week I was working on “Road with a River and Trees” generator. But before that Erhan and I wanted to make it more spicy and colorful at the start. We wanted to add different tile types and make it in such a way that you wouldn’t need to change the theme and use it with colors already.
So, for this purpose, first I need an excel sheet. Tileset system works on .csv files that hold IDs, names, and tags for the tiles. According to this information, the tile system generates a class that holds them as new tile objects.
The new tile I wanted to add was Forest. It will be used for creating random trees on the map.
When the .csv file is imported, the new tile will be seen like this on Inspector:
Now the new tile file is present in Tile Definitions and Tag Definitions on TileSetsDatabase scriptable object. This SO holds the tile variables, and they are accessible in code as well. All I need is to call a tile, I write like this:
But it’s not finished yet. Now I need to create an atlas for this tile. To do this, there’s a built-in atlas creator in ProDnD.
On this atlas creator, I need to select Forest in the list and choose the Forest tile textures from the Project folder. And when I did this I was able to create the result that I wanted:
As you can see, there are tiny little cutie green trees in the map. I hope I will be finishing this generator by next week.
Stay in tune!