
Implementation of Hex Grids - qzervaas
http://www.redblobgames.com/grids/hexagons/implementation.html
======
iffz
Don't skip the absolute awesome "main page" where everything is extensively
explained with interactive javascript samples.

[http://www.redblobgames.com/grids/hexagons/](http://www.redblobgames.com/grids/hexagons/)

~~~
choppaface
Yes, this page is a must.

Also, this problem has some relevance outside of games:
[http://vincentwoo.com/2013/03/08/above-and-beyond-the-
affirm...](http://vincentwoo.com/2013/03/08/above-and-beyond-the-affirm-job-
puzzle/)

------
qzervaas
I built my first iOS game[1] last year using Amit's original hexagon guide.
This new guide would have been useful too. Still makes for good reading now.

[1] [http://hexiledgame.com](http://hexiledgame.com)

~~~
leviathan
nice game. An annoying bug though, most of the times when the game is
interrupted (by receiving a phonecall, or simply clicking the home button then
opening again) nothing is clickable anymore and you have to kill it and re-run
in order to get it to work again.

~~~
qzervaas
Thanks. That issue only started with iOS 8.3, still trying to track down the
cause. Very frustrating, since the app hasn't been updated since before 8.3.

------
leni536
As a solid state physicist for me the axial coordinates are tho most
straightforward. I'm tempted to do design a game level on the hyperbolic
plane, there are more exotic tilings there [1]. Designing textures for it
would be quite a challenge. I think there are some simple graphics puzzle
games already on the hyperbolic plane.

[1]
[https://en.wikipedia.org/wiki/Octagonal_tiling](https://en.wikipedia.org/wiki/Octagonal_tiling)

~~~
david-given
Have you seen HyperRogue?
[http://www.roguetemple.com/z/hyper/](http://www.roguetemple.com/z/hyper/)

~~~
leni536
Yeah, played that and really liked the concept. I didn't really like the
gameplay itself though. I wonder how a Heroes III bottle would look like on
the hyperbolic plane.

------
z3t4
Writing a hex libary has been on my todo-list for a while. Just writing the
code, while useful for experts, is not enough though, you need documentation
and examples. Making people understand how hex'es work is a noble task, but
most ppl just want to be productive and create their dream game, without
having to speed years in school first.

------
peter303
Engineers have been doing this since the 1950s with a data structure called
the Finite Element Mesh, ar arbitrary shaped computation grid.

------
edem
I've started implementing a Hexagon Grid based on this source of informaion if
you are interested:

[https://github.com/adam-arold/hexameter](https://github.com/adam-
arold/hexameter)

I've also used axial coordinates. Most of the features are working but some
advanced ones are not yet complete.

------
tricolon
Previous discussion on the article on hex grid theory:

[https://news.ycombinator.com/item?id=8941588](https://news.ycombinator.com/item?id=8941588)

[https://news.ycombinator.com/item?id=5809724](https://news.ycombinator.com/item?id=5809724)

------
hopeless
I've been thinking about how to model hex-grids in the context of building a
online version/solver for Tantrix
[http://www.tantrix.com/](http://www.tantrix.com/)

------
dfar1
Wow, this blog is a great resource. Thank you.

