Tile-based games like Chess have a simple modal: an array of arrays, each coordinate with an X and a Y value. This is easy to implement, and it is easy to figure out what is going on.
However, when I see games like Civilization 5, I am not sure how hexagonal worlds are implemented. I have a couple ideas, but cannot confirm them.
- Each row of hexagons is represented in the modal by an array of tiles. This would be much like the first chess board, but would require more effort to figure out adjacent tiles.
- Each tile only know what tiles border it. When the game renders one tile, that tile loads the 6 around it, which repeats until the screen is filled with tiles.
Are either of these guesses correct? If not, how do developers implement these hexagonal maps?