AuthorTopic: Terrain/Tile blending strategy  (Read 4654 times)

Offline Sheph

  • 0001
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile

Terrain/Tile blending strategy

on: May 01, 2013, 03:26:32 am
Greetings, fellow Pixel Artists. I am a new budding artist trying to create some graphics for my own 2D game which I am writing. I have created a few seamless tiles so far after following some pixel art tutorials, only to realize that they look absolutely horrible when their square edges clash with tiles that aren't their type. Grass with water and no coastline, etc. After looking at some art around these parts, many of you seem to know how to blend tiles of different types together nicely. I'm assuming you do this in whatever program you're drawing for, and not just manually putting the tiles together.

This leads me to my question: What is a good tile blending strategy?

I have found a couple tutorials on the matter, and so far the best strategy seems to be to define the terrain at the vertices of the tile, and choose from among 15 blends for each terrain type. The 15 comes from there being 16 combinations for one terrain to have at any tile with 4 vertices, minus 1 for the 0 vertices. If no terrain exists at all in the tile, we can ignore it.

If I assume this, we draw the tiles as we would normally (with clashy square edges), and then create the blend image by combining the blends of each of the tile types to paint onto the half tile areas. Example:

Grass = G
Water = W
Dirt = D

G---G
|   |
W---D


A half-tile like this would have 2 full grass tiles painted at the top, each of which has 1/4th of the tile showing in the half-tile that will be painted over. Since there are 3 terrains present in this half-tile, we calculate and choose 3 different blends which we blit together and then finally blit it over the normal tiles at the half-tile location. That is like 4 extra images to draw onto the scene in order to achieve the blend, and this will be frequently done at all the blending locations on screen. This seems to be slightly inefficient, but I haven't actually tested the performance yet.

As pixel artists, if you are asked to do a tile set, what sort of parameters do your programmers give you? Do you draw 14 blends for each tile that you do for them? How do you know what blending tiles you need? What is the default assumption when drawing a scene that has lots of tile blending? It just seems odd that I haven't seen much discussion about this while everyone seems to know how. Am I missing something?

Anyway, thanks for your time. Cheers!

Offline Ymedron

  • 0010
  • *
  • Posts: 306
  • Karma: +0/-0
  • All draw and no paint!
    • View Profile
    • My Deviantart account

Re: Terrain/Tile blending strategy

Reply #1 on: May 01, 2013, 12:54:29 pm
Well, it depends on how many tiles you can have. :o
From what I've seen, usually it goes

Hand-made transitions.

You can't make an infinite number of transitions, naturally, so good map design probably comes from being able to avoid transitioning into a ton of different terrains at the same spot. :o
Tilesets often have a "square" of transitions from grass to road, so that you can have things like grass corners and whatnot.
A good strategy, in my opinion, would simply be... Well, trying to be as efficient as possible. Placing the "obvious transition" spot either in the 1/3 or the 2/3 spot might help make things like this narrow road:


Though I¨m not an expert. :C
Also my art tumblr: ymedronart.tumblr.com

Offline Krice

  • 0001
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile

Re: Terrain/Tile blending strategy

Reply #2 on: May 09, 2013, 08:51:20 am
If it's tile based game you can always get away with the fact that it's supposed to be like that. It's even possible that blending will confuse players who are bound in tile based strategy (in turn/tile based games). That's why it's better just show the underlying grid clearly.

One of the options is create in-between tiles. Like shallow water and/or sand between water and land.

I think with modern technology it could be viable to create smaller than tile objects like vegetation to draw around the edges of tiles as an extra layer not related to grid itself.

Offline Seiseki

  • 0011
  • **
  • Posts: 915
  • Karma: +1/-0
  • Starmancer
    • OminuxGames
    • http://pixeljoint.com/p/35207.htm
    • StarmancerGame
    • View Profile
    • Starmancer Patreon

Re: Terrain/Tile blending strategy

Reply #3 on: May 09, 2013, 03:31:57 pm
I think with modern technology it could be viable to create smaller than tile objects like vegetation to draw around the edges of tiles as an extra layer not related to grid itself.

If it's still pixel art I think regular tiles are still the easiest and most effective, you could have a tile with transparency but then you'd lose control over the blending.