# Blob layouts and tilesets

(Warning: technical gamedev post)

I noticed the following tileset layout is quite popular in asset packs:

But at first glance I couldn’t work out how you could display ostensibly
2^{8}-1 different possibilities (since each tile can have eight neighbours)
with only 47 tiles.

And did this match up in any way to the “blob” tileset reference, where you reduce each tile to an 8-byte lookup value? Surely they must be related, as they’re both 47 tiles in a 7x7 tileset?

But I think I’ve worked it out. To go from 255 possibilities to 47, you ignore corners if there is no edge tile there. i.e.:

- if top = 0, then top-left = 0, and top-right = 0
- if left = 0, then top-left = 0, and bottom-left = 0
- if right = 0, then top-right = 0, and bottom-right = 0
- if bottom = 0, then bottom-left = 0, and bottom-right = 0

And then you can exhaustively map the remaining 47 tiles to the tileset format in asset packs:

Yet another gamedev mystery solved 🤞