Bitmasking with multiple tiles

Just took a look at this really great article post from angryfishstudios: http://www.angryfishstudios.com/2011/04/adventures-in-bitmasking/

My question is, what is the best away to achieve this effect if I had more than 2 types of tiles that all needed to connect into eachother. Would I have to draw out every single possible combination of tiles?

Thanks!

I would recommend to create one sprite sheet for each type (bit-values of 1-48) with a transparent background. Then define a fixed order for the types (sand < stone < gras). Contrary to the tutorial you then calculate bit-values for all terrain types, because all types are “solid”. While calculating consider all neighbor tiles of the same type and of an higher order as “solid”. Finally render all the tiles from lowest to highest order. I think there is still some thinking to do how you handle type borders, but this should be trivial.