I'm thinking of taking another run at a project I've attempted a few times in the past, but have never had success in programing. I would like to create a game-board engine which can handle the management of hexagons.
The engine would define a new type, called TYPE: HEX. Commands this engine would support would be to draw a hexagon game board of any size the user wants (provided it fits on the screen), dimension the memory-array to efficiently contain the game board hexes, place or remove an object (well an object number) into or from a given hex, check surrounding hexes of any desired radius for objects (obstacles, targets, firing range), return the distance from a given hex to any other hex, check line of sight to another hex, plot movement paths to another hex while avoiding obstacles, determine front/back/side facing of an object to another hex, and transparently handle all of the mapping of the hexagon game board and objects to the square grid of the memory array.
I'm a war-gamer from way back, and I have always loved paper-map games played on hexagons, so it is natural that I should love computer games played on hexagons too. My question (before taking another stab at this project) is, has anyone already created such an engine in GL-Basic? I don't want to reinvent the wheel when I can be playing with the game mechanics instead.

I have failed at this project a few times before, but I get closer each time I try. If anyone has any advice on programing such an engine, please share!
Attached is an image which shows what I have learned from previous studies of this challenge. The illustrations shows how a hexagon game-board can be created out of squares, and how the square-hexagons can be efficiently stored in a computer array. But notice the odd mapping of the hexes onto the memory array, and notice how that pattern flips when the center object (center hex) moves one hex north or south. (North, in this case.) This flipping of the pattern happens each time an object moves a row north or south on the game field, and it is that patten which makes it very difficult to plot movement based on the computer array. You can't even use simple trig functions to determine cells present at a given radius in either the computer array or the hexagon game board (because the hex shape on the game board very quickly fails to conform to that of a circle, so you gather increasingly greater numbers of false positives.)
It's an interesting problem that I'd like to share with everyone here in the hope that, even if I fail on this attempt too, maybe I can infect you with the bug to crack this problem and give our GLBasic community the ability to create games on hexagonal game boards.
-CW