Non-Euclidean geometry and games

The term “non-Euclidean” is often used by gamers (game developers, journalists, etc.) to mean any kind of game where the space does not work exactly as in our world. While such games typically tend to be amazing and very fun, this is not what “non-Euclidean” traditionally means for mathematicians, for whom it has a more precise meaning, which is not “anything that is not a perfectly normal space”. This article provides a summary of what “non-Euclidean” means, and the various weird geometries used in games.

A hexagon in the hyperbolic plane can have six right angles.

Non-Euclidean geometry

The discovery of non-Euclidean geometry is one of the most celebrated, surprising, and crazy moments in the history of mathematics. It is something that many great thinkers for more than 2000 years believed not to exist (not only in the real world, but also in fantasy worlds). So many popular expositions of mathematics discussing non-Euclidean geometry have been created that the term has rightfully entered the general public conscience, as something extremely alien, important, crazy, and difficult to understand. In general, something extremely cool!

The meridians on Earth are straight (and they eventually meet in the poles), while the parallels (except the equator) are not straight. The picture above shows an analogous situation in the hyperbolic plane. Red lines (“meridians”) are straight and they diverge, the central green line (“equator”) is straight, but the other green lines (“parallels”) are not. The red lines are all straight, and the red segments between two green lines are all of the same length; the picture may suggest that this is not the case, but this is an artifact of the projection used (it is impossible to render non-Euclidean geometry on a flat picture without distortion).
  • Look at the angles of a triangle. In Euclidean geometry, they sum up to 180 degrees. In spherical geometry, they sum up to more (for example, take the North Pole, and two vertices on the equator as the vertices). In hyperbolic geometry, they sum up to less.
  • An easy way to tell whether a game uses truly non-Euclidean geometry is to look for rectangles. In non-Euclidean geometry there are no rectangles, anything that looks a bit like a rectangle actually has its angles smaller than 90 degrees, or its edges are curved. So, if you see rectangles, the game is (probably) not non-Euclidean.
  • In Euclidean geometry, a circle of radius r has perimeter 2πr. In spherical geometry, it is 2πsin(r) (which is bounded), and in hyperbolic geometry, it is 2πsinh(r) (which grows exponentially). In a three-dimensional hyperbolic world with “absolute unit” of 1m, a ball with radius 100m will have greater volume than the observable Universe!
  • In truly non-Euclidean 3D games and simulations the parallax works different. In Euclidean space, things that are far away from you (stars, distant mountains) are seen in roughly the same place as you move. This changes in non-Euclidean geometries: in hyperbolic space, everything moves, while other non-Euclidean geometries are even weirder.

Manifolds

Games claiming to be non-Euclidean usually have worlds obtained by performing some kind of “surgery”: we cut some fragments (chambers) out of a Euclidean space, and then glue them together in some non-standard way. In 3D games, the place where we performed surgery typically looks like a portal, but the game may also make the surgery appear seamless. Mathematically, this is called a Euclidean (or flat) manifold (with boundary); Euclidean/flat because it is made of fragments of Euclidean space, and “with boundary” because there are typically some walls which you could not go through, and some points inside such walls could not even be modeled consistently (walls of the portals). It is also possible to have manifolds without boundary; typically these look like periodic spaces.

When the distance is not the Euclidean metric

I have seen some people argue that any games played on square grids are non-Euclidean. This is because, in such a game, the number of steps you need to take to reach point (x,y) from the point (0,0) is given by the formula |x|+|y| (so called taxicab metric) or max(|x|, |y|) (so called Chebyshev metric), or some other formula where the set of points in d steps is an octagon, while the Pythagorean theorem says that the distance between these two points is actually the square root of x²+y² (so called Euclidean metric). Similarly, one could say that HyperRogue is not hyperbolic, since it is a grid-based game.

Artists associated with non-Euclidean geometry

M. C. Escher has created many great artworks based on impossible geometries, which has in turn inspired many amazing games. If you read that Escher used non-Euclidean geometry, this is true, he did use non-Euclidean geometry in his Circle Limit series. However, if a game reminds you of e.g. Ascending and Descdending, Waterfall, Relativity, Depth, or Another World II, well, these artworks do not have much to do with non-Euclidean geometry. Commonly used terms for such spaces include impossible space/geometry or Escheresque.

Games and interactive demos using non-Euclidean geometry

  • our HyperRogue — a roguelike game taking place in the hyperbolic plane (i.e., two-dimensional hyperbolic geometry). This uses a hyperbolic plane (without any topological surgery or boundary), so its world is larger than No Man’s Sky, MineCraft, or anything Euclidean.
  • Bringris — our non-Euclidean falling block game (similar to Tetris), made with the HyperRogue engine.
  • MagicTile — like Rubik’s Cube, but in non-Euclidean 2D manifolds.
  • Hyperbolic Maze — a maze in a hyperbolic 2D manifold.
  • Hypernom — this uses three-dimensional spherical geometry.
  • Uniform Polychora — more three-dimensional spherical geometry.
  • Non-Euclidean VR (H3) — this is three-dimensional hyperbolic geometry. See also H2xR (hyperbolic in some dimensions and Euclidean in other dimensions) and a new version.
  • our Virtual Crocheting — a demo in three-dimensional spherical geometry.
  • Curved Spaces — fly through three-dimensional non-Euclidean manifolds.
  • Hyperbolic Games — simple games in 2D hyperbolic manifolds.
  • HyperSweeper — Minesweeper in hyperbolic plane.
  • Sokyokuban — Sokoban-like in the hyperbolic plane, playable in a browser. Holonomy makes it interesting. (See also this for another puzzle based on holonomy.)
  • H2Snake is a hyperbolic Snake game.
  • The Hyperbolic Maze Demo by Bernie Freidin seems to be the oldest hyperbolic game. There are some other old small games, like Henri’s Reef by Eric Bergstrome.
  • Hexagrid and Esfera Chess are 2D spherical games. Just like HyperRogue, they are grid-based games, and use the Goldberg-Coxeter construction to obtain more cells than a regular tiling would allow.
  • Henry Segerman has designed several 3D printed puzzles based on non-Euclidean geometry and topology. The holonomy maze is based on the concept of holonomy in spherical geometry. There are also variants of the classic Fifteen puzzle, based on non-Euclidean geometry and topology. Our computer simulations of these puzzles, and links to Henry’s videos can be found here.

Non-Euclidean games in development

Recently there are several cool non-Euclidean game projects in development!

  • HyperBlock — another Minecraft-like. The video linked shows H2xR geometry, i.e., a hyperbolic plane with the ‘z’ coordinate working in Euclidean way. Three-dimensional hyperbolic space will also be featured in HyperBlock.
  • Hyperbolica — a non-Euclidean game in development. The trailer shows hyperbolic geometry and a bit of spherical geometry. Contrary to HyperRogue, Hypermine and HyperBlock which are focused on gameplay in an infinite world, it appears to be more of a story-based game, with walking, puzzle, shooting elements, and more mainstream graphics. (The sun in hyperbolic space does not work like it is shown in the trailer — it should become visibly brighter as we move towards it — but hopefully it will be changed :)
  • Non-Euclidean billiards in VR — the idea of mapping a real right-angled square table to a hyperbolic right-angled pentagon, or spherical right-angled triangle, is very cool!
  • Last but not least, HyperRogue is also in development —its non-Euclidean engine and unique world is a great testing grounds for various experiments with game genres or other weird geometries, and the results of these experiments are added to the game. By changing the options, you can get something completely different than the original roguelike in the hyperbolic plane.You can experiment with spherical geometry, various manifolds without boundary, 3D geometries including non-isotropic ones; roguelites, racing, puzzles, and so on.
  • Spaceflux —the existing videos show “fractal geometry”, but the plans in the kickstarter page mention hyperbolic geometry and even non-isotropic geometry (Solv).

Games in wrapped spaces

Games in wrapped spaces are sometimes called non-Euclidean, even though it is one of the oldest tricks in game design!

  • Pac-Man (1980) — like Asteroids. In most versions you can only go through the E-W edge but not through the N-S edge, making it a cylinder (a manifold with boundary).
  • Civilization (1991) — as mentioned above, the surface of a sphere is non-Euclidean. This is why it is impossible to make a flat map of Earth which does not distort anything. Unfortunately, most games taking place on a spherical planet do not take this non-Euclidean geometry into account; they take a flat map and pretend that this map has no distortions. Civilization is played on a cylinder (you cannot go through a pole, while in the real world, the shortest flight from Europe to Hawaii would go through the North pole). Some other games are played on flat tori, which is in some sense even more different from a sphere.
  • Manifold Garden (2019) — it uses the term “manifold” correctly. I have not played it yet, it seems to be mostly a three-dimensional flat torus (i.e., a three-dimensional flat manifold without boundary), but it has some portals too.
  • Tetrisphere (1997)— while the name and the presentation suggest that this game is spherical, it is actually just because of the projection it is using. (It is not possible to tile the sphere with squares, four meeting in every vertex.) Every level is a flat torus.

Games with portals

In these games, we have “portals”, which take you into another part of the world. The portals tend to be explicit: you know where the portals are and as long as you do not go into a portal, the space works in a totally normal way.

  • Fragments of Euclid —a puzzle game in an Escheresque Euclidean manifold. Escheresque like in Escher’s Relativity or Another World: the directions are not consistent.
  • More interesting portals are possible too. What if the portal is knotted or linked? What if we send a portal through its other side? What if we make non-Euclidean portals (i.e. portals in some non-Euclidean space)? Can we make portals in the shape of Möbius strips? See this thread for some examples.

Games in impossible spaces

In the previous category we had games with explicit portals. A more interesting effect is obtained when the portals are not visible, producing an illusion of an “impossible space”.

  • Paradox Vector —a first-person shooter in an Escheresque Euclidean manifold. Escheresque like in Escher’s Relativity or Another World: the directions are not consistent.
  • Jet Set Willy (1984) —appears to be a normal platformer, but if you try to create a map, you learn that some things do not match correctly. Three rooms on the cellar level correspond to 9 rooms on the basement level, and 4 rooms on the top floor correspond to 6 rooms on the roof. (Vertical lines diverging makes it a bit similar to hyperbolic geometry.)
  • The VR game Tea for God (2020–2021) uses impossible spaces to simulate a large world using a small real-world space. A similar trick is also used in other VR games, e.g. Shattered Lights.

Recursive games

Some games use constructions which contain a smaller copy of themselves, or more precisely, contain themselves. This is no longer a Riemannian manifold, since we cannot uniquely define the distance between points in the space — if you go outwards, you become smaller and smaller, and thus things become larger and larger in comparison. Mathematically it is called an “affine manifold” (if any affine transformations are allowed) or “similarity manifold” (if things can only become smaller or larger). Affine/similarity geometry is different than Euclidean geometry (3rd axiom becomes meaningless) but it is still not called non-Euclidean, since parallel lines are not affected.

  • Mirror stage (2009) is a similar idea in 2D.
  • Patrick’s Parabox (2020) has some recursive aspects.
  • Sierpiński’s Tomb (2013) is a text game based on a similar idea.
  • Game inside a game is yet another one.
  • Spaceflux is similar, although we also become smaller and smaller as we go inside.
  • Super Hexagon and Infinite Pizza (2020) look a bit similar to Spaceflux, but they are not recursive —they do not repeat. It could be said that the gameplay in these games is Euclidean (there are two dimensions — angle and distance — which work in the Euclidean way), but rendered with a cool perspective.
  • It is also possible to have portals where one end is a square and the other end is a rectangle, causing the objects to be stretched by portals (see also my old demo based on a similar idea).
  • Fractality is also vaguely similar.
  • We could make this actually non-Euclidean by changing the metric — see non-Euclidean recursive house.

Other notable games which are geometrically weird

  • Four-dimensional games. Some people may think of these games as non-Euclidean, because four spatial dimensions would not fit in our three-dimensional world. However, a world which works just like our old three-dimensional Euclidean space, except that it has more dimensions, is still definitely Euclidean (according to definition). It is of course possible to have a four-dimensional non-Euclidean space, but at the time of writing, it appears that no game tried to implement this.
  • Perspective tricks, such as Fez, Echodrome, Monument Valley, Naya’s Quest, or Perspective. Superliminal has some perspective and “affine manifold”aspects. These games are weird and cool, but should not be called non-Euclidean either. I would call some of them Escheresque.
  • A Slower Speed of Light and Velocity Raptor are games based on Einstein’s special relativity theory (but where the speed of light is slower, making the relativistic effects more visible). Special relativity is based on Minkowski geometry, which is different from Euclidean geometry, and is related to hyperbolic geometry.

Videos claiming to be non-Euclidean (correctly or not)

  • Not Knot — a classic video featuring non-Euclidean 3D geometry.
  • Non-euclidean virtual reality — this is non-Euclidean in the mathematical sense.
  • our Temple of Cthulhu in 3D — the “squares” are actually curved. At a first glance it appears that this world consists of a sequence of smaller and smaller balls. In fact, these “balls” are horospheres (a shape from hyperbolic geometry that does not really have a Euclidean analog; interestingly, while the 3D world here is non-Euclidean, the geometry on the horosphere is Euclidean), and they are all infinite. (more similar videos)
  • our SolvRogue —while in two dimensions we have only spherical, Euclidean, and hyperbolic geometry, there are even weirder non-Euclidean geometries in three dimensions. Go here for more.
  • Non-Euclidean Worlds engine — this video starts with Circle Limit by M. C. Escher, which is indeed based on non-Euclidean (hyperbolic) geometry. However, the most of the video presents a plain old affine manifold with boundary.
  • “No! Euclid!” GPU Ray Tracer gets an upgrade! — this is quite interesting, because this is indeed a curved space, not based on surgery.
  • In early 2021 we see an influx of “non-Euclidean Minecraft” videos. These videos are usually made with the “non-Euclidean Minecraft mod”, which is not an actual name of the mod, but rather they are using the Immersive Portals mod (which allows constructing portals and impossible spaces) and/or the Pekhui mod (which, in combination with Immersive Portals, allows constructing recursive spaces and similarity manifolds in general). It appears that they use the term “non-Euclidean” because of “non-Euclidean Worlds engine”, and because they think that they get more viewers this way (which does not seem to be actually true —lots of people are confused by this). Sometimes the youtubers clearly do not know what non-Euclidean means at all (for example, the only weird phenomenon is that the chickens are huge).

Mathematics, game development, art, roguelikes, hyperbolic geometry. Sometimes all at once.