# Hexagon coordinates?

**URL:** <https://discourse.mapeditor.org/t/hexagon-coordinates/1934>\
**Category:** Questions\
**Created:** [January 6, 2017, 3:12pm UTC](https://discourse.mapeditor.org/t/hexagon-coordinates/1934 "2017-01-06T15:12:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TJ\_Redleg](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/tj_redleg/32/817_2.png) [@TJ\_Redleg](https://discourse.mapeditor.org/u/TJ_Redleg)\
**Post date:** [January 6, 2017, 3:12pm UTC](https://discourse.mapeditor.org/t/hexagon-coordinates/1934/1 "2017-01-06T15:12:17Z")

</div>

What are some methods for implementing hexagon coordinates?

A lot of traditional hex-based wargames use a coordinate system to identify hex locations. It’s really quite simple, a two digit number is used to identify the row and column:

00,00  
00, 01

Row 0, col 0  
row 0, col 1

Something like that.

Is there a “best” method to do this in Tiled?

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [January 6, 2017, 8:01pm UTC](https://discourse.mapeditor.org/t/hexagon-coordinates/1934/2 "2017-01-06T20:01:41Z")

</div>

There’s [many ways to do it](http://www.redblobgames.com/grids/hexagons/#coordinates), but the following post outlines the currently supported system (the article I just linked calls this “offset coordinates”, in Tiled it’s called “staggered”):

> [@Support for Hexagonal maps added](http://discourse.mapeditor.org/t/support-for-hexagonal-maps-added/47):
>
> In the latest daily builds, support for hexagonal maps is available. This feature was sponsored by [CodePoKE](http://codepoke.net/) (GJ Roelofs), providing me with the incentive to support all 4 variations of the [offset coordinate system](http://www.redblobgames.com/grids/hexagons/#coordinates). 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:](http://opengameart.org/content/pixel-hex-tilesets-enhanced:) [image] The configurations Tiled supports are as follows: S…

---

<div class="post-metadata">

**Author:** ![Galdred](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/galdred/32/2769_2.png) [@Galdred](https://discourse.mapeditor.org/u/Galdred)\
**Post date:** [March 22, 2017, 10:13am UTC](https://discourse.mapeditor.org/t/hexagon-coordinates/1934/3 "2017-03-22T10:13:04Z")

</div>

If you want to use the axial coordinate system, just set the grid to isometric, and paint hexagons on it.  
It is what I did with my game.  
The only problem currently is that Tiled automap and terrain features don’t consider hexagons to be adjacent when they should:

![](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/e/eb9adb437a2e4d7da9b1553d2082848c033a063e.png)

Actually, I think considering only the horizontal(if you hex are point up/down) OR the vertical (if your hex are point left/right) hexes adjacent would be the only missing feature to make the grid work “natively” for hexagonal hex (and replacing the tile shape with an hexagon).  
That is mostly a problem when using automaps for me (as I don’t use the terrain tool at all).

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [March 22, 2017, 8:50pm UTC](https://discourse.mapeditor.org/t/hexagon-coordinates/1934/4 "2017-03-22T20:50:23Z")

</div>

> [@Galdred](#):
>
> If you want to use the axial coordinate system, just set the grid to isometric, and paing hexagons on it.It is what I did with my game.

Thanks for suggesting this! Indeed the Isometric projection can be used to do hexagonal maps as well, and it’s something I’d like to support officially at some point (so that it can have a hex grid and mouse picking, for example). I’ve created the following issue about this now:

> <https://github.com/mapeditor/tiled/issues/1508>
>
> Currently Tiled supports Hexagonal maps with offset coordinates. There are \[othe…r possible coordinate systems\](http://www.redblobgames.com/grids/hexagons/#coordinates), and one of them is Axial coordinates. This can actually be used already in Tiled using the Isometric projection, as \[illustrated by Galdred on the forum\](http://discourse.mapeditor.org/t/hexagon-coordinates/1934/3):
> 
> !\[eb9adb437a2e4d7da9b1553d2082848c033a063e\](https://cloud.githubusercontent.com/assets/531764/24219691/fc349158-0f47-11e7-9268-d1a907cdfc20.png)
> 
> This issue is about adding a new "Hexagonal (Isometric)" or "Hexagonal (Axial)" (not sure about the best name) projection that derives from the \`IsometricRenderer\` and performs things like grid rendering and mouse picking correctly for hexagonal tiles.
> 
> Hopefully we can re-use the existing hexagonal map related properties, though their names would be a bit confusing (whether the hexagons are flat topped or pointy topped depends on the "stagger axis" property, and there is no staggering axis when using axial coordinates). The property could be renamed to "Hexagon Orientation" with values being either Horizontal / Vertical or Flat Topped / Pointy Topped.
