-
Notifications
You must be signed in to change notification settings - Fork 20
Theory
The world of Hypermine can be understood as hyperbolic 3-space with the order-4 dodecahedral honeycomb as the underlying honeycomb. The cells of this honeycomb are dodecahedra whose sides have a dihedral angle of 90 degrees, with the angles at each vertex within a side also being 90 degrees. There are four dodecahedra around each edge and eight dodecahedra around each vertex. The centre of each dodecahedron is called a node. Every dodecahedral cell of hyperbolic 3-space can be represented as a path from an origin node to that cell's node.
The dual of this honeycomb is the order-5 cubic honeycomb, and the cells of the dual honeycomb make up the chunks of the Hypermine world.
This diagram depicts a single dodecahedral cell. A dodecahedron can be carved up into twenty subcubes corresponding to each of its vertices (four are outlined in the picture). Consider the eight dodecahedra around a single dodecahedron vertex and perform the carving for each. The eight subcubes around that dodecahedron vertex make up a chunk. Each cube vertex is a different node. There is always one unique cube vertex that represents the node closest to the origin node.
Dodecahedron
- Angles
- Dihedral angle is Pi/2 radians or 90 degrees, as there are four dodecahedra around an edge.
- Angle at vertex of a face is Pi/2 radians or 90 degrees, as vertex figure is an octahedron.
- Solid angle subtended at vertex is Pi/2 steradians or 1/8 of a sphere's area, as there are eight dodecahedra around a vertex.
- Measures
- (Edge length in absolute units)
- (Face area in multiples of ideal triangle's area)
- (Volume in multiples of ideal tetrahedron's volume)
- (Distance from face midpoint to dodecahedron centre in absolute units)
- (Distance from edge midpoint to dodecahedron centre in absolute units)
- (Distance from vertex to dodecahedron centre in absolute units)
- Counts
- 12 face-neighbours
- 30 edge-neighbours (1 for each edge)
- 20 vertex-neighbours (1 for each vertex)
Cube
- Angles
- Dihedral angle is 2Pi/5 radians or 72 degrees, as there are five cubes around an edge.
- Angle at vertex of a face is 2*arcsin(1/sqrt(phi^2 + 1)) radians or about 63.435 degrees (source), as vertex figure is an icosahedron.
- Solid angle subtended at vertex is Pi/5 steradians or 1/20 of a sphere's area, as there are twenty cubes around a vertex.
- Measures
- (Edge length in absolute units)
- (Face area in multiples of ideal triangle's area)
- (Volume in multiples of ideal tetrahedron's volume)
- (Distance from face midpoint to cube centre in absolute units)
- (Distance from edge midpoint to cube centre in absolute units)
- (Distance from vertex to cube centre in absolute units)
- Counts
- 6 face-neighbours
- 24 edge-neighbours (2 for each edge)
- 80 vertex-neighbours (10 for each vertex)
Hypermine internally uses a Cayley graph of the 12-generator reflection group G whose fundamental domains form the order-4 dodecahedral honeycomb. Cayley graphs represent the structure of groups. Nodes in the Cayley graph are elements of the group, and given a set of generators for the group, a link exists between two graph element if one graph element can be reached from the other by applying a single one of the generators. In the context of Hypermine, the group in question is the group generated by reflections across the sides of a fixed right-angled dodecahedron (the root dodecahedron). The group elements (thus also the graph nodes) correspond to the dodecahedral cells in the order-4 honeycomb, and two nodes are linked if and only if their corresponding dodecahedra share a side.
In the aforementioned reflection group G, each dodecahedron in the cell is mapped to the root dodecahedron by exactly one group element, thus there is a canonical relation between the faces of each dodecahedron and the face of the root dodecahedron. This means that the faces of each dodecahedron can be labelled with faces of the root dodecahedron. If two dodecahedra share a face, then this face is labelled the same in both dodecahedra. Hence the 2-dimensional faces of the entire dodecahedral honeycomb get a consistent labelling using 12 labels.
For each label, the set of all faces with that label form a union of disjoint hyperbolic planes.
At each edge in the dodecahedral honeycomb, faces with two different labels coincide, so edges can be labelled using pairs of face labels. Similarly, vertices can be labelled using triples of face labels. Since faces, edges and vertices in the order-4 dodecahedral honeycomb correspond to edges, faces and cubes in the order-5 cubic honeycomb, we can transfer these labels to the cubic honeycomb.
(Why is this desirable? Easy to query neighbours of a node, easy to apply procedural generation, etc. Expand on this.)
If the set of generators is represented as an alphabet of characters, then the origin node may be represented as an empty string of characters and nodes reachable from the origin via a sequence of group operations may be represented by sequences of characters---strings. The cost of storing a node's information is then linear in the distance of the node to the origin node. By applying simplification rules to strings, a set of strings corresponding to the same node relative to the origin can be mapped to the same string. This ensures that there are never two paths to the same node from the origin node, yielding a spanning tree of the Cayley graph.
Choosing the correct simplification rules is a difficult task. There is an algorithm called the Knuth-Bendix algorithm that can sometimes turn a complete list of equivalence rules into a set of simplification rules.
One possible (currently not implemented) set of simplification rules that could apply to such strings in Hypermine, with dodecahedral nodes, is as follows:
- Each generator (or dodecahedron face) has a priority relative to other generators. Which generator has priority over other generators does not matter.
- All simplified strings with a given prefix define a region of Hyperbolic space bounded by up to 6 grid-aligned planes. These regions are designed to fill the rest of the space without overlap. Crossing any of these planes is not allowed when extending a simplified node string.
- Adding a generator to the end of a simplified node string adds further restrictions to the region.
- The plane corresponding to the generator is added as a boundary to prevent backtracking.
- The plane corresponding to higher-priority faces adjacent to the generator is also added as a boundary, as crossing that boundary would otherwise result in an overlap with a higher-priority node string of the same length.
- To create a simplified node string from scratch, start with an empty string and build up a simplified string by appending a generator one at a time in a special way to keep the string simple.
- To append a generator
x
to a stringS
, use the following procedure:- Look at the longest substring at the end of
S
such that all characters are equal to or face-adjacent tox
. Call thisS1
. If the last generator inS
is not adjacent tox
,S1
is empty. - If
x
is inS1
, it will cancel out with thex
you are trying to append, and both should be removed. - Otherwise, insert
x
right before the earliest lower-priority generator inS1
. If all generators inS1
have higher priority, including ifS1
is empty, addx
to the end ofS
.
- Look at the longest substring at the end of
- It is potentially possible to modify this algorithm to create more symmetric node trees by adding all faces, edges, and vertices of a dodecahedron as generators, where the entire plane of every face of the dodecahedron forms a wall subdividing H3 into 1+12+30+20 regions, but the algorithm would need to be adjusted.
- This algorithm only works with tilings that have vertices meeting at right angles, which is the case for Hypermine but would likely need to be heavily modified to work with other tilings.
Regardless of the geometry, physics tell us that the illuminace an object provides at a distance d is the luminosity of the object divided the area of the surface formed by all points distance d from the object.
In other words, how good a lamp is would be at lighting you up is how bright the lamp is, times how big the lamp looks.
Light emanating from an object becomes exponentially dimmer as the distance from the object grows linearly, making sun-like illumination difficult. Unlike in Euclidean space, a disk would appear grow or shrink in size as the player moved towards or away from it. Additionally, traveling across the ground will cause the ideal point/disc to dip down into the horizion.
A uniformly luminous equidistant surface above a hyperbolic plane could, in theory, give the impression of a patch of light that stays above the player's head. (Or would it? Regions of the canopy further away would be exponentially dimmer, but the area they would take up in the field of view would be exponentially smaller. A constant solid angle in the field of view would contain exponentially more canopy area as the canopy moved further away, exactly cancelling out the exponential dimming of a given area of canopy. Euclidean space is the same, except with quadratic dimming instead of exponential. See this discussion of illuminance and luminance.)
If the canopy only shone light within a few degrees of the normal, a distinct sun-like impression would be formed. However, the "sun" would still appear to grow exponentially as the player's elevation increased like the ideal disc method.
Used for generating large-scale structures by restricting the state a node may be in based on the states of its neighbouring nodes.
A state machine for generating half-spaces of solid ground in empty sky: