I am making a 2D sandbox/tile based game (like terraria/starbound), and I am restarting my tile system. I know how to create a world/chunks/tiles for the game using a single mesh per chunk. The mesh contains squares to represent each tile as you could imagine, and I map the UVs for the mesh from a single texture.
But I want to be able to make many different variations for each tile (such as dirt, stone, etc.), and these tiles would consist of fulls blocks, straight-half blocks (4 sides), and diagonal-half blocks (4 sides). And each of these 9 options would have 4+ slight variations to make the game feel more random. So that is 36 versions of a roughly 18x18pixel texture for each tile type.
The method I am using now maps the tile from a SINGLE tile sheet that is the gameobject’s material, that would contain all of the tile types, but as I added more tiles the single texture would get bigger and bigger to fit so many variations.
How can I map textures from different PNG files onto my mesh? Sorry if this is confusing, maybe there is a better method or maybe it is complicated. Any ideas would be appreciated.
Here are examples of Starbound’s and Terraria’s sprite sheet for a single tile.