I have a tileset as seen on the right and they make the images seen on the left: Tileset

In game I have placed the full grass and full stone tiles for each chunk (infinitely generated) using perlin noise as seen in the image below:

I am trying to find a way to determine what corner tiles to use and then place them. As you can see there is so many possibilities that I don't know how to do it. Using Lua with love2d engine by the way.

This question is different. Everything I read about bitmasking with corners says that you need at least 48 tiles or more in a set to do corners. I am wondering how and if it is possible to use the tile set at the right which doesn't need this many tiles to make any possible shape. It only uses 14 original plus 2 existing tiles. Here is a image of what tiles are used in bitmasking. bitmasking tiles


Browse other questions tagged or ask your own question.