Friday, 17 February 2023

Sources of HyperRogue, part VII

Time to continue this blogpost series! So, without further ado...

First, let's talk a bit not about real lands, but rather "technical lands" that exists for technical reasons, and that typical players are not supposed to find. The world of HyperRogue is very large: a circle of radius r has about 3r/2 tiles; about 1000 new tiles are generated every step. This means that HyperRogue may use lots of memory, which may turn out to be a problem, especially on mobile devices where the memory is limited. So a "memory saving mode" has been introduced, which clears some map cells on the way, if the player is not likely to ever find these areas. But what happens if they manage to find them anyway? Such cells are then regenerated, but since we no longer know what was originally there, they are not the original ones -- and to clearly mark that this happened, they use a special land which is called Lost Memory, and they are generally empty (not even floor is there).

The land of Lost Memory has been also later reused for another purpose. Every cell in HyperRogue knows its "distance" from the start. This distance is a 16-bit signed integer, so it can only have values up to 32767. It is not likely that a normal player goes that far -- such a long trip would take quite a lot of real-world time as well as memory of your computer. However, if they did, the next tile would report its distance as -32768, which could potentially cause problems for some HyperRogue algorithms. It would be easy to fix this issue: just use a largest integer type, for example 32-bit, which could reach over 2 billions. However, why not do something weird instead? There is a similar issue in Minecraft, called "Far Lands": Minecraft is an open-world game, but if you did go extremely far from (0,0), the world starts to act very weird, again because of the problems with accurately representing large numbers in computers. So, as a reference to this, the world also starts to "fall apart" once you go about 32000 steps from the starting point. This is represented by more and more randomly placed floorless tiles, as well as the "world turtles", which are a reference to the old legends about turtles which hold the world on their backs. We also think that giving the size of HyperRogue world as "a number with about 7000 digits", rather than simply infinite, makes it more comparable to other game worlds -- usually "the largest game ever" rankings are won by some game like No Man's Sky, with its meager 20 digits, and where (contrary to HyperRogue) that huge size is not actually used for interesting gameplay. (One another interesting fun fact is that, as a consequence of hyperbolic geometry, even if typical players never meet the World Turtles, they are in fact the most common monster in the HyperRogue world!) The "Lost Memory" is reused for this, although the "Far Lands" are a different concept.

The name of Brown Island refers to the Brownian Motion. The terrain generation here is based on the random walk process (sometimes called Brownian motion, although that more often refers to a specific case of random walk). It is well known that random walk almost surely returns to its starting point in the Euclidean plane; on the other hand, this is not the case in hyperbolic geometry, and the land highlights this fact (the land generation method used would not work in Euclidean geometry, there would be land everywhere). The bronze beasts takes some inspiration from some submitted land ideas about lands combining the Ocean and Red Rock Valley mechanics, and monsters that would have to be killed by pushing them off great heights; this inspiration seems very remote, though. Tiger's Eye is just a new gem; nothing special about them, other than both Bronze Beasts and treasure had to fit the brown color theme. The description of Orb of Choice refers to Banach-Tarski paradox: a sphere can be subdivided into a finite number of subsets, which can then be rearranged to make two spheres of the original size. The Banach-Tarski paradox relies on the Axiom of Choice, hence the name of the orb. (We could use another set of axioms for mathematics, for instance include the Axiom of Determinacy; taking AD instead of AC means that Banach-Tarski paradox is impossible.) It is also possible to subdivide a hyperbolic plane into two hyperbolic planes, even without Axiom of Choice, although this feels less paradoxical since the hyperbolic plane is infinite.

The land Free Fall was originally named "West Wall" -- in Jet Set Willy there are a bunch of levels which form a wall of Willy's mansion, with names such as "East Wall Base" and "Half Way Up the East Wall". I imagined this land something similar. This is still visible in the internal name of this land, as well as the native monster name "Western Hawk". The land has no special map features, so we reuse the theme of "dogs" used in other empty lands -- this time, we have "falling dogs". (Should the Pirates in Whirlpool be called "Sea Dogs"?) Iron coming from meteorite has magical properties in some fantasy worlds (including the Witcher saga and Hydra Slayer), and it falls from the sky, so meteorite was an obvious candidate for treasure here.

Irradiated Field takes a bit of inspiration from the older land of Galápagos -- in Galápagos, there are gradual changes to the environment, which slightly affects the map generation, as well as the shape of tortoises, who "mutate" to be better adapted to the map. The Irradiated Field takes this general idea, and also the "mutation" theme, but this time, the effects are more relevant to the gameplay -- what monsters and what terrain features can be found varies much more strongly. There is a popular trope of mutations being caused by radiation -- while it is based on the effect of real-world radiation on DNA, the way it is used in pop culture (say, the Nuclear Throne game), where radiation immediately causes affected creatures to gain new powers, is not very similar to the actual evolution, which happens over thousands of generations, necessary to eliminate the majority of mutants, most of whom receive bad mutations. Anyway, we used this trope -- hence "irradiated" in the land name, a real-world radioactive mineral Tobernite as a treasure, and the weirdly glowing water, to represent the Cherenkov radiation. Most of the variations are based on including monsters from the previously existing lands, but we also have "mutants" (every land needs to introduce a new monster, at least a basic one, so that treasure generation could be based on its kill count), and some new features, like the fire traps and explosive barrels. Barrels are another popular videogame trope, for some weird reason video games tend to be full of barrels (explosive or not), the notable examples of explosive barrels being Doom and its roguelike adaptation, DRL.

Wetland is based on the idea of Teal Knight in the HyperRogue discord server. As already mentioned in the first part, most lands in HyperRogue include some anti-camping feature, that is, some way to make it impossible to find a spot where the monsters can come from only one direction, which thus becomes a safe spot. The original idea did not include anything like that, so we have added water spirits who can drown the player character. Always good to have more Slavic folklore in video games; I have seen "rusalki" in Betrayal at Krondor but it was annoying, since "rusalki" is a plural form. We are using the Polish spelling Rusałka; in Polish "ł" is pronounced like the English W, and Russian русалка has a similar pronounciation, although most English sources use the Czech name (as popularized wordwide in an opera by Antonín Dvořák) which is simply "rusalka". Rusałki are typically feminine, so (depending on your settings) you may instead meet the male form, called Topielec; these guys could be also met in The Witcher games. The original idea included "skippers"; to reinforce the Slavic theme, we have instead chosen fish that could be found in Polish fresh waters -- hence the "pikes". Wetland are often regarded as bad places -- often cursed in video games, filled with mosquitoes, or dangerous due to the diseases carried by those mosquitoes ("swamp fever") -- so the Orb of Plague fit. Coincidentally, this land was released close to the start of the COVID pandemic (the idea for the Orb of Plague was older).

Sprite Guard mentioned many times that we had Orb of the Frog in the game but no actual frogs, and Frog Park fixes this. We also had three similar orbs -- Frog, Vaulting, and Phasing -- so it was cool to have a land highlighting the different tactical uses of the three. The "Gold Ball" treasure is of course a reference to the Frog Prince fairy tale. I did not remember the golden ball from that fairy tale, but it was also referenced in ADOM, where frogs can give you golden balls.

The players consider the Irradiated Field to be one of the best lands in HyperRogue, so it was good to include another land combining features of many earlier ones. Additionally, one of our friends has suggested at some (early) time a land combining the ice mechanics of the Icy Land and the electricity of Land of Storms -- well, the electricity mechanics was interesting, but definitely underused. Neither electricity nor ice melting would fit the design of Irradiated Field, but they both could fit a new land. Eclectic City is such a land -- "eclectic" means just that (combining features of many styles) but it is also a play on "Electricity". I read about the "Wave Function Collapse" algorithm used for procedural generation, which was bound to have some interesting properties in hyperbolic plane -- the most interesting one for me was that such local constraint satisfaction problem could be solved in polynomial time, while being NP-complete in Euclidean plane. So the land generation in Eclectic City was based on something similar to these ideas. (Not the polynomial thing, the degree of that polynomial would be too high for practical use, and not really the original WFC algorithm, which was taken more as a loose inspiration.) This kind of lands feels quite chaotic, just like the Chaos mode, so "Orb of Chaos" became the native Orb. Tehora wanted the Lapis Lazuli treasure to appear, but we did not want simply another gem, so Lazurite Figurines became the treasure.

The idea for Cursed Canyon could come from many sources -- "cursed" items with negative effects are a common roguelike feature, after all. However, the inspiration comes mainly from deckbuilders, where you usually make your deck better and better as the game progresses, but you can also get "curses", cards which give you negative points, and even worse, block your deck. Primarily the original Dominion, although it appears in other deckbuilders too, like Slay the Spire. (If you liked Slay the Spire but have not played Dominion, fix this! You can play online for free, both against bots and other players.) Many Orbs could have their "bad" counterparts, that have a reverse effect. The idea was quite old; I remember telling Marek14 about it, who suggested that it could be themed around mushrooms -- a rather nice idea since there is no mushroom theme in HyperRogue yet, although I was not sure how to fill the details. I also wanted the Shadow to reappear -- this mechanics was so far used only in Graveyard, but it could be more interesting in a place full of narrow passages, and as a mechanics forcing movement -- both of which were also great in a Curse-based land! The specific curses were just reversals of existing Orbs. The treasure started as something boring ("Cursed Gem" or something like that) but as Tehora saw it, she got really disappointed and went to her bookshelf, conjuring an ancient book on witchcraft out of nowhere. She said she got it from her father. The book mentioned capon stones, so we have used that; the Polish description is a quote from a famous Polish dictionary from the nineteenth century, unfortunately we could not find a similar quote in English, so Wikipedia is used for now. The name "Orb of Purity" comes from the common trope of purity and religion warding one against evil magic, but it is also a nod to "weapons of purity" in Unexplored, especially liked by Tehora since tehora means purity in Jewish.

The somewhat abstract nature of Dice Reserve did arise as a combination of many ideas. It seems that interests in hyperbolic geometry and dice are strongly correlated; for example, we (Zeno and Tehora Rogue) have independently started dice collections and interest in hyperbolic geometry, and Henry Segerman, known by many readers from his work on many visualizations of non-Euclidean geometry, is also involved in creating mathematically interesting dice. This is not surprising -- dice are essentially spherical tessellations. Furthermore, many people have noticed the interesting patterns happening when you roll a die on a tessellation, and have created puzzles based on that (see e.g. this paper for a list of references). The reason why these interesting patterns arise is the difference of geometry between the die (spherical) and the ground (usually Euclidean); we could imagine other combinations too, like rolling a horo-die on the hyperbolic plane. So adding dice to HyperRogue was a natural idea. This naturally combined with another idea, which was to have a Sokoban-style block pushing puzzle in HyperRogue; could we have a nice procedurally generated one? After some experimentation, it turned out that Sokoban-style puzzle would not really work as one of lands in our game. At heart, HyperRogue is a fast-paced exploration game, while in interesting Sokoban puzzles you would spend time roughly at a single place, pushing blocks around, so it would not really fit. Thus, to obtain a better fit to the HyperRogue gameplay, the dice are pushing themselves on their own! The land is named Dice Reserve; a place where the dice could calmly rest after being thrown. The dice like to show the highest value as a contrary to dice shaming, and they are angered once they are turned over. The treasure is "crystal die" -- we had no rock crystal as a treasure yet, and one of the popular styles of polyhedral dice is called "crystal". Overgrown Woods already had the Orb of Luck -- while the orb itself was based on a nice idea, its placement in Overgrown Wood was quite unthematic. So naturally, the Orb of Luck was moved to the Dice Reserve, where it was a perfect thematical fit. Overgrown Woods got Orb of the Woods instead (the name a bit inspired by the Jethro Tull song, Songs from the Wood).

Somewhere on the way, the special land Space Rocks was added. There is not much to talk about it, it is just a clone of the classic game Asteroids (as even the name suggests). Anybody interesting in classic games should know Asteroids; being played on a torus, it is also interesting from the point of view of topology, so many mathematicians use Asteroids as example to explain these things, and also many mathematicians create Asteroids clone to explain things in geometry and topology (see e.g. here and here). So while the idea is not very original, the magic of HyperRogue engine, RogueViz, meant that the game would be immediately available in all 2D and 3D geometries and topologies and projections supported by the engine. It does not really match HyperRogue though (working reasonably only in closed manifolds and real time), so a similar idea today would probably be released as a separate game (like Bringris, Nil Rider and Relative Hell).

That's all the lands existing in HyperRogue at the moment! Since HyperRogue is still developed, it is likely that new lands might be added, and we will need to explain the references in them. Possibly a new episode of this series will come sooner, though -- focusing on minor features which were somehow forgotten, on features which are not related to a specific land (e.g., special modes), or maybe ideas for lands that were considered and experimented with but did not work for some reason. Until then, thanks for reading!