Tileset Roundup

Sun, 07/14/2013 - 19:34 — Boris

Following my development of Resynth Tileset, I've been doing some thinking on the nature of tilesets, and the possible ways to auto tile them - that is, to paint tiles as is with a brush and letting the computer do the tile selection. Let's review a few possible ways of doing so.

Just to be clear, I'm only interested at the moment in square, non-rotatable tiles. Rotation is another discussion, but excludes the more interesting tilesets. Adding alternative tiles is also not considered, though it is pretty easy to add in.

Marching squares

The most popular layout generally used is what I'd call Marching Squares, though it is often unnamed as it is so ubiquitous:

Marching Squares requires you to mark each corner as solid or empty. You sometimes see a variant where it is descrbed as marking the center of the tile instead, but that's inaccurate - you've just offset the grid by half a tile in each direction instead.

Artists love Marching Squares because it only requires drawing 16 tiles, and programmers love it as it is very simple to choose the correct tile using a lookup table and the simple formula for the right tile:

tile_index = topLeft + 2 * topRight + 4 * bottomLeft + 8 * bottomRight

where each variable is 0 or 1 according to if that corner is solid or not.

This is a trick of binary counting that is explained well elsewhere.

This tileset is used by both Tiled and tIDE for auto tiling.

Special mention goes to some sets that either substitute or add an additional two "diagonal" tiles which are empty at the center rather than solid:

(note: "marching squares" also refers to a procedure for computing outlines of shapes, which is totally unrelated. I think my usage is the more common one nowadays)

The Blob

For all it's benefits, Marching Squares proves to have two shortcomings. Firstly, you have to mark the corners as solid/empty, not the tiles themselves. This often feels a bit unnatural when trying to lay things out, as you only feel rather indirect influence on any given tile. Secondly, the fact there are only sixteen tiles starts to become visible to the eye rather easily. There's only so many shapes you can make.

Hence the blob:

The blob, coined in this article, uses 48 tiles - 47 solid and 1 empty. It covers all possible borders a solid tile could have with other tiles of its own kind or of distinct tiles.

As code, it's somewhat less pretty:

if not left or not top:     topLeft = False
if not left or not bottom:  bottomLeft = False
if not right or not top:    topRight = False
if not right or not bottom: bottomRight = False
neighbour_index = (
    topLeft + 2*top + 4*topRight +  
    8*left + 16*right + 
    32*bottomLeft + 64*bottom + 128*bottomRight)

pick_tile = {0: 0, 2: 1, 8: 2, 10: 3, 11: 4, 16: 5, 18: 6,
    22: 7, 24: 8, 26: 9, 27: 10, 30: 11, 31: 12, 64: 13,
    66: 14, 72: 15, 74: 16, 75: 17, 80: 18, 82: 19, 86: 20, 
    88: 21, 90: 22, 91: 23, 94: 24, 95: 25, 104: 26, 106: 27, 
   107: 28, 120: 29, 122: 30, 123: 31, 126: 32, 127: 33, 
   208: 34, 210: 35, 214: 36, 216: 37, 218: 38, 219: 39,
   222: 40, 223: 41, 248: 42, 250: 43, 251: 44, 254: 45, 255: 46} 
tile_index = pick_tile[neighbour_index]

To explain this, we start with 8 variables which indicate whether the eight surrounding tiles are solid or not. The corner tiles are only relevant if both edge tiles are solid, so I mark them as empty in any other case. Then, like with Marching squares, we sum up the borders in binary to get a unique index for each combination. The total value is between 0 and 255.

However, there's only 47 possible values, all the others are identical to one of these except for the irrelevant corners. So I renumber everything to go from 0 to 46, for convenience. Obviously, you only apply this algorithm to the solid tiles, you can just use the single remaining tile for all empty squares.

An alternative algorithm just uses a lookup table of size 256, which is simpler, but longer. You can see the table here.


After playing around with the blob pattern for a while, you start to notice that despite using 48 tiles, the variation isn't really that good unless you really work for it when making the tiles. You can see the problem here - all these tiles have a similar top left, even though the rest of the tile is different.

It turns out, if you consider just one quarter quadrant of each tile, there aren't many possibilities. It can either be an inner or outer curve, a horizontal or vertical divide, or solid:

That means if we make 5 subtiles for each quadrant, we can get a tileset that can fill in for the blob with only 20 subtiles (plus the empty tile, unchanged), as long as we are willing to do some assembly. Here's the tile set, I've colored each subtile with a border indicating which quadrant it belongs to.

Each blob tile can be made out of the right choice of 4 subtiles, one from each quadrant, for example.

In code you might write:

top_left_quadrant_tile_index = left + 2* top
if left and top and topLeft: top_left_quadrant_tile_index = 4
top_right_quadrant_tile_index = right + 2* top
if right and top and topRight: top_right_quadrant_tile_index = 4
bottom_left_quadrant_tile_index = left + 2* bottom
if left and bottom and bottomLeft: bottom_left_quadrant_tile_index = 4
bottom_right_quadrant_tile_index = right + 2* bottom
if right and bottom and bottomRight: bottom_right_quadrant_tile_index = 4

This tileset is used by the RPG Maker VX community, where it is called TileA2 ground autotile. I'm calling it the sub-blob pattern, which is catchier.

There's also a tool which converts from sub-blob to blob pattern, though it doesn't use the same tilesheet layout I have.

(note: for compatibility with RPG Maker, I've omited the empty tile from the tileset, but properly speaking it is still necessary. You'll need to strip out the grey borders before it matches RPG Maker)


You may have noticed I've cheated when creating my sub-blob example. Unlike a higher quality tileset, I've re-used some subtiles in several subquadrants. Sometimes it's nice to have the flexibility of specifying these independently, it's often necessary to make patterns line up. But other times you don't need it, and can throw away the duplicates. This leaves just 13 subtiles (plus the empty tile), which is even better than marching squares!

As far as I know, no one is really using this tileset at the moment. I'm calling it the micro-blob.


So there you have a few different ways to neatly tile automatically. There's really lots more to say - we haven't covered handling mixing more than two different textures, or some of the more esoteric layouts like this monster, but I think you've got a good selection above.

Which one you select really depends on what you are trying to achieve, and how many tiles you are willing to create. The more tiles, the more flexibility you'll have to design something that looks organic.


All tileset images are generated from this image, using Resynth Tileset and some manual image manipulations. Feel free to use these tilesets under CC By 3.0. They all have tile size 64, and 10 pixel padding/border, except the subtiles, that use half that.

Medicine Online

This is an amazing blog I have ever read. I love the mid portion of this blog. I will visit this again
Buy Xanax 2mg Online

Mp3 Skull, Songs PK, Mp3 Songs free Download

All kind of Mp3 free download search hub to search all kind of mp3 skull
& songspk songs. here you can also Sign in to your account, upload your own song and create your album.


Although the comment above is spam, all of the info here explained is very useful! Neurologos en Monterrey


I found it very useful too! I'm going to follow your work from now on. Dr. Rafael Moreno - Otorrino en Monterrey


Thank you very much for all this information! Eyeklinik

I concur!

Yes, thanks for all this info! Greetings! Dr. Kuri Cardiologo

Go to the library, web, read

Go to the library, web, read a few books, look over your notes. Focus on the particular inquiry within reach and read data relating to it. custom essay

Not very useful comment

I found this very comment not particularly useful. The tileset round up is quite great. Please, keep posting stuff like this. Balon gastrico Monterrey

Great roundup

I like these kinds of roundups, specially when are well ilustrated with images. Can you please share more? Agencias de publicidad en Monterrey


Yes indeed, this kind of articles are the best around. Thanks for the info! Urologos Monterrey

Awesome roundup

This site looks pretty old, but as you said, this kinds of roundups are awesome. Dermatologos en Monterrey

Awesome post!

Thank you very much for this awesome information! Neumologo Pediatra

You don't need to spend a

You don't need to spend a huge selection of dollars to appear and feel better. Improving the image could possibly require tiny effort, moment, and funds. dressydresses.net

General responsibility insurance is a form of insurance which is used by companies when some sort of loss takes place. General

Eat Healthful, Stay Healthful - it is a common saying and it's also very unlikely when you have not observed it within your lifetime. Each one of us desires to stay healthful. healthyingredients.net

you also can make a table and

you also can make a table and then a list for that diseño web en monterrey web design austin tx


passbook is the great services website. This company provide services in all over the world in cheap rates. It is my one of the best services website.

great work

I agree, some really interesting art work, particularly liked the code, as it made it easier for me to emulate. As a computer consultant who helps people tackle DNS errors for example, I really loved the illustrations. Great work.


I was looking for some

I was looking for some tileset tutorials as I always have trouble in completing this. I am glad to find that you shared you knowledge about Tileset and I will refer to you last post as well, thanks for adding it here. speech writers


The designs that you have created looks to be unique and really good. This is possibly the best way to develop some new patterns and designs and to bring them up into the global market. Good work,.


The main active preparation

The main active preparation over the fix to connect for the clean max rotation to make the dimension with solid experiments on the floor. Easy worthy client matches will convey big sources to run on the top max points. how to win online voting contest

The content management system

The content management system provides big new challenges over smooth conversions on the perfect way connect to make the new ideas working with master clean work points. And change the new volume with high worthy planner. natural eye floaters treatment

What a wonderful post. I'd

What a wonderful post. I'd like to say that you've shared a valuable information in which people would get interest to try it out. I also want to try make these things because all were given here from steps to the final output.Thank you then for imparting us your knowledge. buy soundcloud plays at http://socialformula.com/ Thanks :)

Interesting results with

Interesting results with those tiles well done
.v for 0nlineCasin0s class topopzioni

{Why You should to Compare Boilers}

A condensing gas boiler lessens the total amount of energy lost through the flue and could be over 90% efficient resulting in better efficiency and less cash squandered.

Very smooth. Your content and

Very smooth. Your content and the way I read. It totally freshen me up.

A system driven by marketing

A system driven by marketing is one that puts the customer needs first, and only produces goods that are known to sell. Market research is carried out, which establishes what is needed.
medium.com web hosting prices
www.amazon.com argan oil for skin
bitly.com vitamin c serum for face
medium.com best phoenix seo
medium.com san francisco seo company

Great Post, that you for

Great Post, that you for sharing.
Adams Jacob


Education is something that many have said much about. Most of these are complex or vague. Consider Aristotle's description ('an ornament in prosperity' and 'a refuge in adversity') or Joseph Addison's ('What sculpture is to a block of marble, education is to a human soul'). fsaaeducation.net

As with many school systems across the United States, Arizona Schools have several measurement and accountability programs in place to improve student scholastic achievement. keystone-school.net

One of the most asked questions by migrants is "How do I choose a school for my children? ". This article looks at some of the things you can do to help make that task a little easier. The article offers advice and websites for you to carry out your own research. punditschool.net

In trying to decide what type of college will best meet your wants and needs there are many things to consider. Listed below are some of the factors you will need to consider in deciding where you want to go to college. choicecollegeconsulting.net

Beauty is the source of your personal magic; it is the essence of who you are, it connects you to others and to the plenty of this planet. thebeautybox.net

We have separated children's sun protection into two categories. 1. Babies and Sun Protection and 2. Kids and Sun Protection.... I guess there should be a third category for teenagers but as they say, "Cats have nine lives. sunvalleyautocare.net

An Enterprise Service Bus (ESB) is a flexible connectivity infrastructure for integrating applications and services. The Enterprise Service Bus(ESB) can help you achieve the goal of SOA. icounselingservices.net

Whether you are looking for a service provider in household energy, telecommunication, banking and finance, insurance, travel, technology or even shopping, you deserve nothing but the very best as a customer. intoservices.net

Do you ever worry that your business will fail? It's hard to contemplate failure, especially when you're working so hard and want so much to be successful. suisunbusinessnews.net

Some babies are naturally prone to be smart by genetics, while others are less apt to get the 'genius gene'. However, as parents it is our duty to harness the full potential of our children from birth. Here's 20 ways to encourage early learning development for your baby... babycase.net

Auto (car) insurance is a type of insurance coverage for damage to and resulting from an auto. Insurance of this type can cover a variety of things depending on the kind of auto insurance that has been purchased. autohavenonline.net

The end result is much lower repair bills with a great friendly service. This is the insiders' step by step approach on how best to find the right local auto repairs. suppliesauto.net

This is the easiest way of finding the best local garage to use for any auto repairs. The end result is the car is serviced or repaired the way you want it to be done and at prices agreed. roadrunnerautomart.net

A sound tech's primary duty is to assist the sound engineer and he has only one major responsibility, which is to be attentive. Here are some specific instructions to become a better sound tech. brightontech.net

Sports Betting Champ, John Morrison is most well known for his 97% win rate MLB/NBA sports betting system. But, the Sports Betting Champ has also brought us other valuable products... safeguardsports.net


You are a sports fan and your life revolves around your favorite teams and athletes. Decorating a room to show off your team spirit and loyalty is a must. fan-sport.net

Looking for the best Christmas gift ideas for the sports fan as the holiday season approaches is a common experience. vikingmotorsports.net

Greater Swiss Mountain Dog Training is not that complicated as it sounds. Though it is true that it requires skills and education to teach Swiss Mountain dogs and make them learn, but once you have been trained to train these dogs, things will become much easier. mountaindogmission.net

Although the information of its beginning is vague, the origin and historical background of Greater Swiss Mountain dog dates back to first century B. C. There are three stories that are usually told about these dogs' origin. topdogpetgrooming.net

Just as people sometimes dread getting old, they also dread their pets getting old. Dogs and cats are living longer than ever and pet owners attribute some of the chronic problems they develop to just getting old. doc4pets.net

Before purchasing pet insurance for their pets, there are many factors that pet owners should consider. pethealingenergy.net

Failure to do adequate research and fully understand what they are purchasing is the main reason that pet owners have claims denied and/or end up being disappointed with pet insurance. mypetfolies.net

Perfect homes are those where you can feel relaxed, calm and comfy. A home of dreams is not easy to achieve. You have to bring your thoughts, ideas and dreams into reality. countryhomerealestate.net

In today's tough real estate market, the Internet is playing a huge role in the buying and selling of real estate and is an almost limitless source of real estate information. pnsrealestate.net

Finding the right doctor for you and your family is an art in itself. Many people are not sure about how to look for a doctor. Conventionally, doctors are found by word of mouth. thefamilylawdoctor.net

The energy sector in Indonesia has struggled to keep up with the rapid pace of economic growth. Chronic under investment in systems improvements and new generation capacity, coupled with highly subsidized fuel and electricity rates, has left Indonesia in a dire situation. energylawjournal.net

Most people hate laws since laws always restrict the freedom of human beings. In reality laws are like human beings who can be your friend, enemy, guide and servant. Read this article to know the fundamentals of law. olivelawfirm.net

When you imagine a lawyer what do you see? More than likely you conjure up an idea of a powerful looking man or woman in a dark colored suit with a serious expression. lawyercards.net

Vanity Laws - the fad of creating laws to honor the memory of someone who has met a tragic end is ushering in a tragic end to democracy. It's time this nonsense was stopped. charlescolmanlaw.net

All civilized societies pay lot of emphasis on the rule of law. The developed countries are quite proud of their strict enforcement of law while the poor nations are often ashamed that they can't make their society law compliant. markrenkenlaw.net