@ Zeno Rogue Games @ Vapors of Insanity @ Necklace of the Eye @ Hydra Slayer @ [ HyperRogue ] @ Untahris @
@ About @ Downloads @ Gallery of Lands @ FAQ @ Models @ [ Geometries ] @ Curves @ Programming @ RogueViz @ Images & Videos @ History & Naming & Credits @ press @
 

Experiments with geometry


Work in progress -- more pictures and references to be added.

HyperRogue was originally designed as a game played on the bitruncated order-3 heptagonal tiling of the hyperbolic plane. This tiling has very interesting properties for gameplay -- it is infinite (in fact, exponentially infinite, more infinite than anything Euclidean), and the existence of heptagons allows the player to use tactics to save themselves from the nasty monsters; the effects of hyperbolic geometry that can be witnessed in HyperRogue have been described in this article. Now, HyperRogue allows allows a wide selection of different tilings in the "experiment with geometry" menu. All the features of HyperRogue work in all the geometries (as long as this makes sense) -- thus, you can just admire the tilings, or you can play the game, draw (using the texture mode), or view it in many projections. This article describes the geometries and tessellations currently available in HyperRogue.

bitrunc.png
Icy Land, Great Wall, and the Alchemist Lab in the standard geometry, aka GP(1,1) {7,3}

We will start with dissecting the geometry of the standard HyperRogue map. We start with the order-3 heptagonal tiling of the hyperbolic plane, represented by the Schläfli symbol {7,3}. This tiling is represented by the thin cyan lines in the picture above. However, the heptagonal tiles are quite large -- not many of them fit on the screen. So we apply the process of bitruncation: we add a new tile at every vertex.

In general, the two-dimensional tilings in HyperRogue can be described by three elements: There are also some tilings which do not conform to this classification. We will explain them, and three-dimensional honeycombs, later.

Regular tessellations

In a regular tessellation represented by the Schläfli symbol $\{p,q\}$, each tile is a regular $p$-gon, and $q$ tiles meet in each vertex. The internal angles of a regular Euclidean $p$-gon has 180 - 360/p degrees, thus, in Euclidean tessellations we have 180 - 360/p = 360/q. We have three Euclidean tessellations: {3,6}, {4,4}, and {6,3}. A spherical $p$-gon has bigger internal angles than the corresponding Euclidean one, and a hyperbolic $p$-gon has smaller angles, thus hyperbolic tessellations have larger $p$, while spherical ones have smaller $p$.

HyperRogue currently supports: What about the icosahedron, tetrahedron, triangular grid, and hyperbolic tessellations such as {4,5} or {3,7}? These are available as duals -- described in the next section.

Operators

rlyeh-5gp52.png
R'Lyeh in GP(5,2) {5,3}
loem-gp20.png
Land of Eternal Motion in GP(2,0) {7,3}
square-goldberg.png
Crossroads IV in GP(5,3) {4,5}

The following operators are available: HyperRogue allows bitruncation of every regular tessellation, and Goldberg-Coxeter construction for any regular tessellation such that $q$=3,4 (see "variations" in the "Experiments with geometry" menu). Dual and rectified tilings can be obtained from bitruncated tilings by restricting the movement somewhat; this is done in the Crystal World and Warped Coast/Sea lands respectively. Some more cool facts:

Wrapping


smalltorus.png
The Desert in GP(1,1) {4,4}, or the bitruncated square grid. Torus, 4x4.

The simplest wrapped space is the flat torus. Take a rectangular sheet of paper, for example a square with edges of length 1. Glue the left and right edges, you get a cylinder. Glue the top and bottom edges, you get a torus (better to do this with a rubber rather than paper). HyperRogue does not normally display the obtained "donut" (though such a display is available in the "Hypersian rug" mode), but rather simulates the way this surface is interpreted by the beings who live inside it. If you are inside a torus, you will see yourself 1 unit to the north, 1 unit to the east, etc. -- you will see an image of yourself in every grid point! This is pictured above.

We say that the torus is a quotient space of the Euclidean plane -- it is obtained by identifying points $(x,y)$ and $(x',y')$ such that $x-x'$ and $y-y'$ are both integers. On the other hand, the perspective interpretion given above shows that the original Euclidean plane is the universal cover of the torus (covering spaces could be said to be the opposite of quotient spaces -- we unwrap a wrapped space by creating copies).

The following quotient spaces are currently available in HyperRogue:

projex.png
HyperRogue being used to play Projex -- a variant of Hex in the elliptic plane GP(2,2) {5,3} tiling of the elliptic plane, shown in the stereographic projection.
The blue circle (better visible in the zoomed in version) is the equator -- every point on this circle is actually the same point as the opposite point on the circle, and the inside is the same as outside.

Irregular tilings

irregulargrid2.png
Crossroads IV on an irregular grid
irregular-straightlines.png
Warped Coast on a bitruncated irregular grid

You can also play on (order-3) irregular grids. These are generated with the following algorithm: (see this visualization, which presents some of the steps nicely)

Irregular grids can be chosen in the "variations" submenu in the "Experiments with geometry" menu. You need to choose the base geometry first -- if a non-quotient hyperbolic surface is chosen, the construction is performed on a quotient space, and then unraveled to the hyperbolic plane. (Thus, whether you choose {7,3} or {8,3}, matters only for the "unit" of the density $d$, the quotient space (Bolza or Klein Quartic) which gives the period, and some minor technicalities.)

Binary tiling

ivory-binary.png
Ivory Tower in the binary tiling
whirlpool-binary.png
Whirlpool in the binary tiling

The binary tiling is geometrically a bit less regular that other tilings available in HyperRogue, but it is more natural from the point of view of a computer scientist, as it has a very simple structure of the infinite binary tree. This tree has no root -- every vertex has a parent. The set of all tiles at the given level forms a horocycle. HyperRogue uses a slightly shifted variant of the usual binary tree, where every cell has one child "on its own", one child with its left sibling, and one child with its right sibling. Being based on horocycles, this tiling is great for lands such as Ivory Tower, Whirlpool, and Temple of Cthulhu. Poincaré half-plane projection of each tile is similar to a rectangle of size width x 1, where the parameter "width" can be adjusted. By default, width is 1, which makes the tiles square. Since 11.1d the standard binary tiling is available too.

Archimedean tilings

mareksnub.png
Bull Dash in the Marek-snub tiling (3HL,6,6,6)(1,0)[2](3)
avine.png
Vineyard in (6,6,3L,3L,3L) (0 2)(1)(3)(4)
rose4614.png
Rose Garden in (4,6,14)
icy-hosohedron.png
Icy Land in (2,2,2,2,2,2)

These are tilings where all the faces are regular polygons, and the world looks the same from every vertex. There are 3 regular and 8 semiregular Euclidean tilings, 5 Platonic and 13 Archimedean (spherical) solids, and infinitely many prisms, antiprisms, hosohedra, dihedra, and hyperbolic tessellations. (HyperRogue has its limits though, so only finitely many are supported.)

The tiling can be given in the format inspired by Don Hatch's hyperbolic applet. The first part gives the number of sides of each face which meets in a vertex. Let n be the number of these faces. The edges are numbered 0 (the edge before the first face), 1 (the edge between the first and the second face), up to n-1. After this, you specify how two adjacent vertices will be connected. (i,j) means that edge i matches edge j of the adjacent vertex, which is oriented in the same way. [i,j] means that edge i matches edge j of the adjacent vertex, which is oriented in the opposite way. (i) is the same as (i,i), and [i] is the same as [i,i]. For each undefined edge, [i] is used. You can also specify ^k after each face (repeat this face k times), or after the whole face definition (repeat the whole sequence k times, this also repeats the connections). You can add special characters after face definitions: H (marks it a "heptagon" for the game rules -- relevant in some lands), L (draw lines on these tiles when generating Vineyard, Zebra, and Land of Power), l (like L but only on the mirrored tiles).

Generalization: k-isohedral tessellations

We can generalize Archimedean tilings even further: consider tessellations whose tiles fall into a finite number of types, and such that every pair of tiles of the same type leads to an isometry of the whole tessellation (this property is called $k$-isohedral, where $k$ is the number of types). Such tessellations can be defined in tes files and explored in HyperRogue. See this catalog of several thousands of Euclidean, hyperbolic, spherical and affine tessellations, compiled by Marek Čtrnáct. (In affine tessellations we use affine transformations instead of isometries.)

Penrose tilings

kite-dart.png
A regular pattern in the kite-and-dart tiling

Penrose tilings are named after Roger Penrose, who investigated them in the 1970s. HyperRogue currently implements the kite-and-dart tiling; other Penrose tilings have similar properties: Both properties are not typical to well-known tilings of the Euclidean plane. In all the Euclidean tilings so far, the tiles were arranged periodically, and it is impossible for a tiling based on a periodic grid to exhibit pentagonal symmetry.

These properties are less special from the point of view of beings in the hyperbolic space -- many tilings exhibit pentagonal symmetry, and one of the easiest hyperbolic tilings, the (standard) binary tiling, is also aperiodic: when we view the tile as a tree, each tile is either a "left child" or "right child" of its parent tile, that parent is again either a "left child" or "right child", and so on, and the "family histories" of two tiles are never, or almost never, the same. The construction of the kite-and-dart tiling is actually similar to that of the binary tiling. It is obtained by starting from a simple arrangement (e.g., five kites around a vertex) and then replacing kites and darts with smaller kites and darts (this process is neatly described here). This construction also can be reversed: if we tile the plane with kites and darts (by factor φ = 1.618...), they can be "deflated" in an unique way into larger kites and darts. Every tile will have a different history of where its ancestor from k deflations appears in its k+1th ancestor, making the tiling aperiodic.

Three-dimensional geometries

Much of the things explained so far generalize naturally into three dimensions. Three-dimensional Euclidean, spherical, and hyperbolic space are, well, similar to their two-dimensional variants, but in three dimensions. The 3D equivalent of a horocycle is a horosphere, whose intrinsic geometry is Euclidean; intrinsic geometry of equidistant surfaces (which are equidistant to a plane) is hyperbolic. Three-dimensional tilings are usually called honeycombs.

Non-isotropic 3D geometries

So far we have been using the word "geometry" rather informally; formally, a "geometry" can be understood as a simple connected space which is homogeneous, that is, looks exactly the same at each point. Thus, there are three 2D geometries (spherical, Euclidean, hyperbolic) which are all not only homogeneous, but also isotropic, i.e., the space also looks exactly the same in each direction. In 3D, we have the same three isotropic geometries, but without the isotropy requirement, we get more. In particular, we get the famous eight Thurston geometries, called so after the Thurston's geometrization conjecture (which generalizes the famous Poincaré conjecture, and has been proven in 2003 by Grigori Perelman, who famously rejected both the $1000000 prize and the Fields Medal for this). These are:

$\mathbb{E}^3,\ \mathbb{H}^3,\ \mathbb{S}^3$

These are the three isotropic geometries (Euclidean, hyperbolic, spherical) we already know.

$\mathbb{H}^2\times\mathbb{E}$

Probably the simplest non-isotropic geometry, obtained by stacking hyperbolic planes in an Euclidean way. In HyperRogue, you can perform $\times\mathbb{E}$ on any 2D hyperbolic tiling. See this short video.

$\mathbb{S}^2\times\mathbb{E}$

Likewise, but we stack spherical planes in an Euclidean way. Surface of a spherinder. While conceptually a bit easier than $\mathbb{H}^2\times\mathbb{E}$, in practice it looks much weirder and more interesting -- this is because the same object will be seen in multiple directions! These multiple images correspond to going around the sphere multiple times. So a small object (say, a small triangle) may look like a whole row of triangles, or like a row of concentric rings (if it is in the antipodal point), or like a triangle below you plus concentric rings (if it is below you). Or you could get crescent shapes if it is close to the antipodal point/below you. Obviously, when you do "current geometry x $\mathbb{E}$" on a 2D spherical tiling in HyperRogue, you get this geometry.

Solv, aka Sol or Solve

This geometry has interesting features not exhibited by any 2D geometry, and is much weirder than all the geometries we have seen so far. It is also quite impressive visually. (It is kind of sad that the more interesting geometries have such boring names.)

Imagine a plane, tessellate it with squares, and put a 1x1 cubes on each square. Then, put a 2x2 cube on each four cubes on the first level, a 4x4 cube on each four cubes on the second level, and so on. Also do the same in the direction below the plane (0.5x0.5 cubes, and so on). Consider this a map in $\mathbb{R}^3$ of a manifold, where the size of the cube corresponds to the metric (our model distorts the distances, all the cubes are actually the same size in the actual manifold) -- so, for example, we can get from the cube (0,0,0) to (1024,0,0) in just 21 steps (move 10 cubes upwards, one cube to the right (which corresponds to 1024 steps on the 0 level), and 10 cubes downwards). We already know this manifold -- this is the hyperbolic geometry $\mathbb{H}^3$, viewed in the Poincaré half-space model, with its "{4,4} on horospheres" honeycomb, already described.

To obtain the Solv geometry, we also start with 1x1 cubes arranged in a plane, but on top of these 1x1 cubes, we put (1/2)x2 cuboids instead. On top of them, we put (1/4)x4 cuboids, and so on. For example, We can reach the cube at (1024,1024,0) from (0,0,0) in just 42 steps -- first, we go 10 levels upwards (in the Z direction), make one step in the Y direction, and 10 levels downwards. We are now in (0,1024,0). Now, go 10 levels downwards (as previously, we stack 2x(1/2) cuboids on the level below the original one, and so on), make one step in the X direction, and 10 levels upwards.

euc-image0.png
Euclidean geometry
solv-image0.png
Solv geometry

The Solv geometry has metric $ds^2 = (e^zdx)^2 + (e^{-z}dy)^2 + dz^2$, which is the continuous version of the description above; the construction above is a tessellation of it (a Solv analog of the binary tiling). While the model described above is (relatively) easy to understand, our view from inside the space would be actually way more complicated. According to the Fermat's principle, the light rays always take a path between two points which is the shortest route (geodesic) between them. So if you are standing in the point (0,0,0), you will see the point (1024,1024,0) roughly above you -- the light ray will take the route being the continuous analog of to the 42-step route described in the last paragraph. You will also see the same point (1024,1024,0) roughly below you -- the light ray could also work on the X direction first. And you will see it diagonally too -- the path from (0,0,0) to (1024,1024,0) is not the shortest, but it is also a geodesic (i.e., it is locally the shortest). And you will see it some other locations -- there are more geodesics. The picture above presents the cubes at level 0 viewed in the Euclidean and Solv metric; in both spaces we are looking in the same (diagonal) direction, and the structure is colored in the same way. As we can see, the "diagonal direction" seems to twist helically, and when we look upwards (or downwards), the light rays go back to our structure. See SolvView by MagmaMcFry to fly through this space.

In HyperRogue (since 11.1d) the Solv geometry (and similarly the other non-isotropic geometries) can be rendered both in the orthogonal/ perspective of the simple model described above, and in the native geodesic perspective (the "donuts" here are spaces of constant Z, and the camera is rotating). You can also choose whether the objects should move along the actual geodesics, or along the straight lines from the model.

Nil, aka twisted Euclidean

You know this puzzle about a bear who moved 1 km north, 1 km west, 1 km south, and it ended where it started? This was possible because of the spherical geometry of Earth. Many geometries can be explained in a similar way. We have six directions: north and south, west and east, up and down. Just as on Earth, these directions do not necessarily go in straight lines, they simply correspond to our coordinate system. In the twisted Euclidean space, if you go 1 unit to the north, 1 unit to the west, 1 unit to the south, and 1 unit to the east, you end up 1 unit above where you started (we could write this rule as NWES=U); also the NSEW directions all commute with up and down, which means that NU=UN and WU=UW. (In Euclidean NU=UN, WU=UW, NW=WN; in $\mathbb{H}^3$ we have NU=UNN, WU=UWW, NW=WN; in $\mathbb{H}^2\times\mathbb{E}$ we have NU=UNN, WU=UW, NW=WN; in Solv we have NU=UNN, WWU=UW, NW=WN.) In general, when we make a series of movements in the NESW directions which would make a loop in the Euclidean plane, that same series of movements in Nil makes us end up directly above or below the starting point, in distance proportional to the (signed) area of the Euclidean loop (the sign depends on whether we go clockwise or counterclockwise). Here is an animation in Nil (newer versions use another honeycomb which is symmetric and easier to understand).

Nil geometry allows us to naturally embed impossible structures such as the Penrose triangle or the Penrose staircase. Here are some animations in Nil: Penrose triangle, Penrose triangle chainmail, Penrose triangle network, driving on an impossible ring.

$\widetilde{SL(2,\mathbb{R})}$, read "the universal cover of $SL(2,\mathbb{R})$", or twisted $\mathbb{H}^2\times\mathbb{E}$

(OK, this name is even worse than Solv or Nil.) This combines the ideas of Nil and $\mathbb{H}^2\times\mathbb{E}$. It is like $\mathbb{H}^2\times\mathbb{E}$, but where a loop in $\mathbb{H}^2$ makes us end up directly above or below the starting point, proportionally to the area of the hyperbolic loop. Note that, in hyperbolic geometry, if you make a loop, you end up rotated by an angle proportional to the area of the loop (see Orb of the Sword). Therefore, this geometry is similar to the space of orientation-preserving isometries of the hyperbolic plane. It is not exactly the same space though: the space of isometries is called $PSL(2,\mathbb{R})$, and you naturally get the same isometry after rotating 360 degrees, or making a loop of area $2\pi$. In the universal cover of $PSL(2,\mathbb{R})$, that would be different points.

One might wonder whether we get a new geometry when that construction is applied to $\mathbb{S}^2$? Well, the space of rotations of a sphere (called $SO(3)$) is the same space as the elliptic 3-space $P\mathbb{S}^3$; many graphics engines use this fact by representing the rotations as unit quaternions (note that $q$ and $-q$ represent the same rotation). So the space of rotations in hyperbolic/spherical geometry is $PSL(2,\mathbb{R})$ / $P\mathbb{S}^3$, its double cover is $SL(2,\mathbb{R})$ / $\mathbb{S}^3$; $\mathbb{S}^3$ is simply connected, but $SL(2,\mathbb{R})$ is not.

HyperRogue does not implement this geometry in its universal cover form, but it does implement its $PSL(2,\mathbb{R})$ quotient as the "space of rotations". The space of rotations is available for both spherical and hyperbolic geometries (see this animation).

Conclusion

See also this thread which shows snowballs randomly distributed in various geometries. The technical aspects of our implementation are explained here.

As far as we know, SolvView and HyperRogue seem to be the first interactive geodesic visualizations of the Solv and Nil spaces. In the 2006 paper "Real-Time Animation in Hyperbolic, Spherical and Product Geometries", Jeff Weeks presents his visualizations of the isotropic and product spaces and plans to work on the remaining geometries; the $\mathbb{H}^2\times \mathbb{R}$ is also available in hyperbolic VR. In 2015 Pierre Berger has made static pictures of seven of the eight Thurston geometries (although it is not clear to me what structures are shown in the picture). Thanks to MagmaMcFry for SolvView (by the way, SolvView also visualizes the twisted hyperbolic geometry) and for pointing me towards the paper Frenet Formulas and Geodesics in Sol Geometry by Attila Bölcskei and Brigitta Szilágyi, which explains the Solv geometry and its geodesics nicely. The paper Visualization of Nil-geometry; Modelling Nil-geometry in Euclidean space with software presentation by Dávid Papp and Emil Molnár has been very helpful while programming Nil, while Geodesics and geodesic spheres in $\widetilde{SL(2,\mathbb{R})}$ geometry by Blaženka Divjak, Zlatko Erjavec, Barnabás Szabolcs and Brigitta Szilágyi has been very helpful while programming $\widetilde{SL(2,\mathbb{R})}$.

Statistics

HyperRogue gives some statistics about the current geometry, which needs some explanation.

How does this affect gameplay and land generation?

HyperRogue is designed for its standard geometry. Playing in other geometries lets us discover the gameplay effects of these geometries. The Steam version of HyperRogue has the Strange Challenge, which lets you to compare your HyperRogue skills in a randomly chosen geometry to other players!