Fractal Coordinates For Incremental Procedural Content Generation
Fractal Coordinates For Incremental Procedural Content Generation
Generation
Peter Mawhorter
pmawhort@wellesley.edu
Wellesley College
Wellesley, Massachusetts, USA
Figure 1: Left: a section from an infinite grid-filling path. Right: a section from an infinite maze that includes cycles at multiple
scales.
ABSTRACT of one another in any order and will always fit together in the end.
Incremental procedural content generation (IPCG) has been used Noise functions such as simplex noise are a very popular building
in games such as Minecraft to provide a unique flavor of gameplay, block for IPCG systems, because they support this property, but
but requires that parts of the world can be generated independently noise functions alone have their limitations, one of which being
an inability to create non-local structures or continuity. To combat
this, noise functions are usually applied at several scales to provide
fractal continuity and recognizable features similar to real world
This work is licensed under a Creative Commons Attribution-Share Alike geography’s fractal complexity. This paper describes a system of
International 4.0 License. fractal coordinates suitable for use with IPCG that generalize this
idea of multiple layers of structure at different scales, and demon-
FDG’21, August 3–6, 2021, Montreal, QC, Canada
© 2021 Copyright held by the owner/author(s). strates how it can be used to achieve some interesting effects.
ACM ISBN 978-1-4503-8422-3/21/08.
https://doi.org/10.1145/3472538.3472576
FDG’21, August 3–6, 2021, Montreal, QC, Canada Peter Mawhorter
corner of each h/(0, 0) tile at 0/(0, 0) at all heights h. To avoid this, 3 EXAMPLE APPLICATIONS
we can align the center of each h/(0, 0) tile with the h − 1/(0, 0) Figure 3 shows one example application of fractal coordinates, and
origin tile below it, as shown in Fig. 2 (picking alternating centers at it’s actually a relatively simple one. Before diving into the details,
different heights if the scale factor is even). This alignment strategy some general notes about PCG using fractal coordinates:
provides a useful property: for any tile 0/(x, y) in the base grid,
there is a unique origin height ho at which the origin tile ho /(0, 0) • Because fractal coordinates identify arbitrarily-sized tiles,
contains that base tile as a strict sub-region (the strict part means which are made up of smaller cells that are also tiles (ex-
that for origin tiles themselves, their origin height is one larger than cept at height 0), using some kind of grid-based generation
their actual height). Furthermore, the origin height of any base- technique is reasonable.
level tile scales as the logarithm of the tile’s maximum coordinate • Since tiles at all height values occupy the same space, what-
value (either x or y), with the base of the logarithm being the scale ever is generated at each level needs to synch up with things
factor of the fractal coordinate system. above and below it. This can get tricky, but it’s also how the
system gets its power to enforce complex constraints.
• Because every cell in the base grid is part of an origin cell
2.1 Fractal Trace Coordinates at some height, the following procedure can be used to pass
In addition to the h/(x, y) notation for specifying a fractal tile, there information between tiles at different scales without infinite
is an over-specific notation which is useful for identifying tiles. regression:
Although this alternate notation is completely optional and takes (1) Without any information input, start by generating the
up more space than the equivalent basic coordinates, it has some height-zero origin tile, which has no origin tile below it.
useful properties which might make it appealing in some situations. (2) For higher origin tiles, use information from the origin
These "trace coordinates" consist of the origin height ho followed tile below to constrain the results of the parent.
by a variable-length list of numbers specifying a series of sub-tiles (3) When generating non-origin tiles, first generate their par-
to access to find the specified tile. Each number in this trace is ent tile, and use information from the parent tile to con-
between 0 and S 2 − 1 where S is the scale factor for the fractal strain the results in the child tile.
coordinate system, and identifies a sub-tile in bottom-to-top, left-to- These three rules give us a recursive means of generating
right order, so that given within=tile coordinates (t x , ty ), the trace information for any tile that can be related to information for
number nt = Sty + t x . As a concrete example, the tile 1/(−1, −1) tiles above or below it, and the total number of tiles whose
in the fractal coordinate system with scale 4 has trace coordinates generation is required (i.e., all parents until one is an origin
2/[5]: it can be found by going up to the origin tile 2/(0, 0) and tile, and then all children at the origin down to height 0) will
then descending into the sub-tile at (t x , ty ) = (1, 1) within that tile. scale as the logarithm of the distance from the origin.
Similarly, the tile 0/(2, 3) in scale 4 would have trace coordinates • In many ways, it’s convenient to think of the generation
2/[14, 3], whereas the tile 0/(2, 2) has trace coordinates 1/[15]. procedures for a fractal coordinate space as a recursive func-
Trace coordinates are useful because it is very easy to identify tion, and to think about properties you want to guarantee
the parent (and all ancestors) of a given tile: simply remove the last as being assured via induction. Based on the rules above,
element of the trace portion of the coordinates, or if there’s only the height-0 origin tile (at 0/(0, 0)) is the base case, while
one element in the trace, increase the origin height by 1 and then generation for all other tiles recurses to a case for either a
figure out the new origin trace location. Similarly, trace coordinates parent tile or a child tile.
make it easy to identify all children of a given tile: they’re the tiles • The time/memory tradeoffs involved should in most cases
(S 2 in total) with trace coordinates identical to the parent except make it worthwhile to use memoization to cache generated
for a single extra entry at the end of the trace. When processing re- tile information, and the algorithms presented here all do so.
cursive constraints, trace coordinates also make it very clear which As with most incremental PCG systems, we rely on limita-
sequence of parent tiles’ constraints might need to be considered tions on the player’s speed of exploration to manage cache
at this level. Of course, trace coordinates have drawbacks too: they sizes for generated information.
require a number of trace entries that scales with the logarithm of
a tile’s distance from the origin, and they make it more difficult to 3.1 Effervescent: Fractal/Cyclic Indefinite Mazes
figure out the coordinates of neighboring tiles at the same height. The Effervescent system which generated the maze shown in Fig.
Note that in theory, a nonstandard trace coordinate could use a 3 treats each cell in each tile as a cell in a maze which may or
height higher than a tile’s ho origin height as the height value and may not be connected in any of the four cardinal directions. A
add additional trace entries that specify origin tiles at the beginning demo can be found online at: (the code is open-source but is not
of a trace. organized into a library for convenient use). The demo displays
Although the definition of a fractal coordinate system given here paths such as those shown in the teaser figure, which it generates
is complete, it is not immediately apparent what the usefulness of on-the-fly, and it allows automatic or manual panning and zooming
such coordinate systems is for IPCG. The next section includes two to explore the generated pattern. The generation system ensures
concrete examples of how such coordinate systems can be used that any cell which has an outgoing direction in one direction will
to create interesting incrementally-generatable domains, and the have a corresponding incoming connection from that neighbor in
related work section makes further connections and suggestions the opposite direction, although the data structure does support
for possible applications. non-reciprocated connections. Accordingly, for each cell in a tile,
FDG’21, August 3–6, 2021, Montreal, QC, Canada Peter Mawhorter
h=2
y=0
h=1 x=0
origin tiles h/(0, 0)
the information generated is four boolean values for whether that determine connectivity for their internal edges, and the internal
tile connects to the neighbor in each cardinal direction. Effervescent edges of parent tiles are always external edges for their children.
uses the following rules: Note also that this is why our coordinate system does not simply
(1) For all tiles, we start with fully-connected O shape, where use the base grid’s origin (0, 0) as the southwest corner of the origin
each cell connects with two neighbors to form a ring (actually cell at every height, but instead centers origin cells within each
a square) out of the tile (each tile is 2×2). other: if we had aligned all origins to share a southwest cell at (0,
(2) With some random probability per-tile, we cut one edge of 0), the edge from (0, 0) to (0, -1) would not be an internal edge at
that O shape to form a U shape in some random rotation. any any height.
Note that cutting one edge retains traversibility. Given these rules, to figure out whether an individual edge in
(3) For each connection in the tile, the edge that the connection the base grid is connected or not, we first generate the unique tile
for which that edge is (part of) an internal edge. In the worst case,
spans is made up of 2h edges in the base-level grid. We pick
the height of that tile will be the O(log ho ), where ho is the larger
just one of those edges at random to actually realize the
origin height of the cells on either side of the edge we’re interested
connection, and store that choice with the tile info.
in. Having identified the tile where that edge is internal, we look
Note that in this setup, there are no constraints which have to up (or generate) tile info for that tile based on the rules above and
be respected between parent and child tiles, because child tiles only
Fractal Coordinates for Incremental PCG FDG’21, August 3–6, 2021, Montreal, QC, Canada
h=2 y=0
x=0
h=1 Five possible paerns:
check if that internal edge is connected, and if so whether that generates some ancestor tiles for some other edges). The properties
connection is realized through the edge we’re interested in. of the maze we generate include:
With a procedure for finding out whether a given base-grid edge
is connected, to draw the maze we simply check our viewport and
ask whether each edge in that viewport is connected, drawing those • Every cell in the grid is reachable from any other cell. This is
that are (caching keeps this process reasonable). Of course, as the true by induction: at the tile level, we only generate O and U
area of interest gets further and further from the origin, we end shapes, so there’s always a path between any two sub-tiles.
up having to generate higher and higher origin tiles to include the Those sub-tiles have the same property, so we’ll never get
area we’re looking at, and the total number of ancestors we need to stuck inside of them.
generate increases as the logarithm of our distance from the origin. • By controlling the probability of creating U or O shapes (and
However, given this caveat, the algorithm is fully incremental: we conditioning that on tile height) we can have some control
can ask it to generate edge at any point in the 2D grid, and it can do over how often we expect exploration processes to circle
so independently of generating edges elsewhere (except in that it back and re-encounter a previously visited location. Distinct
sub-areas are cut off from one another by narrow single
connections, and this happens fractally at multiple scales.
FDG’21, August 3–6, 2021, Montreal, QC, Canada Peter Mawhorter
Although Effervescent takes advantage of fractal coordinates • Based on 5 × 5 tiles, for a complete traversal to be possible,
to both guarantee complete reachability and to create its fractal the path must enter at positions 1, 3, or 5 along an edge:
structure that includes both cycles and dense/sparse connectivity entering a positions 2 or 4 makes it impossible to traverse
contrasts, it notably does not have any dependencies between par- every cell in the tile.
ent and child layers. Generation at each layer is a simple matter • Positions 1 and 5 of an edge overlap with positions 1 and/or
of randomly picking an O or U shape, and of determining exactly 5 of two other edges (e.g., position 1 on the north edge count-
where high-level edge connections are realized, and both processes ing from the west is the same cell as position 1 on the west
can be competed in isolation without any additional constraints. In edge counting from the north). Since you cannot both en-
contrast, the next example application we will explore makes heavy ter and exit from the same cell, this means that we can’t
use of such constraints, but achieves much more elusive special independently choose entry/exit points for each edge like
properties as a result. Effervescent did, although it’s notable that if we enter at
position 3, no matter which edge we exit from (as long as
it’s a different edge than the one we entered on) there are
3.2 Labyrinfinite: An Indefinite Labyrinth
solutions which exit at every possible position on that edge.
To demonstrate the power of recursive constraints in a fractal coor-
dinate system, the Labyrinfinite system generates a Hamiltonian How does Labyrinfinite actually enforce the recursive properties
path through the infinite graph that connects all points on a 2D detailed above? It starts by using the same system of recursion
integer grid with their orthogonal neighbors to form an infinite described above: each tile waits to be generated until its parent has
square grid. In other words: it generates an infinite path that twists been generated, and uses information in the parent to make sure
and turns, but never branches or crosses itself (an infinite labyrinth), the rules above will be respected. Of course, this can’t apply to all
which eventually visits every point on an infinite square grid. It also tiles, as there would be no base case, so origin tiles are generated
generates this path incrementally: you can ask for any part of the differently: They rely on information from the origin tile below
path and it will give it to you without generating the rest of the path them (which is generated first) instead of relying on information
(although technically, it does generate some necessary constraints from their parent. The base case is the origin tile at height 0, which
on the rest of the path in the process). In fact, these paths also form is generated without any reliance on outside information. The three
a family of space-filling curves [5, 18] which incorporate a natural generation cases break down like this:
level of visual variety.
Figure 4 shows the result, and includes a diagram showing how (1) For the origin tile at height 0, we choose random entrance
information in higher and lower tiles is connected. A demo can and exit edges and random entrance and exit positions on
be viewed online at: (again, the code is open-source but not pack- those edges. Then we pick a pattern from our pattern library
aged/polished for distribution). The demo displays paths such as that has entrances/exits on the appropriate edges at the ap-
those shown in the teaser figure, which it generates on-the-fly, and propriate positions, and that becomes the traversal pattern
it allows automatic or manual panning and zooming to explore the for the height-0 origin tile.
generated pattern. The same dependency strategy mentioned at the (2) For origin tiles above height 0, they will only be generated
start of this section is at play here: origin tiles generate based on once the origin tile below them has been. Therefore, they
the tiles below them, while all other tiles generate based on their know both the entry/exit edges and entry/exit positions on
parent tiles. those edges for the origin tile that lies at their center. These
How does Labyrinfinite work? In terms of basic principles, it sets higher-level origin tiles first filter the pattern library to in-
up the following fractal structure: clude only patterns whose central tile is entered and exited
(1) Each 5 × 5 region is traversed by a path that enters at one from the edges dictated by the origin tile below them, so the
edge and exits at another, randomly chosen from all possi- random choices made there become constraints at the level
ble 5 × 5 paths which enter and exit at those coordinates above. There are no entry/exit choices at the lower level that
(taking advantage of symmetries, there are less than two have zero corresponding patterns in the pattern library, since
thousand such paths, and we simply store all of them in a the pattern library contains all possible traversals of a 5 × 5
cache indexable by entry/exit points). grid. After filtering the pattern library, the higher-level ori-
(2) Each of those 5 × 5 regions is actually a single cell in a larger gin tile picks a pattern at random, thus determining both the
path, and the sides on which the smaller path enters and edges and edge positions at which the path must enter/exit
exits its region match up with the connectivity of that cell that tile. Two problems remain: constraints imposed by en-
in the larger path. try/exit positions of sub-tiles yet-to-be-generated within this
(3) At the smaller level, the precise entrance and exit positions tile, and constraints on entry/exit positions of lower-level
at which each traversal starts and ends are coordinated with tiles at the borders of this tile. To ensure that when the path
their neighbors, so that neighbors actually do connect with leaves this tile it will enter the next tile at the same loca-
each other. tion (regardless of the height of this tile), we pick random
(4) These three properties are recursive, so that there is an infi- edge positions (1, 3 or 5) to impose as a constraint on both
nite succession of even-larger layers that also enforce them. of our child tiles that are at our edges. We do this using a
seed based on the position and span of that edge in the base
Some important points to consider: grid, so that the tile on the other side of that edge will be
Fractal Coordinates for Incremental PCG FDG’21, August 3–6, 2021, Montreal, QC, Canada
Labyrinfinite Path
scale factor: 5 Result:
h=1
ousands of paerns:
…
→ →
Figure 4: A fractal path created using a 5 × 5 fractal coordinate system. The line visits every point in each 5 × 5 region before
moving on to the next, and the same is true fractally (e.g., for 25 × 25 regions). The result (top right) is actually constrained by
multiple layers (two shown at left).
able to follow the same process and pick a matching ran- each step, we simply find a cell which has one edge that’s
dom entry/exit position to constrain its sub-tile. To ensure already decided but another edge that’s not, and pick and
that there are no long-term dependency issues within this random entry/exit position for that other edge, among the
tile, where entry/exit position (not edge) constraints conflict positions which are compatible with the existing constraint.
with one another, we constrain the entry/exit positions for Because of the position-3 restrictions we made before this
the other end of the cells where edge constraints exist so filling-in process, the filing-in process will never meet a con-
far (our entrance and exit cells and our central cell) to be tradiction, and does not need to back-track its decisions. At
position 3, which as we noted above then places no further this point, we finally have a full specification for the given
constraints on the entry/exit position paired with it. Since origin cell: a traversal pattern that dictates entry/exit edges
entry/exit edges are determined for each cell (i.e., sub-tile) by for each cell, and beyond that, specific entry/exit positions
the pattern we picked, we proceed to pick specific entry/exit for each cell. Furthermore, the entry/exit positions chosen at
positions for each of our cells, incrementally expanding them random by the origin cell below this one have been respected
from the three cells which already have constraints placed as constraints at this level.
on them: our entry cell, our exit cell, and our central cell. At
FDG’21, August 3–6, 2021, Montreal, QC, Canada Peter Mawhorter
(3) Finally, the procedure for generating any non-origin tile is 4 RELATION TO EXISTING IPCG
guaranteed to be able to access information from its par- TECHNIQUES
ent tile, because that parent tile is always generated before
As hinted at in the end of the previous section, fractal coordinate
it. Based on the algorithm for generating origin tiles, the
generation techniques which use the depend-on-parent-or-origin-
information available from parent tiles is:
child recursive structure outlined above require time and/or mem-
(a) The entrance and exit edges for each child tile (i.e., cell in
ory expenditures that grow as one gets farther from the origin, with
the parent).
formulae that are in O(logS d) where d is distance from the origin
(b) The entrance and exit positions for each child tile.
and S is the scale factor for the coordinate system. In contrast a
All the child tile has to do is filter the pattern library to
strictly incremental system would generate each piece of content
pick out a pattern which respects the constraints provided
completely independently of any other piece, and the time- and
by the tile above it; that pattern determines the entry/exit
memory-per-piece would be constant for all pieces irrespective of
edges for each of its children. Like the origin tiles, it sets
position. However, logarithms grow slowly, and even in "infinite"
the entry/exit positions for the tiles where the path enters
worlds, there are usually technical constraints on how far a player
and exits it based on seeded random decisions which will
can travel since coordinate systems run into issues when the limits
be matched by its neighbors, and then sets the entry/exit
of integer and/or floating point math are reached (e.g., the "Far
positions for the other end of those two tiles to be 3. Lastly,
Lands" in Minecraft [7]). Concretely, for example, the logarithm
it fills in entry/exit positions for all of the rest of its tiles
base 5 of 232 is only 13.782, so at the point where a generation
one at a time using random selection, just like the process
system would need to worry about integer overflow, a size-5 fractal
for the origin tile. This time, there are no pre-determined
coordinate system is still only generating a few dozen tiles to come
constraints on the central tile, and the same guarantee can
up with concrete results for height-0 tiles.
be made that greedy random selection of positions will work
Perlin’s original and simplex noise functions are a good point of
as long as we obey constraints within one cell at a time. Now
comparison [16, 17] (see [9] for a clear explanation of simplex noise).
the non-origin tile has selected entrance and exit edges and
These algorithms are hugely popular in IPCG systems because they
positions for each of its child tiles, and thus can fulfil its
are incremental and generate noise that has coherence on multiple
inductive bargain to provide that information to its children
scales. Similar to fractal coordinates, typical Perlin noise systems
in turn.
use multiple "octaves" of noise at different scales, and combine
them by simple addition or other operations to get a more complex
manifold for, e.g., terrain generation. In fact, from one angle Perlin
noise might be viewed as an application of fractal coordinates,
because multi-octave noise generates values at different scales and
combines them. The uses that this paper advocates however diverge
As detailed in the algorithm description above, except for the
from what Perlin noise does by using discrete grids instead of
height-0 origin tile, each tile when generated specifies the entrance
continuous mathematical functions, and by illustrating how hard
and exit edges and positions of all of its child tiles. Since that infor-
constraints can be passed back and forth between different fractal
mation is everything that the generation algorithm needs from a
layers, instead of relying on operations that preserve continuity
parent or child tile, the entire recursive system stands up, anchored
and generating layers independently.
by the simple random choices made in the base case for the height-
In general, the recursive scheme for satisfying fractal constraints
0 origin tile. Furthermore, the selection of entry/exit positions in
explored here could be applied in a number of ways that allow much
cells at tile edges can proceed without depending on a sibling-tile
more complex structures to emerge than in a strictly incremental
being generated first (which would be an infinite regress), because
system where generation of neighboring areas is truly independent.
seeding based on the edge’s absolute position and size on the base
Of course, many IPCG systems combine something like Perlin noise
grid allows both siblings to make complementary decision about
with local generative processes that use more traditional (often
which entry/exit position should be used. The end result is that
additive) techniques to build coherent structures with complex
given a number of generated tiles that scales as the logarithm base
organization (e.g., dungeon generation in Minecraft). This strategy
5 of the distance from the origin, a single tile anywhere can be
has several drawbacks that fractal coordinates could help address:
generated incrementally without needing to generate its siblings
or the full path from it to the origin, and yet we also have a recur-
sive guarantee that the entire path both travels everywhere and • Although individual complex structures like dungeons or
never branches or crosses itself. These two properties: incremental villages can be generated, the generation processes for each
generation and complex global dependence, are the true measure are unaware of each other and cannot share nay information,
of the power of fractal coordinates. Although they do cheat a lit- to keep the whole system incremental.
tle compared to strictly incremental algorithms by pre-generating • As a result, these landmarks must either be strictly sepa-
some amount of abstract higher-level context in order to gener- rated spatially, or allowed to interfere with each other in
ate a specific patch of the world, they only require logarithmic ways that can produce artifacts (e.g., Minecraft embraces
time/memory use as distance from the origin increases, and they this with things like dungeons allowed to intersect features
can achieve outcomes that might seem to only be possible with like ravines, which leads to interesting structures but also
truly detailed global coordination. issues like floating blocks that might be undesirable).
Fractal Coordinates for Incremental PCG FDG’21, August 3–6, 2021, Montreal, QC, Canada
• The fixed-area generation systems for complex structures neighboring tiles. Although there is not space here to fully flesh
are not themselves incremental, and thus these structures out this approach, [10] does provide a good example of some of the
have limited size and complexity, since they need to gen- seam issues in incremental generation, and fractal coordinates offer
erate as the player approaches them, but if that generation one possible path towards dealing with them.
process takes too much time it will cause lag for the player. Fractal coordinates and even the specific recursive constraint
Alternatively, a fixed number of such structures could be propagation strategy outlined here are more of a general approach
generated when the world is generated to front-load the than a specific generation algorithm, and the goal of this manu-
required generation time and also guarantee the player’s script is to help those interested in incremental PCG systems to
ability to find them (see e.g., [1]). However, this approach understand their benefits and limitations. As the next section ex-
abandons incrementality, and therefore limits world scale plores in detail, there are lots of potential connections to existing
(which could be relevant in, e.g., a massively-multiplayer techniques that could be adapted to fractal coordinate spaces. The
game like Noctis [6] or Elite: Dangerous [4]). core insights offered here are the center-based origin determina-
tion for fractal tiles at successive heights which prevents infinite
Fractal coordinates could address the issues above by providing regress because every edge becomes internal to a specific tile at
a means for coordinated generation between nearby structures some height, and the recursive strategy for constraint propagation
(it’s a partial and principled retreat from strict incrementality). between tiles which allows all non-origin tiles to rely on their par-
Furthermore, the information available in fractal coordinate tiles ent being already generated, while origin tiles rely on a central
makes it possible to distribute generated content (e.g., strongholds child being generated, with the height-0 origin as the base case.
in Minecraft) with strict regional constraints on frequency (e.g., roll
for a small # within a larger region and distribute them among child
tiles recursively), while at the same time allowing a game system to
5 RELATED WORK AND POTENTIAL
efficiently locate the nearest such content to the player in order to CONNECTIONS
provide hints or direct AI actions, while retaining the core benefits There are lots of research avenues that are related to this work,
of incremental generation. and even more with potential future synergy. The main inspiration
A concrete example of these difficulties comes up in [10], in for this generation strategy was taken from noise functions like
which cellular automata are used to generate caves, and separate Perlin noise [16] and Worley noise [25] (a survey can be found at
sections of an infinite grid are generated one-by-one to provide [12]). Their incremental properties made possible games like Noctis
an indefinite gameplay experience. A limitation of this system is [6] and Minecraft [14], which is also the genre to which the tech-
that in order to avoid harsh seams, and to ensure full traversibility, niques in this paper are most applicable. The unique constraints
50×50 tiles are generated in batches of 5, including a central tile of incremental world generation in particular make it a difficult
plus its four neighboring tiles. After running a specific number of setting in which to apply many existing PCG techniques, and it
automaton steps on all 5 tiles, connectivity is checked from the poses unique challenges for PCG systems based on search, evolu-
central tile to its neighbors, and open paths are added if this check tionary algorithms, and other AI or machine-learning strategies
fails, after which extra cellular automaton iterations are performed that for various reasons require the ability to compare concrete
to smooth things out. The difficulty is that these extra steps may generation results (see e.g., [20, 21]). While such systems can be
have to be repeated when one of the four adjacent tiles has its turn applied to individual world chunks, they themselves don’t deal
to be fully generated, finds a neighbor that it isn’t connected to, with the problem of information sharing detailed above which frac-
and thus has to be re-smoothed. Since this re-smoothing cannot tal coordinates helps tackle directly. However, non-incremental
extend to the base tile (which would create an infinite regress), it maze-generation systems like [24] and [13] are closely related to
may create some seam artifacts as the number of automaton steps this work. [24] in particular includes the idea of stitching multiple
of the base and adjacent tiles get out of sync. This fix-up approach graph segments together, and one could imagine applying the same
may also result in ordering effects, where the final appearance of a minimum-spanning-tree technique over a fractal graph with poten-
tile depends on which adjacent tiles were generated in what order, tially pleasing results; there might even be a way to modify it to
and thus the terrain generated depends on how the player moves work incrementally. Similarly, [13] also incorporate space-filling
through the map; such ordering effects can cause additional seam- curves into their work; interestingly they go to great lengths to
ing issues if the player moves on a path which moves away from overcome the regularity that the use of a Hilbert curve introduces
an explored area and then reconnects with it. Fractal coordinates into their maps while recognizing that the connectivity it ensures
could help resolve these issues by establishing a larger multi-tile is desirable; Labyrinfinite’s randomized space-filling curve would
context in which to coordinate edge connectivity and smoothing. seem a useful substitute in their system. Macedo and Chaimowicz’
For example in a 4×4 fractal coordinate system, each tile could be work also incorporates cellular automata (CA) as did the previ-
provided with pre-determined edges by its parent tile, could run ously mentioned work of Johnson, Yannakakis, and Togelius ([10]),
automata rules on the edge regions of its internal edges to be able to hinting at a rich area of future work in incremental CA systems.
provide the same to its child tiles, and could then delegate full gen- There are also threads of related work in mathematics (e.g., [5,
eration of the child tiles with the constraint that the pre-determined 15]), and physics (e.g., [15]) although this work does not directly
edges should not change. Any required connectivity rules could apply any recent ideas from those fields. In particular, the discrete
be satisfied by these pre-determined edge regions plus operations fractal coordinates presented here are far less complex than the
which only affect the interior of a tile, without the need to modify notion of fractal coordinates present in [15]. More connections
FDG’21, August 3–6, 2021, Montreal, QC, Canada Peter Mawhorter
likely remain to be made in these areas however by specialists who time/memory overhead has potential to create new possibilities in
have overlapping expertise. indefinite generated worlds such as that of Minecraft.
In terms of future work, there are some avenues of research
that seem promising. In addition to adapting many existing algo- ACKNOWLEDGMENTS
rithms that work with fixed-size grids to work on fractal grids (e.g., This work was done on the traditional land of the Massachusett,
[23]) and investigating how constraint propagation between frac- Wampanoag, and Nipmuck peoples, and the author is grateful for
tal layers could add interesting effects, the recently popular Wave their stewardship of that land in the past, in the present, and in the
Function Collapse (WFC) algorithm [8] seems like a prime target future, despite its present circumstances.
for adaptation to a fractal grid. As detailed in [11], the core of WFC
is constraint satisfaction, and the recursive constraint chaining REFERENCES
strategy proposed here for fractal grids offers a way to propagate [1] Anonymous, Ajc 1254, et al. 2021. Minecraft Wiki: Stronghold. https://minecraft.
constraints efficiently between tiles at different level of the grid. At gamepedia.com/Stronghold.
[2] AntVenom. 2021. MAXIMUM FILE-SIZE for a FULL MINECRAFT WORLD?!
the same time, one of the limitations of WFC is the scaling of the https://www.youtube.com/watch?v=ZmfopT9Vupo.
algorithm to large grids, along with in some cases the increasing [3] Tommy Bacher. 2018. Procedural Level Generation Algorithms. http://www.
chances and costs of forced restarts at larger grid sizes. Although jthomasbacher.com/bacherJuniorISWriting.pdf. Independent Study Project
Report.
problems with between-tile compatibility might be highly domain- [4] Frontier Developments Ltd. 2014. Elite: Dangerous. Frontier Developments Ltd..
specific which might limit the generality of a fractal approach, the PC Edition.
[5] HIROSHI Fukuda, MICHIO Shimizu, and GISAKU Nakamura. 2001. New Gosper
use of fractal coordinates for WFC seems like a natural area for space filling curves. In Proceedings of the International Conference on Computer
future work. Graphics and Imaging (CGIM2001), Vol. 34. 38.
Another overlap is with space partition algorithms, whose use [6] Alessandro Ghignola. 2000. Noctis. Home Sweet Pixel. PC.
[7] GmMkr11260, Jonnay23, Tjb0607, et al. 2021. Minecraft Wiki: Java Edition Far
dates all the way back to Rogue in 1980 [22]. Good summaries of Lands. https://minecraft.gamepedia.com/Java_Edition_Far_Lands.
several algorithms can be found in [3, 19], including variable-size [8] Maxim Gumin. 2016. WaveFunctionCollapse. https://github.com/mxgmn/
partition schemes like random binary space partitioning. Since frac- WaveFunctionCollapse. GitHub Repository.
[9] Stefan Gustavson. 2005. Simplex noise demystified. Technical Report. Linköping
tal coordinates can be used as a kind of space partition, it would University, Linköping, Sweden. http://webstaff.itn.liu.se/~stegu/simplexnoise/
be interesting to investigate potential applications of variable-size simplexnoise.pdf
[10] Lawrence Johnson, Georgios N. Yannakakis, and Julian Togelius. 2010. Cellular
fractal coordinate systems, although this would obviously compli- Automata for Real-Time Generation of Infinite Cave Levels. In Proceedings of the
cate several key coordinate transformation functions (e.g., finding 2010 Workshop on Procedural Content Generation in Games (Monterey, California)
the parent of a tile). (PCGames ’10). Association for Computing Machinery, New York, NY, USA,
Article 10, 4 pages. https://doi.org/10.1145/1814256.1814266
[11] Isaac Karth and Adam M Smith. 2017. WaveFunctionCollapse is Constraint
Solving in the Wild. In Proceedings of the 12th International Conference on the
6 CONCLUSION Foundations of Digital Games. 1–10.
[12] Ares Lagae, Sylvain Lefebvre, Rob Cook, Tony DeRose, George Drettakis, David S
The examples presented here demonstrate the interesting forms Ebert, John P Lewis, Ken Perlin, and Matthias Zwicker. 2010. A survey of proce-
that the use of fractal coordinates can produce, but they barely dural noise functions. Computer Graphics Forum 29, 8 (2010), 2579–2600.
[13] Yuri PA Macedo and Luiz Chaimowicz. 2017. Improving procedural 2D map
scratch the surface of its potential applications. As mentioned in Generation based on multi-layered cellular automata and Hilbert curves. In
the previous section, there would seem to be fertile ground for 2017 16th Brazilian Symposium on Computer Games and Digital Entertainment
combining fractal coordinates with at least a few different exist- (SBGames). IEEE, 116–125.
[14] Mojang. 2009. Minecraft. Mojang. PC; full version released 2011.
ing algorithms, and of course more concrete generative systems [15] Laurent Nottale. 2011. Scale Relativity And Fractal Space-Time: A New Approach
along the lines of those presented as examples here could push to Unifying Relativity and Quantum Mechanics. Imperial College Press, London,
fractal coordinates further. The combination of an ability to pro- England.
[16] Ken Perlin. 1985. An image synthesizer. ACM Siggraph Computer Graphics 19, 3
vide global and multi-scale strong constraints while also being an (1985), 287–296.
incremental approach that doesn’t place limits on world size is [17] Ken Perlin. 2002. Noise Hardware. In Real-time Shading Languages. Ch. 2.
https://www.csee.umbc.edu/~olano/s2002c36/ch02.pdf
what stands out about the fractal coordinate approach, and the [18] Hans Sagan. 2012. Space-filling curves. Springer Science & Business Media.
graph structures that are generated by the systems presented here [19] Noor Shaker, Antonios Liapis, Julian Togelius, Ricardo Lopes, and Rafael Bidarra.
could be used not only as level geometry but also for more abstract 2016. Constructive generation methods for dungeons and levels. In Procedural
Content Generation in Games. Springer, 31–55.
connections (e.g., trade routes or quest progression paths). A big [20] Nathan Sturtevant and Matheus Ota. 2018. Exhaustive and Semi-Exhaustive
downside is the complex design work of figuring out how to enforce Procedural Content Generation. In Proceedings of the AAAI Conference on Artificial
one’s desired constraints within the fractal coordinate structure, Intelligence and Interactive Digital Entertainment. 109–115.
[21] Adam Summerville, Sam Snodgrass, Matthew Guzdial, Christoffer Holmgård,
as at least the recursive scheme for constraint propagation pre- Amy K Hoover, Aaron Isaksen, Andy Nealen, and Julian Togelius. 2018. Proce-
sented here requires that dependencies line up in a specific way. dural content generation via machine learning (PCGML). IEEE Transactions on
Games 10, 3 (2018), 257–270.
For example, the gesture made earlier towards seam-constraints for [22] Michael Toy and Glenn Wichman. 1980. Rogue. Mastertronic Group Ltd.. PC.
cellular automata might lead to a solution to that issue, but there [23] Breno MF Viana and Selan R dos Santos. 2019. A Survey of Procedural Dungeon
are non-trivial details to be hashed out there about how such seam Generation. In 2019 18th Brazilian Symposium on Computer Games and Digital
Entertainment (SBGames). IEEE, 29–38.
constraints would function. Rather than a one-size-fits-all solution, [24] Bartosz von Rymon Lipinski, Simon Seibt, Johannes Roth, and Dominik Abé.
fractal coordinates are a useful tool that still requires deep expertise 2019. Level graph–incremental procedural generation of indoor levels using
to deploy effectively. However, the potential of fractal coordinates minimum spanning trees. In 2019 IEEE Conference on Games (CoG). IEEE, 1–7.
[25] Steven Worley. 1996. A cellular texture basis function. In Proceedings of the 23rd
to make new kinds of constraints possible, and the ability to com- annual conference on Computer graphics and interactive techniques. 291–294.
pute the resulting structures incrementally with only a logarithmic