This tutorial explains how to go from basic and blocky to smooth and seamless by using Marching Squares to automatically stitch together tiles.
Starting from the simplest 1:1 tiling system we cook up a few automatic placement strategies and boil down the bits to extract the very essence of the marching squares algorithm.
I've created a simple HTML5 tile placement demo using the algorithm as described, so you can see the
Marching Squares in action and peek under the hood at the metadata itself.
This tutorial is targeted at entry level game devs. As such it covers info that many skilled folks are already familiar with, but even experts might pick up a trick or two. For instance: Did you know it's possible to implement marching squares without a single conditional ('if / then') statement or lookup table? Ever thought about using the 'saddle point' solution beyond its problem space to add a bit of variety to
all of the tiles?
Being born from
TIGS' own Placeholder Graphics thread, the tileset template is free to use in your own implementations.
If algorithms were tools,
Marching Squares would be a Swiss Army Knife. Swedish soldiers shouldn't have
all the fun...