How to create a game using hyperbolic geometry? (2020)(roguetemple.com)
roguetemple.com
How to create a game using hyperbolic geometry? (2020)
http://roguetemple.com/z/hyper/dev.php
45 comments
> find the center of this circle
That damned holy grail. It's only something like 21 steps from the edge of the circle. How hard can that be, right?
That damned holy grail. It's only something like 21 steps from the edge of the circle. How hard can that be, right?
Well, it's also easy to imagine a Euclidean variation of HyperRogue that would use portals (line segments) as biome bondaries, instead of lines.
"Hyperbolic space has a lot more space in it than flat space. The circumference of a circle grows linearly with the radius in flat space, but exponentially in hyperbolic space. There's a huge amount of room even just a short distance away from some given point."
So why can't the effect be simulated in Euclidean space by just using a bigger circle?
So why can't the effect be simulated in Euclidean space by just using a bigger circle?
It’s not about a single circle, but about the growth rate.
[deleted]
In 2010 I released an iPhone game that uses hyperbolic geometry in a similar way. It's a match 3 game inspired by the work of M. C. Escher. A few years back I ported it to javascript using emscripten. You can play it for free here.
https://hyperlogic.github.io/circull/circull.html
https://hyperlogic.github.io/circull/circull.html
This was really fun to play!
I wish there was a way to request hints on my own time instead of getting the flashing after a few seconds. In my experience the flashing hints were coming too quickly for me to even look through the whole board, let alone choose an optimal switch.
Nevertheless, great game! Thanks for sharing.
I wish there was a way to request hints on my own time instead of getting the flashing after a few seconds. In my experience the flashing hints were coming too quickly for me to even look through the whole board, let alone choose an optimal switch.
Nevertheless, great game! Thanks for sharing.
Thanks for sharing! I thought that Circull was a game that once existed for iOS and then was lost, did not know about the web version. (Esfera Chess was another iOS game that was non-Euclidean in some sense and is lost.)
This is very fun! Thanks for linking!
Nice.
Maybe you should fix the palette and not have cyan and teal in the same set (for balance you could shift teal in the direction of blue and further).
The principle is similar to that of defining a palette for readability of graphs (we also had interesting submissions on HN on the topic).
Maybe you should fix the palette and not have cyan and teal in the same set (for balance you could shift teal in the direction of blue and further).
The principle is similar to that of defining a palette for readability of graphs (we also had interesting submissions on HN on the topic).
Can’t find in App Store :(
This is beautiful!
If you are interested in this, see also https://www.youtube.com/watch?v=pXWRYpdYc7Q&list=PLh9DXIT3m6... , in particular the ones labelled "Devlog". The two complement each other nicely; the HN link is heavy on the math, the Hyperbolica devlog focuses a lot on the practical considerations, though there's overlap in both directions of course.
Ah, Hyperbolica. I just wish it had more going for it. It feels a lot like the sort of cute educational tech-demo game which you'd show school children/teenagers if you (for whatever reason) wanted to teach them about hyperbolic geometry.
Don't get me wrong, I'm glad that it exists and hope that it inspires some more hyperbolic games (and makes it easier for other people to get started), but game-wise it's incredibly thin, and doesn't have much (if anything) going for it apart from some hyperbolic geometry (which makes some things slightly weird or quirky).
Hyperrogue is much more of a game. It's arguably not a great game (it has a bunch of oddities, and I'd argue some pretty severe flaws), but it does much, much more with the concept, and some of the worlds are genuinely quite compelling.
Don't get me wrong, I'm glad that it exists and hope that it inspires some more hyperbolic games (and makes it easier for other people to get started), but game-wise it's incredibly thin, and doesn't have much (if anything) going for it apart from some hyperbolic geometry (which makes some things slightly weird or quirky).
Hyperrogue is much more of a game. It's arguably not a great game (it has a bunch of oddities, and I'd argue some pretty severe flaws), but it does much, much more with the concept, and some of the worlds are genuinely quite compelling.
What would you consider a severe flaw? I see severe flaws even in very popular games :)
Oh hi Zeno. Don't get me wrong, I love your game a lot, and have played it a lot. I also agree that a lot of very popular games have some pretty severe flaws, though they're often of a different nature.
Anyway, when it comes to Hyperrogue's flaws: 1. The menu is incredibly weird and difficult to navigate. I know a few people who never even knew that certain options existed, since they were hidden a few menu options in. I sometimes have to search for stuff if I didn't start the game in a while.
2. Sometimes there are areas which are rather monotonous and easy, and where you'll be tempted to just 'race' through the area by using scrolling as your main movement method. This works great, until it doesn't, because RNG decides to spawn two enemies in the worst possible locations and you're suddenly locked into a game over. Misclicks can also result in an instant game over, and they happen now and then. In theory it'd be possible to just take things slowly all the time, but this can quickly get really boring when covering large distances. The princess quest is a good example: Very cool idea, but the actual quest gets very tedious. Because of the nature of the area you have to play slowly, but it can be a long, long distance until you actually reach the princess.
tl;dr: Dying with 100+ treasures in Hyperrogue is frustrating since it can happen out of nowhere, and avoiding it would force you to play incredibly carefully and slowly, and/or to avoid some of the more interesting/dangerous lands. If you die you have to start over from scratch, but the game imo doesn't really benefit much from that, and it just forces you to redo the early areas of the game, which isn't that compelling, since the gameplay in these areas is always going to be the same.
Anyway, when it comes to Hyperrogue's flaws: 1. The menu is incredibly weird and difficult to navigate. I know a few people who never even knew that certain options existed, since they were hidden a few menu options in. I sometimes have to search for stuff if I didn't start the game in a while.
2. Sometimes there are areas which are rather monotonous and easy, and where you'll be tempted to just 'race' through the area by using scrolling as your main movement method. This works great, until it doesn't, because RNG decides to spawn two enemies in the worst possible locations and you're suddenly locked into a game over. Misclicks can also result in an instant game over, and they happen now and then. In theory it'd be possible to just take things slowly all the time, but this can quickly get really boring when covering large distances. The princess quest is a good example: Very cool idea, but the actual quest gets very tedious. Because of the nature of the area you have to play slowly, but it can be a long, long distance until you actually reach the princess.
tl;dr: Dying with 100+ treasures in Hyperrogue is frustrating since it can happen out of nowhere, and avoiding it would force you to play incredibly carefully and slowly, and/or to avoid some of the more interesting/dangerous lands. If you die you have to start over from scratch, but the game imo doesn't really benefit much from that, and it just forces you to redo the early areas of the game, which isn't that compelling, since the gameplay in these areas is always going to be the same.
Well, there is "casual mode" which makes Orb of Safety saves permanent, and also the "Orb strategy mode", where a single instance of carelessness of bad luck should no longer end the run (but it makes the game harder in some other aspects). People complain about the menus, although it seems that there are just too many options to make all of them easily discoverable...
Ah yes, Hyperbolica. Good stuff.
Probably commenting too late for folks to actually see it, but there's a great game made in 3d hyperbolic/euclidean/elliptic/weird combos of those in different dimensions known as Hyerbolica: https://store.steampowered.com/app/1256230/Hyperbolica/ He's got a great devlog on Youtube: https://www.youtube.com/watch?v=EMKLeS-Uq_8&list=PLh9DXIT3m6...
The author is also making a golf game: https://store.steampowered.com/app/2147950/4D_Golf/?curator_...
The author is also making a golf game: https://store.steampowered.com/app/2147950/4D_Golf/?curator_...
What do you mean by "weird combos of those"? AFAIK Hyperbolica only has H3 and S3 (and a bit of E3), no combos. (While HyperRogue has all eight Thurston geometries and some more.)
https://sokyokuban.com/#1
Another nice and small hyperbolic geometrical game.
Another nice and small hyperbolic geometrical game.
Really nice game! Quite nice for the counterintuitive aspects of navigating the hyperbolic disk.
Once I understood non-linear vector spaces and coordinate transformations… wait what am I saying?
One day, I realized you can do cool stuff if you have geometry data as x, y, z:
t = x + y;
xt = sin(t);
yt = cos(t);
zt = sqrt(xt**2 + yt**2);
You’d only do it that way explicitly in a vertex shader—but congratulations, that’s a coordinate transformation!
Now do it with more xyzwqp’s, then, profit!
In my example, I compressed x+y down to one parameter. You’ll be combining 4 spacial dimensions into combinations of xyz for use with a rendering pipeline.
Or, alternatively projecting straight to xy. Not sure which is preferable.
One day, I realized you can do cool stuff if you have geometry data as x, y, z:
t = x + y;
xt = sin(t);
yt = cos(t);
zt = sqrt(xt**2 + yt**2);
You’d only do it that way explicitly in a vertex shader—but congratulations, that’s a coordinate transformation!
Now do it with more xyzwqp’s, then, profit!
In my example, I compressed x+y down to one parameter. You’ll be combining 4 spacial dimensions into combinations of xyz for use with a rendering pipeline.
Or, alternatively projecting straight to xy. Not sure which is preferable.
In hyperbolic geometry it's hard to even have x,y coordinates at all. Once upon a time I looked at the source code of a hyperbolic 2D game; can't remember if it was HyperRogue or something else. It recorded your position as something like a binary representation of a path down a tree from the origin point.
More precisely -- you can have x,y coordinates, or (easier to work with) x,y,z coordinates, but you would quickly run into numerical precision issues, and that binary representation prevents that. (Probably it was HyperRogue, other hyperbolic games are wrapped or small enough to work without it. David Madore's hyperbolic maze has a wrapped world so it uses a totally different system. I think Sokyokuban also has tree-based representation of the map, even if the world is small. It could also be Hypermine by Ralith, it is also open world and open source.)
Woah, you have a hyperbolic screen?
Haha. But you do have to project to x and y screenspace eventually, if you want to see your work. My take was pretty slanted towards vertex shader techniques rather than xyz representing cartesian spaces (or even euclidean).
One could imagine some scaling factor or something ending up in the shader variable for VERTEX.z that isn’t really z in an xyz mesh.
My afterthought scenario of projecting to XY (screenspace) is probably the more relevant one.
Haha. But you do have to project to x and y screenspace eventually, if you want to see your work. My take was pretty slanted towards vertex shader techniques rather than xyz representing cartesian spaces (or even euclidean).
One could imagine some scaling factor or something ending up in the shader variable for VERTEX.z that isn’t really z in an xyz mesh.
My afterthought scenario of projecting to XY (screenspace) is probably the more relevant one.
Now what you should really do to make this more interesting that just a concept demo of what amounts to an immediately obvious gimmick, is to use the underlying hyperbolic geometry, but instead of making that the obvious focal point of the game/ui, make that geometry a hidden component of the game and force the user to deal with it indirectly or as hidden information.
I have to point out that Hyperrogue is far from a tech demo. Though the controls are simple, there's some 60 lands each with fascinating rules and emergent complexities. https://www.roguetemple.com/z/hyper/gallery.php
Regarding making geometry a hidden component: it, kind of, is a hidden component in HyperRogue. I mean, yeah, it is in the name. But people play HyperRogue without understanding what hyperbolic geometry is. They think it is a game taking place on a sphere, or a normal Euclidean map with some kind of fish-eye projection. On the other hand, I do not think it is really possible to hide it from someone who knows how these things work, as the perspective works very different in hyperbolic geometry.
Which is actually quite cool: while so-called "non-Euclidean" games do all they can to show how weird they are, the actual non-Euclidean geometry pretends to be normal (but actually it is way more weird).
Which is actually quite cool: while so-called "non-Euclidean" games do all they can to show how weird they are, the actual non-Euclidean geometry pretends to be normal (but actually it is way more weird).
I too have delved into a variety of fancy geometries for roguelike, rts, etc. And still do.
My friends tell me, "no. Just use square grids. Nobody's brain wants to process that stuff. It's too complicated".
But I'm still looking. Maybe the hyperbolic. There are definitely advantages. It beautifully combines the efficiencies of top down view and wide-view perspective.
Maybe it could be rendered more prettily.
My friends tell me, "no. Just use square grids. Nobody's brain wants to process that stuff. It's too complicated".
But I'm still looking. Maybe the hyperbolic. There are definitely advantages. It beautifully combines the efficiencies of top down view and wide-view perspective.
Maybe it could be rendered more prettily.
Hyperbolic is fundamentally different geometry. The circumference of a hyperbolic circle is exponential in the radius. Yeah that's right - add one unit (or at least, a fixed number of units) to the radius, and the circumference *doubles*. If you're thinking about using this geometry you should go and play HyperRogue to get a feel for it.
> My friends tell me ... Nobody's brain wants
Hit them with a stick. Tell them that people think that they should be hit with a stick.
The actual topic here seems to be, at this time a classic, "one product that maximizes adoption in a population" vs "an outstanding product for a niche".
Hit them with a stick. Tell them that people think that they should be hit with a stick.
The actual topic here seems to be, at this time a classic, "one product that maximizes adoption in a population" vs "an outstanding product for a niche".
This is really cool! But unfortunately for me, it gives me vertigo after a minute or two. Anyone else have that sensation and/or any pointers to resolve? I'd like to keep playing with this if possible.
Slightly off topic: does anyone have good intros to hyperbolic geometry? I was imitating drawn by applications related to hyperbolic embeddings in NLP, but I’m having a hard time understanding why, in what ways and how it could be “better” than euclidean etc
Fun fact: just this week I asked gpt3.5 examples of concrete applications of hyperbolic geometry and it suggested designing transportation networks. When I asked how so, the explanation was that subway lines could make sharper turns in hyperbolic geometry.
Fun fact: just this week I asked gpt3.5 examples of concrete applications of hyperbolic geometry and it suggested designing transportation networks. When I asked how so, the explanation was that subway lines could make sharper turns in hyperbolic geometry.
You’re adding another dimension. Sort of a “half” dimension. If you want a distance function in a space that’s non-Euclidean, you’re likely (always?) going to have something you can represent as hyperbolic geometry. Check out metric spaces and measures on Wikipedia.
For a “vibes” intro, The Hyperbolic Geometry of DMT experiences has a good intro in the beginning. https://youtu.be/loCBvaj4eSg
I’m no expert on hyperbolic geometry. These things just helped me “get it” in the sense of “I get why that’s a thing”. Also, seeing it for yourself doesn’t hurt.
For a “vibes” intro, The Hyperbolic Geometry of DMT experiences has a good intro in the beginning. https://youtu.be/loCBvaj4eSg
I’m no expert on hyperbolic geometry. These things just helped me “get it” in the sense of “I get why that’s a thing”. Also, seeing it for yourself doesn’t hurt.
Hyperbolic plane has tree-like structure. If you tried to draw a binary tree of depth 10 on Euclidean paper, you would run out of space. In hyperbolic plane, the straight lines are diverging and new space is created exponentially (very roughly speaking), so such a tree would fit perfectly. This makes hyperbolic embeddings better than Euclidean ones for all kinds of hierarchical data. I would also like to mention that while the uses in machine learning get lots of hype, the ML researchers seem to not be aware of the earlier impressive results on hyperbolic embeddings obtained in other communities (social network analysis/algorithms).
If you want to get intuitions about how this tree-like structure works, it is the best to play HyperRogue. For formal math, I guess it is the best to read the relevant papers.
(I guess the hierarchical structure of transportation networks, from hub airports -> ordinary airports -> major roads -> minor roads, could be interpreted as hyperbolic geometry, in the same way as Internet has hyperbolic geometry. A very liberal and abstract interpretation though. I do not see how making sharper turns makes sense.)
If you want to get intuitions about how this tree-like structure works, it is the best to play HyperRogue. For formal math, I guess it is the best to read the relevant papers.
(I guess the hierarchical structure of transportation networks, from hub airports -> ordinary airports -> major roads -> minor roads, could be interpreted as hyperbolic geometry, in the same way as Internet has hyperbolic geometry. A very liberal and abstract interpretation though. I do not see how making sharper turns makes sense.)
Because parallel lines in hyperbolic geometries diverge, shouldn't distant objects become larger in a way that counter-balances the hyperbolic effect of shrinking perspective? In other words, shouldn't hyperbolic geometries look just like euclidean geometries?
If you have some static scene in Euclidean geometry, you can possibly also have a static scene in hyperbolic geometry which looks the same*. But the parallax effects when you move would be different, and also that hyperbolic scene likely would not be natural for hyperbolic geometry (as you say, you would have to make the distant objects larger; if you approach them, you learn that they are in fact large, while the objects close to your original POV are tiny).
* depending on what you mean by "looks the same". How do you perceive depth? In a natural model of depth perception based on binocular vision or parallax, the hyperbolic space looks like a bounded ellipsoid (more precisely, stretched Beltrami-Klein model), so it could not look like an infinite Euclidean scene.
* depending on what you mean by "looks the same". How do you perceive depth? In a natural model of depth perception based on binocular vision or parallax, the hyperbolic space looks like a bounded ellipsoid (more precisely, stretched Beltrami-Klein model), so it could not look like an infinite Euclidean scene.
Speaking of Hyperrogue, if someone has gotten really into this game, I’d love to hear about it, and what made them stay. To me it’s always seemed like a smart persons tech demo - but I could be persuaded to put serious time into it, if it’s worth it.
HyperRouge! i've got it on my phone!
I put 2014 on this because of https://web.archive.org/web/20141214000216/http://roguetempl... but it looks like most of the content wasn't there yet. Anybody want to figure out a better year?
Looks like the current version with the really deep dive is from somewhere between 2020-2021 based on manually clicking through archive.org.
2020 would probably be more a appropriate tag?
2020 would probably be more a appropriate tag?
Hyperbolic space has a lot more space in it than flat space. The circumference of a circle grows linearly with the radius in flat space, but exponentially in hyperbolic space. There's a huge amount of room even just a short distance away from some given point.
HyperRogue is based around this property; one wanders the tiles of the hyperbolic plane in arbitrary directions, visiting various biomes with their own mechanics. Switching biomes is as simple as walking in an arbitrary direction until you see a biome wall, but at the same time every biome is endless in all* directions. This wouldn't actually fit in a Euclidean plane.
There's also some mechanics that make use of the properties of the space, like the very difficult late game puzzle of "walk 100 paces, then return to your starting point" or the tricky "find the center of this circle".
*pedant repelling asterisk