Game Development Community

Game board with hexagons, will my solution work?

by Martin Askestad · in iTorque 2D · 03/01/2011 (1:02 pm) · 1 replies

Moshi moshi!
The project that I'm working is a ipad version of a board game. The board game had hexagon tiles on it's board, so I decided to try to implement it. After browsing the forums it seemed like this wasn't the most trivial thing in the world. Plenty of people has asked for a solution for several years.

What I've done is to write a small script that figures out where the center of the hex-tile would have been. And places a little marker there. Right now it's a picture of a bush. But it will probably be something else when I'm done. The idea is to have the player click his game piece then click on the marker he want's to move to.

Now my problem. How should I find the right path for my player to walk. I can't really have him walk in a straight line. Since a hex-grid usually dictates that you walk in a … squiggly line (?). An a-star pathfinding thingy seems overkill for this. Any suggestions on how I should solve this?

#1
03/02/2011 (9:26 am)
I find Amit's Game Programming Information Page to be very helpful when I'm working with hex grids.

In my game, I did implement a special A* Path-Finding Algorithm, but it makes (correct) assumptions about my world that allow it to process faster. (Read: it's not robust enough to share.)