I’ve started planning out a hexagonal board/strategy game, and right now I’m working on the best way to lay out the board in memory.
My first impulse was to throw it in array and give each ‘half-step’ its own row (so one square down on the board would be two rows down in the array), but I’m not going to write code that wastes about half the memory it allocates with the empty cells this produces unless I have to.
My second thought was to force it to better fill the array by killing the white-space, however, this leads to problems distinguishing where to look for corners, which may possibly be solved by using mod 2 to figure out where the two side squares are.
Another possibility that I haven’t written out would be to just layout the ‘connections’ between pieces…
Anyways, since I have class in a bit, I thought I’d ask here. Has anyone done this, and if so, how did they do the board layout?