Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I understand the advantage of hexagonal tiles over square ones. But why aren't octagons used instead? I would think they would provide better, more natural movement in eight directions.

I was thinking about using that kind of map in some game, but I haven't seen any games using that kind of map, so I wonder if I missed something obviously flawed about using it?

share|improve this question
40  
Octagons don't tile. –  Boreal Apr 17 '13 at 21:37
2  
I wonder if there are any other shapes that tile like squares and hexagons –  Azaral Apr 18 '13 at 0:30
10  
@Azaral: There are only triangles, squares, and hexes. This has been proven. –  Nicol Bolas Apr 18 '13 at 0:46
5  
That makes me a little sad inside –  Azaral Apr 18 '13 at 4:31
10  
Well, actually there are tilings with other regular polygons, but only in non-euclidian geometries. You can get a regular pentagon tiling on a sphere for instance. –  TonioElGringo Apr 18 '13 at 6:34

4 Answers 4

up vote 49 down vote accepted

Octogons:

enter image description here

Hexagons:

enter image description here

The gaps in the octogons make for an unappealing game world.

Typically, if you wanted to allow for eight directions of movement, you would just use squares.

share|improve this answer
32  
An alternative is to have your game take place on the hyperbolic plane, where you can tile with octogons: roguetemple.com/z/hyper.php –  MartianInvader Apr 17 '13 at 22:22
2  
@MartianInvader How Interesting! –  Click Ok Apr 17 '13 at 22:43
    
"The gaps in the octogons make for an unappealing game world." I wouldn't say so, I certainly see usage for a pattern like that for less visible tiling. –  API-Beast Mar 22 at 1:56
1  
True enough, "unappealing" is the wrong word. I should say, the non-uniform structure introduces additional complexity for both the end user (who might have a hard time getting used to such a structure) and for the developer, who will likely find it more challenging to code for. –  Byte56 Mar 22 at 2:02

The author of HyperRogue here.

HyperRogue actually uses a tesselation made of hexagons and heptagons, here is the reason why this particular tesselation has been chosen, instead of only octagons or heptagons, for example: Hyperbolic geometry in Hyperbolic Rogue Basically, the octagons are too big.

Screenshot HyperRogue Numbered Screenshot

Also some consequences of using hyperbolic geometry in a game (what works in hyperbolic and do not work in Euclidean, and vice versa) are listed in that post.

And yes, as Christian guessed, HyperRogue internally uses the hyperboloid model.

I am not allowed to comment on Christian's answer, but there is a tesselation of the 3D space with 14-faced polyhedra: Bitruncated Cubic Honeycomb (why 14 faces, anyway?)

share|improve this answer
    
+1, Awesome piece of work btw! –  Tobias Kienzler Jan 14 at 19:16
    
Damn, only now saw your post. Yeah, I overlooked the bitruncated cubic honeycomb but Ilmari Karonen was also nice enough to point me to it. Really nice work you did with HyperRogue BTW. Any chance you'll be adding Ouya controls to it? :) –  Christian Feb 14 at 14:18
    
I got confused again. The bitruncated cubic honeycomb is not made up of regular polyhedra, i.e. not all faces are the same. The honeycomb Ilmari Karonen mentioned is made up of dodecahedra, i.e. 12-faced solids, that's why it's sort of the analogon to the hexagonal tiling: it works but it doesn't have the 14 directions you'd want (six "straight" directions for each face of a cube and eight "diagonal" ones for each vertex). The bitruncated cubic honeycomb is the analogon to the flat octagonal tiling: it works, but it doesn't have any advantage over a cubic honeycomb for game grids. –  Christian Feb 18 at 17:04
    
I added a screenshot so you could understand the tiling. However, maybe it's just me but I found it really hard to even see how many vertices each tile had. So I put the numbers of vertices in each of the tiles (well, not all of them actually) and suddenly the pattern became clear: it's overlapping circles of hexagons with heptagons in the middle. Hope it's ok that I messed with your answer, @ZenoRogue and sorry if I'm just slow with these things and y'all got it right away. –  Christian Mar 21 at 15:38
    
Thanks! What does it take to add Ouya controls? There is already an Android port, and joystick controls (for the Pandora console), so Ouya controls should be easy to add, although hard for me to test. –  Zeno Rogue Mar 24 at 20:27

To summarize and elaborate upon what has been said in other answers and in comments, triangles, squares and hexagons are the only mathematically possible regular tilings aka regular tessellations of the Euclidean plane. So yeah, this sucks. Triangles are completely useless here, squares suck because you can't move diagonally without having a somewhat unwieldy factor of 1.4142135623730950488016887242096980785696718753769480 ... give or take. Hexagons suck because you can't even move straight in both directions. Don't get me wrong, I still prefer them over squares within the constraints of the crappy reality mathematics left us with and go Civ5 for finally switching to hex grids. But still, if it was possible to tessellate with octagons, nobody would ever take a second look at hexagons.

You could say "Well, I don't care if there are gaps. I just pretend they aren't there." You'd get the truncated square tiling which is called square tiling not because there are little square gaps but because those octagons are in fact just glorified squares in terms of tiling the plane. Those little squares are what's left from truncating the corners off the squares that would actually tile the plane and in game terms, the reason to not use squares in the first place was to have an equal distance for straight and diagonal moves and this is what you don't have here. Diagonal moves have to bridge the same distance between tile centers as they would with square tiles. Conversely, if you pretend your magic digital space had actual holes, you can of course do that but what's the difference from just using square tiles and making diagonal moves just as expensive as straight ones?

truncated square tiling

Now this all wouldn't be so bad if there were really good alternatives that aren't Euclidean. Often, our grid is on some kind of planet anyway, so why not use an elliptic geometry, i.e. the surface of a sphere? Unfortunately, things don't look any better there (https://en.wikipedia.org/wiki/Spherical_polyhedra).

However, the hyperbolic plane really rocks when it comes to tessellations. There aren't just three, in fact there's an infinite number of regular tessellations, including an octagonal one.

octagonal tiling in the hyperbolic plane

The only problem is that the hyperbolic plane isn't something as nice as a flat surface or a sphere but basically the surface of a Pringle. You'd need one hell of a story hook to justify a game on a Pringle ;)

hyperbolic paraboloid

Still, the octagonal tiling is so elegant and the Poincaré disc looks so awesome that I'm really surprised it's almost never been done (previously I said "never been done" here but then I read MartianInvader's comment pointing to HyperRogue).

Implementation-wise, while I've never done it myself, it should be fairly straightforward to implement this with today's 3D architectures, since a Poincaré disc view can be constructed by putting everything on the surface of a hyperboloid and doing a perspective projection. (see https://en.wikipedia.org/wiki/Poincar%C3%A9_disk_model#Relation_to_the_hyperboloid_model)

construction of Poincare disk

Just one more thing to conclude this, in case you think about doing a grid-based space game and going to three dimensions, hoping that things might look rosier there ... better just give up. Not only would you need a regular convex polyhedron with 14 faces which doesn't exist, the only way to tessellate 3D Euclidean space with regular convex polyhedra is with cubes. Booooring. In hyperbolic space (see https://en.wikipedia.org/wiki/Uniform_honeycombs_in_hyperbolic_space) you can at least get something vaguely like the analogon to a hex grid by tessellating with dodecahedra (i.e. 12-faced polyhedra; that's almost 14, right?) but now you're in total brainfuck land and still haven't got the counterpart to an octagonal tiling:

Hyperbolic orthogonal dodecahedral honeycomb

Beautiful as hell? Oh my God, yes! Would I panic beyond measure if alien spaceships came after me in this and I was expected to react in a sensible way? You bet I would. This is probably the reason why most people just use either cubes or hexagonal prismatic stacks.

cubic honeycomb hexagonal prismatic honeycomb

share|improve this answer
4  
Pro tip: if you feel like being elected official ruler of the nerdiverse, make a Dwarf Fortress in a dodecahedral honeycomb in hyperbolic space. If you don't want anyone to challenge you for that title ever again and also make the Vulcans land and offer their submission under your rule before we even invent the warp drive, write it in an according Funge dialect (quadium.net/funge/spec98.html). –  Christian Jan 4 at 23:19
2  
3D does have a regular analogue of the hex grid, namely the FCC lattice, whose unit cell, the rhombic dodecahedron, is a Catalan solid (i.e. all its faces are identical and symmetric, even though not all the corners are). Haven't seen many games using it, though. –  Ilmari Karonen Jan 5 at 2:26
1  
@TobiasKienzler Despite what I said in the answer, that would be pretty awesome. If a game isn't able to rewire our brains to comprehend 3D hyberbolic space, then what is? :) –  Christian Jan 14 at 20:05
1  
@TobiasKienzler Isn't the 4D Rubik's cube missing from that list? Anyway, Adanaxis sounds gleefully insane. As for higher dimensions, geometry becomes surprisingly boring in higher dimensions: en.wikipedia.org/wiki/List_of_regular_polytopes#Tessellations It really boggles my mind. I would expect there to be more degrees of freedom so more polytopes and stuff. But no. Even hyperbolic space that has that infinite number of tessellations in 2D space goes down to 0 in dimensions >5. Euclidean space retains its cubic tessellation in all dimensions. –  Christian Jan 15 at 10:25
3  
+1 for "You'd need one hell of a story hook to justify a game on a Pringle." –  CaptainRedmuff Mar 21 at 12:49

Basically what you want is a monohedral tesselation (or tiling), that is a coverage of the entire plane (assuming 2d) with a single shape where the tiles do neither overlap nor leave gaps.

There are lots of shapes with which this can be done but when we introduce other constraints, usually orientation should stay the same or they should conform to a natural movement direction, basically only squares and hexagons remain.

Take the triangle for examples (which you might know from the tesselation of 3d objects). To fill the gaps between two triangels another triangle has to be inserted, but flipped upside down. This is obviously a hassle to generate when dealing with sprites for example since a seamless connection is important. Also triangular movement sucks.

The most natural, with regard to movement at least, is the square which happens to be the most frequently used. Hexagons are the next best thing and allow for more direct approach to a higher number of movement directions, i.e. not over the corner movement like 8-way movement on squares does. Usually they are used in more tactical games where the increase in movement is important.

Anyway, if you want to read up more, take a look at http://euler.slu.edu/escher/index.php/Tessellations_by_Polygons.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.