Reputation: 2862
In a two-dimensional world simulation, for example the internal model of a robotics engine, or the representation of a world in a role-playing game, ground space is typically separated into a grid used to position items, similar to a game of chess (pawn to E4). I've seen this done both with grids of squares and with grids of hexagons.
What are the advantages and disadvantages each of using squares versus using hexagons as the basis for such a model?
Upvotes: 3
Views: 1203
Reputation: 34839
Squares are easier to deal with, because they map directly to 2-dimensional arrays. And they're also easier to draw, since the math to map squares to pixels is trivial. However, if you allow diagonal movement then you have the problem that diagonal movement is 1.4 times faster than vertical/horizontal movement.
Hexagons are preferred in most war games because the distance from the center of a hexagon to the center of an adjacent hexagon is the same regardless of direction. Hence the speed of motion is the same along all six natural directions. However, keeping track of your hexagons (and their neighbors) in an array requires more work, and drawing hexagons requires some math skills.
Upvotes: 3