Newbie hex map

Hello,
I am looking for any advice on how to approach a simple hex based game. The map is hexagonal rather than square and I’d like the size (radius from the center) to be chosen by the player. I’ve got most all the other components of the game written out in my notes but I’m not sure how hex grids are usually handled. Are they usually treated as arrays (two dimensional arrays maybe) or is there another way?

I’m sure its handled the exact same as square tile map, just a different rendering technique.

How to get the center?
You could use the 2 point distance formula

distance = the square root of ( (x2 - x1)2 + (y2 - y1)2)

then divide the distance by 2 to get the raidus.

Thanks! :slight_smile: I’m not as far as rendering anything, just trying to get something to work through the console. Do you know any tutorials on how to setup a square map? I’ve gotten a few square maps to work in another project but it was pretty ugly and didn’t rely on coordinates but direct connections in each square.

Amit’s Game Programming pages probably has the best in-depth treatise regarding hex maps and coordinates.

http://www-cs-students.stanford.edu/~amitp/gameprog.html

Awesome, that site is great! I think I’ve worked out all my issues with the map. Thanks guys! ;D