iDevGames Forums
Hex based games - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Design (/forum-5.html)
+--- Thread: Hex based games (/thread-1503.html)



Hex based games - GregX999 - Apr 4, 2009 07:37 AM

Hey all,

I'm wanting to try to make a hex-based, turn based strategy game and I'm having a tough time trying to figure out how to design the "hex architecture" (for lack of a better term).

Does anyone know of any resources that discuss basic things like the best way to "orient" a hex-based coordinate system? Also slightly more advanced things such as movement & pathfinding on a hex-grid (where each hex has a different "movement cost") and finding LOS from one hex to another (assuming some hexes block LOS of course)?

Thanks,
Greg


Hex based games - maximile - Apr 4, 2009 02:48 PM

There's a bunch of links on this page: http://www-cs-students.stanford.edu/~amitp/gameprog.html#hex


Hex based games - Ingemar - Apr 6, 2009 09:17 PM

I have made a bunch of hexagonal games myself. Great fun, games change a lot with this simple change.

There are a few ways to handle it. Either you displace every other row or column by half a step, or you tilt the whole grid. Two of the eight directions are removed from the set of neighbors. Much follows naturally from there.


Hex based games - GregX999 - Apr 7, 2009 09:04 AM

Ingemar Wrote:I have made a bunch of hexagonal games myself. Great fun, games change a lot with this simple change.

There are a few ways to handle it. Either you displace every other row or column by half a step, or you tilt the whole grid. Two of the eight directions are removed from the set of neighbors. Much follows naturally from there.

Which coordinate system do you prefer, alternate row displacement or grid tilting? I read a few of those articles on site that maximile provided - it seems the alternate row displacement system would much easier to relate to while programming as well as not needing to deal with every row (or column) being a different height.

Also, have you done anything with calculating LOS?

Greg


Hex based games - Ingemar - Apr 8, 2009 05:47 AM

I generally prefer row displacement, but it depends on the need. I would use grid tilting when LOS is important. Well, that too depends on what kind of LOS. Just following the rows is not an issue, but a non-gridbased LOS is easier in a tilted space, I'd say.


Hex based games - Nosredna - Apr 25, 2009 11:48 AM

I've done hex algorithms twice. Once in C for CyberStorm (http://en.wikipedia.org/wiki/Missionforce_Cyberstorm) and once in assembly language for an arcade-action puzzle game (written in Assembly for Amiga and PC).

I recommend you try a couple different layouts and try working with them.

You can print out hexagonal charts and try various numbering schemes and orientations.

http://www.printfreegraphpaper.com/