In the latest daily builds, support for hexagonal maps is available. This feature was sponsored by CodePoKE (GJ Roelofs), providing me with the incentive to support all 4 variations of the offset coordinate system. In Tiled this map type is called “Hexagonal (Staggered)”, and the rendering code is now also used for the similar “Isometric (Staggered)” maps.
Example based on http://opengameart.org/content/pixel-hex-tilesets-enhanced:
The configurations Tiled supports are as follows:
Stagger Y axis at odd rows (default):
Stagger Y axis at even rows:
Stagger X axis at odd columns:
When staggering the X axis, Tiled makes sure that the tiles are still drawn top-to-bottom for correctly overlapping tile graphics in most situations. So in the above sample, the drawing order is (0,0), (2,0), (4,0), (1,0), (3,0), etc.
Stagger X axis at even columns:
By default, a new staggered hexagonal map has a staggered Y-axis, with every odd row being shifted to the right. This matches the behavior of the staggered isometric maps, but it is not the same as what the old Java version of Tiled supported. Hence, when loading a hexagonal map that was made with Tiled Java some map properties will need to be changed for it to render correctly.
The main difference compared to staggered isometric maps is the straight vertical or horizontal side. The length of this side needs to be specified (in pixels) for Tiled to be able to align the tiles perfectly. Getting the values of tile width, tile height and side length exactly right for a given tileset usually takes some experimenting. Fortunately these properties can be changed in the Properties view:
In the TMX Map Format the following new attributes have been placed on the <map
> element:
-
hexsidelength
- Length of side of the tiles in pixels -
staggeraxis
- The staggered axis, eitherx
ory
. -
staggerindex
- The indexes to stagger, eitherodd
oreven
.
At the moment I consider these additions still subject to change, but they won’t change anymore once Tiled 0.11 is released.
Now install a daily build of Tiled and take it for a spin! I’m looking forward to your feedback as well as to see the beautiful hexagonal maps you’ll make for your next game.