Friday 13 September 2019

HyperRogue 11.2: Thurston geometries (free update!)


The latest version of HyperRogue let us play three-dimensional non-Euclidean worlds. The animation above shows the three-dimensional hyperbolic geometry ℍ³; it feels as if it was expanding in all directions as you move through it; the video above feels a bit like zooming. The video above is a construction based on Penrose's kite-and-dart tiling. This tiling of the plane is constructed recursively — we start with a single kite or dart, and then, in each iteration, we replace this shape with two or three new, smaller shapes. In ℍ³, we can put these two or three shapes are on the next level — since the space is expanding, this allows them to be of the same size as the original one!

However, ℍ³ is very similar to the hyperbolic plane ℍ² — it just has more dimensions, basically. If you know how ℍ² and the Euclidean 3-dimensional space 𝔼³ work, there is not much new here. In two dimensions, we have just three geometries: hyperbolic ℍ², Euclidean 𝔼², and spherical 𝕊². (Note that most games claiming to use "non-Euclidean geometry" use the term incorrectly: they do weird things to topology or physics or whatever, but the geometry, which is about the sum of angles of a triangle, Pythagorean theorem, etc., is still Euclidean.) Can we do something more interesting in three dimensions?


We can! In the video above we are travelling through the Solv geometry. While ℍ³ expanded in all directions, Solv expands in one direction, but contracts in the other one. You know this puzzle about a bear who went 1 km to the south, 1 km to the west, 1 km to the north, and was back where it started? Well, this one is more complicated. If you go 1 step upwards, 1 step north, and 1 step downwards, you are now 2 steps to the north. If you go 1 step downwards, 1 step east, 1 step upwards, you are now 2 steps to the east. Sounds easy enough? Well, let's think how we could reach a point 1024 N 1024 E. We could just make 1024√2 steps NE, but there is a much quicker way: 10 U 1 N 10 D (which takes us 1024 steps N) 10 D 1 E 10 U (which takes us 1024 steps E). This route is more complicated, but it is shorter, and as we know, light always takes the shortest route, so it looks quite complex from the outside. In many places in the video above, you can see shapes that look like donuts — they are actually infinite planes of constant z coordinate (they visually wrap into donuts for the following reason: whether you want to see something far north or something far south, you should look roughly upwards, and whether you want to see something far east or far west, you should look roughly downwards). This sounds like a space that would make Cthulhu himself confused... in 2002, Jeff Weeks wrote "This [Solv geometry] is the real weird [...] I don’t know any good intrinsic way to understand it." (though we surely understand it better now). Hyperbolic space is like an exponentially growing tree — in a very curved hyperbolic space, a sphere of radius of 20 meters will have the same area as Earth, and a sphere of radius of 100 meters will be already larger than the observable Universe. If people lived on this hyperbolic Earth and wanted to travel quickly, they all would have to go through the center... and there would be not enough space for all of them. Solv geometry is also growing exponentially, but in a more interesting, non-tree-like way. Up to our knowledge, HyperRogue is one of the first real-time visualizations of Solv (the awesome SolvView by MagmaMcFry was made a few days earlier), so you can be one of the first explorers of this amazing space! The tree-like nature of hyperbolic space has recently found applications in data science — many kinds of data can be faithfully represented in ℍ²; maybe Solv could eventually find some applications too?

ℍ³ and Solv are two of the famous eight geometries which appear in the Thurston's geometrization conjecture (proven in 2003 by Grigori Perelman, who famously refused the 1000000$ dollar prize for this). These geometries are all homogeneous manifolds (which means they look the same in every point); ℍ³ is isotropic (it looks the same in every direction) but Solv is not. What are the others?


Probably the simplest non-isotropic geometry is ℍ²×𝔼 — hyperbolic planes stacked in an Euclidean way. This space expands in one direction, but stays the same in the other one. This can be seen in the video above — faraway walls are very thin, because the space expanded horizontally faster than vertically.


We also have 𝕊²×𝔼 — spheres stacked in Euclidean way. This is the geometry of the surface of a spherinder (like a cylinder, but based on a sphere instead of a circle). In this geometry, a small brick, when watched from a specific location, will look like a huge ring around you... more precisely, not one ring, but a series of concentric rings.


If you are familiar with 3D graphics, you may have seen that rotations are often represented as quaternions. These are unit quaternions, i.e., points [x,y,z,w] such that x²+y²+z²+w²=1. The set of unit quaternions is a three-dimensional sphere 𝕊³ (surface of the four-dimensional ball). In the video above, we are flying through this space of rotations: rotation matching the current camera position is shown in the corner, and beams in the rotation space correspond to bumps on the sphere. The opposite points of the sphere are identified, as they represent the same rotation. (See here for an interactive version of the video above.)


Quaternions are sometimes criticized, and HyperRogue does not use them either (outside of the video above) — rotations of the hyperbolic plane are not represented by quaternions (they are represented by split-quaternions, but HyperRogue generally prefers matrix representations). Anyway, the space of rotations of the hyperbolic plane, PSL(2,ℝ), is an example of yet another (non-isotropic) Thurston geometry (actually, the Thurston geometry itself is the universal cover of it). Remember how the screen in HyperRogue is usally rotated after we return to the same space? In particular, if we make a tiny loop on a small triangle, we end up rotated by the angle 360°/42 — this equals the difference between the sum of angles of this triangle (60° + 60° + 360°/7) and the Euclidean 180°. This means that, in PSL(2,ℝ), when we make a loop via "hyperbolic" translations, we end up a bit higher than we were originally. This is the reason the bricks in the space above have small Penrose staircases on their top and bottom faces. (Likewise, on a sphere, the sum of angles of a similar triangle is 60° + 60° + 72°, and every beam in the video above was subdivided into 360°/12° = 30 bricks.) (See also this video for the space of rotations rendered in a similar way to the previous video.)


Euclidean geometry is less confusing than hyperbolic or spherical geometry — the sum of angles of a triangle is always 180 degrees, so the space of rotations is rather boring. However, we can still achieve the loop effect. In Nil geometry, when we walk one step to the north, one step to the west, one step to the south, one step to the east, we end up one step above where we started. In general, when we go in the north-west-south-east direction and make a loop which would make us return to the starting point in the Euclidean plane, the Nil counterpart of this loop makes us end up directly above or below the starting point, with the distance proportional to the area of the loop. Interestingly, as can be seen from the area property, while the hyperbolic space grows exponentially with the radius, and 𝔼³ grows like the cube of the radius, Nil grows like the fourth power.

All the geometries above are available in HyperRogue 11.2 (special modes -> experiment with geometry -> dimensions:3). The last Thurston geometry is of course the Euclidean geometry 𝔼³ — nothing changed there (while ℍ³ and 𝕊³ got the new tessellations shown above in 11.2), but you can see it e.g. here. See Geometries in HyperRogue for more details and references. Thanks to MagmaMcFry for SolvView and some discussions regarding Solv and other Thurston geometries.

Since this release does not introduce new gameplay and is rather for scientific/educational purposes, and we believe that ideally science/education should be freely available, it is released for free (in the GPL sense). (We get some funding from scientific sources anyway.) Features from 11.0 and 11.1 are also included, but as usual, the paid Steam version includes social and competitive features such as achievements, online leaderboards in the main game and the special game modes, the Strange Challenge, and more frequent updates. According to the results of the poll on HyperRogue discord, our fans are the most interested in (1) making it easier to use HyperRogue's unique non-Euclidean geometry engine to create mods and variants, (2, roughly ex aequo) making HyperRogue's unique roguelike gameplay even better (new lands with unique mechanics), (3) new game modes, (4) new geometries and visualizations. (True to the roguelike spirit, almost noone cared about graphics and production value.) Thus, the next update is planned to focus on (1) and will also be free, and the next one is planned to focus on (2) — there are lots of new gameplay ideas to explore, both in ℍ² and in Solv (and in other geometries). Have fun!

7 comments:

  1. Hyperspace. Movement in four-dimensional space.
    https://youtu.be/mJK8bWYXtDA
    Simulation of camera movement in four-dimensional space.

    ReplyDelete
  2. The Steam requirements say 80 MB of storage yet gigs of RAM. Does the former not include the savefile size?

    In the game, change "would" (desiderative) to "should" (conditional).
    In your comments, change "weird" (fateful) to "uncanny" (bizarre).

    ReplyDelete
    Replies
    1. more:
      thin -> fine; faster -> swiftlier; will -> shall

      Delete
    2. bug reports:
      https://github.com/emscripten-core/emscripten/issues/6441#issuecomment-546615038
      camera rotation brings me back to settings.
      travel faster -> fare swiftlier
      extend the ends: endat
      faster -> swiftlier
      harder -> tou[g]her
      monster display mode isn't last.
      width -> coarseness, breadth
      Settings follow cursor but enter does the same as escape.
      larger -> greater (large:rare::great:small)
      Hmm, why isn't HyperRogue 64-bit?
      How do I turn off the cheat under sight range?
      ESC -> Esc
      F1 does nothing in many screens.
      mousewheel up -> mousewheel fore
      mousewheel down -> mousewheel hind
      Rogue: They -> Who, He, or She; Them -> Whom, Him, Her
      Hunting Ground: will -> shall
      Expansion: will -> shall; would -> should
      Straight Lines: 50 -> 80
      False Princess, Ratling Avenger, etc.: will -> shall
      Eagle: fast -> swift
      roses: nice < niais < nescius := not-skilled -> sweet, well, fair, kind, etc.
      Can't teleport out rose scent.
      Narcissist: their -> whose, his
      Rock Snake: longer -> wider, further
      Magic Mirror behaves like a free space when a mob is nearby.. can't break it.
      Fractals: millions of -> million
      Poincare Ball model: framed as a question without a question mark.
      Band: 8 does nothing during tutorial.
      Grash during tutorial!

      Delete
    3. Smup mode in tutorial made the game crash upon teleport; also got stuck in a ring of ghosts.

      Delete
    4. Flail Guard, Ratling Avenger: away from -> froward
      Skeleton: a longer time -> longer
      Dragon: them -> they
      Mouse doesn't select correct spaces in Halloween.

      Delete
  3. Doing carpentry in an H2xE universe would be a pain in the ass.

    Build a wall frame on the floor, rotate it into position, and -- oops! -- suddenly the nails pop out because the angles don't add up anymore.

    ReplyDelete