Realtime Procedural Terrain Generation PDF
Realtime Procedural Terrain Generation PDF
Abstract Definitions
The main goal of this paper is to provide an Data representation
overview of a variety of methods for synthesis
of eroded terrain for use in computer games, VR
In the algorithms described in this paper, terrain
worlds and the like. Traditionally, such software
will be represented by two-dimensional height
uses either predefined terrains or runtime gen-
maps using floating point values between 0 and 1.
erated data based on simple fractal noise tech-
Unless otherwise stated, all examples use square
niques.
maps with side length N = 29 = 512, giving a
In recent years, the advances in processing power total of N 2 = 218 = 262144 cells, each cell con-
of average home computers have made it pos- taining a height value.
sible to simulate erosion processes near-realtime
by putting emphasis on speed at the expense of The height map is denoted H and the individual
physical correctness. This paper presents a fast cells are addressed as hi ,j , where i and j are coor-
method to synthesize natural looking fractal ter- dinates ranging from 0 to 511. Some calculations
rain and then proceeds to evaluate and suggest will address cells outside this range; in this case,
optimizations for two of the most commonly used modulo is used to wrap the coordinates around so
erosion algorithms [1, 2]. With some criteria for that the right neighbour of a right-most cell will
applicability in computer games in mind, a new be the left-most cell in the same row etc.
and much faster algorithm is then proposed. Fi- All implementations were done i Java, and all cal-
nally, a few issues regarding terrain modifications culation times are from tests executed on a fairly
for maximum playability are discussed. standard 2.4 GHz Pentium 4 PC.
Defining erosion
1
such that of the frequency, i.e.
2
eroded look by multiplying the size of the offset
range with the height average when calculating
new values. This causes low altitude areas to be-
come smoother, thereby simulating deposition of
eroded material. This method is referred to as
smoothed midpoint displacement.
3
Combination and perturbation
Although Voronoi diagrams have some useful
properties that 1/f noise lacks, they are no sub-
stitute for the noise functions. The best results
are achieved with some combination of both; in
this case two thirds smoothed diamond-square
method noise and one third Voronoi diagram with
coefficients c1 = −1 and c2 = 1 will be used. This
combination is referred to as the combined height
map.
To crumple the straight lines of the Voronoi di-
agram, a perturbation filter as described in [6]
pages 90-91 is applied. This filter works by us-
ing a noise function (similar to the ones described
above) to calculate a displacement with random
distance and direction for each cell. The com-
bined height map before and after perturbation
can be seen in Figure 7. The magnitude of the
Figure 5: Examples of Voronoi diagrams with perturbation filtering is set to 0.25, meaning that
coefficients c1 = −1 (upper left), c2 = 1 (upper a given point in the height map cannot be dis-
right), c3 = 1 (bottom left), c1 = −1 and c2 = 1 placed more than N4 cells.
(bottom right). The perturbation filtering itself also increases the
erosion score because some areas are stretched
and some are compressed, which increases σs .
covered in the section regarding playability issues. Figure 8 shows the average relationship between
perturbation magnitude and erosion score for at
Normally, distances are determined by the Eu- large number of test runs on the combined height
clidean distance metric map generated from different random seed num-
p bers. Erosion score rises to a maximum at a per-
d = dx2 + dy 2 turbation magnitude of 0.25 and then slowly de-
clines.
which is quite slow because of the square root.
Changing the distance metric to
d = dx2 + dy 2
Analysis
Figure 6: Euclidean distance metric (left) ver- Average calculation times and erosion scores for
sus the faster distance metric (right) for Voronoi the methods discussed in this section can be seen
diagrams. in Table 1. As can be seen, the implementations
of spectral synthesis and midpoint displacement
4
0.675
0.650
0.625
Erosion score
0.600
0.575
0.550
0.525
0.500
0.475
0.450
0.00 0.25 0.50 0.75 1.00
Perturbation magnitude
all achieve nearly the same erosion score, but the Figure 9: The base terrain used in image exam-
midpoint displacement method with uniform ran- ples of the erosion algorithms.
dom offset distribution is by far the fastest. The
smoothed version is only marginally slower, but done by examining each cell and its neighbour-
manages to achieve a higher erosion score. hood in turn. Two different types of neighbour-
The Voronoi diagrams in themselves do not score hoods are used: The Moore neighbourhood which
as much as the noise functions, but the faster met- includes all 8 neighbours of a cell, and the Von
ric seems to be better suited for the coefficients Neumann neighbourhood which only includes 4
used. When combined with the modified version of the neighbouring cells (see Figure 11). With
of the midpoint displacement method, the ero- the currently examined cell having value h and
sion score almost reaches the level of the modified its neighbours being named hi , the height differ-
midpoint displacement method alone. As shown ence to each neighbour, di , is defined as
in Figure 8, the perturbation filter improves the
erosion score even further. d i = h − hi
With N = 512 the base terrain can be synthesized
in less than 1 second. Even with N = 1024, the meaning that lower neighbours produce positive
synthesis of the base terrain is done in less than height differences. For maximum correctness, the
3 seconds. Moore neighbourhood was used in both reference
implementations.
5
Type N Calc. time Erosion score
Spectral synthesis, cubic interpolation 512 0.783 s 0.425
Spectral synthesis, linear interpolation 512 0.157 s 0.417
Midpoint displacement, Gaussian distribution 512 0.439 s 0.438
Midpoint displacement, uniform distribution 512 0.108 s 0.401
Midpoint displacement, uniform distribution, smoothed 512 0.144 s 0.478
Voronoi diagram, Euclidean metric, long search range 512 1.322 s 0.323
Voronoi diagram, fast metric, short search range 512 0.468 s 0.347
Noise and Voronoi combination 512 0.709 s 0.460
Noise and Voronoi combination, perturbed 512 0.831 s 0.657
Noise and Voronoi combination, perturbed 1024 2.738 s 0.673
Table 1: Calculation times and erosion scores for the methods discussed in the first section. Calculation
times for combinations include time to calculate the noise and Voronoi maps. All numbers are averages
from a large number of test runs.
h1 h2 h3 h1
h4 h h5 h2 h h3
h6 h7 h8 h4
Optimizations
To produce a speed optimized version of the ref-
erence implementation, four changes were made:
Figure 10: A rendered view of the base terrain
used in image examples of the erosion algorithms. 1. A Von Neumann neighbourhood was used in-
For easy comparison, all rendered views use the stead of the Moore neighbourhood.
same camera position and direction.
2. Material distribution was changed so that
material is only distributed to the lowest
neighbour instead of all lower neighbours.
and d1 < T . However, this is a simplified exam-
ple where material from h only needs to be moved 3. Material distribution was changed to allow
to one neighbour cell. In the case where several more material to be moved per iteration.
neighbours whose height difference is above the
4. The calculations for each cell changes the
talus angle exist, the moved material must be dis-
height map immediately instead of being
tributed after the form
written to a difference map that is applied
di after an entire iteration is completed.
hi = hi + c(dmax − T ) ×
dtotal The reference implementation maintains values
for dmax and dtotal , which means that for every
where dmax is the greatest of the di and dtotal is neighbour hi of a cell h, the following must be
the sum of the di greater than T . done:
A reasonable value for c is 0.5; higher values may
cause oscillation when the changes to the height d i = h − hi
map are applied only after completion of an en- if (di > talus) :
tire iteration, and lower values will simply cause dtotal = dtotal + di
slopes steeper than T a slower asymptotical ap- if (di > dmax ) :
proach to the talus angle. For the talus threshold, dmax = di
a value of T = N4 was chosen.
6
the height map remains unchanged until all cells
d1 = T
d2 > T have been processed. One way to solve this is to
change the height map immediately when mov-
ing material - in the above example this would
h1 h h2 mean that the hole would not receive any more
material once it was raised to a level where the
height differences to the surrounding cells were
t=0
below the talus threshold. Another advantage of
direct changes to the height map is a slight in-
crease in calculation speed.
d1 < T d2 = T
When experimenting with different kinds of
neighbourhoods, it was also noted that a ”ro-
tated” version of the Von Neumann neighbour-
h1 h h2 hood (see Figure 13) gave slightly better results
both in terms of higher erosion score and less dif-
t=1 ference between the two versions.
h3 h4
Switching from the Moore neighbourhood to the
Von Neumann neighbourhood will halve the num-
ber of times these conditional checks have to be
done. Since the amount of moved material per Figure 13: The modified Von Neumann neigh-
cell is proportional to dmax , using the Von Neu- bourhood used in the speed optimized version of
mann neighbourhood will move the same amount thermal erosion.
of material 50% of the time. Even if the dmax of
the Moore neighbourhood is outside of the Von
Neumann neighbourhood, the dmax of the Von Analysis
Neumann neighbourhood still tends to be close
Calculation time averages for the first 500 itera-
to its value.
tions of the two implementations can be seen in
When the amount of material to be moved has
Figure 14. Time required per iteration remains
been calculated, each neighbour hi whose di > T
di constant for both implementations, but the ref-
receives a fraction proportional to dtotal (where
erence implementation takes 6 times longer; 500
dtotal is the sum of the di greater than T ). This iterations are calculated in 60 seconds, while the
can be simplified a lot by distributing material speed optimized version does it in 10 seconds.
to the lowest neighbour only as this renders the Figure 15 shows erosion score averages of the
calculation of dtotal and the fractions to be dis- first 500 iterations. The reference implementa-
tributed superfluous. A drawback is that less ma- tion scores 5% better after 500 iterations, but
terial can be moved per cell, which can partly be the speed optimized version seems to be more ef-
compensated for by moving as much material ∆h fective during the first 80 iterations. To explore
as possible: this further, a new graph was created, showing
dmax
∆h = the height map difference after every 10 iterations
2 (see Figure 16). The optimized version seems to
This causes h to be levelled with its lowest neigh- stabilize faster, meaning that most of the change
bour if their height difference is greater than T . is done during the first 50 iterations. The ref-
In the reference implementation, only a percent- erence implementation does more change overall
age c of the maximum amount of material to be during the 500 iterations, but does not seem to
moved was transfered. This was done to avoid be stabilizing until after 150 iterations.
oscillation, and the same problem applies here: For practical or visual applications, no more than
Four large height values surrounding a deep hole 50 iterations of any of the versions are needed to
may not only fill up the hole, but create a tall change the shape of the terrain to show the dis-
spike instead. Oscillations like this occur because tinct effects of thermal erosion, namely the con-
7
60 0.008
30 0.004
20 0.003
0.002
10 0.001
0 0.000
0 100 200 300 400 500 0 100 200 300 400 500
Iterations Iterations
Figure 14: Calculation times of the first 500 it- Figure 16: Change per 10 iterations of the first
erations of the reference and optimized implemen- 500 iterations of the reference and optimized im-
tation of thermal erosion. plementation of thermal erosion.
Hydraulic erosion
0.95
Overview
0.90
0.85 Hydraulic erosion simulates changes to the ter-
Erosion score
Figure 15: Erosion scores of the first 500 itera- 3. Transportation of water and sediment.
tions of the reference and optimized implementa-
tion of thermal erosion. 4. Evaporation of water and deposition of sedi-
ment.
8
Figure 17: Comparison between the reference implementation of thermal erosion (left) and the speed
optimized version (right). Images show the height map after 50 iterations.
similar to the material distribution in thermal cell. The amount of sediment ∆mi to be trans-
erosion. Only now, water is being distributed to ported to a neighbouring cell i is therefore
the neighbour cells instead and the distribution
seeks to level out any height differences of the to- ∆wi
∆mi = m ×
tal altitude a = h + w so that w
9
Figure 18: Renderings from the two height maps shown in Figure 17 - the left image shows the refer-
ence implementation after 50 iterations, and the right image shows the speed optimized version after 50
iterations.
10
amount of material dissolved per water equals the 10,000 iterations, the optimized version reaches a
transport capacity of the water. This causes all score of 7.8. However, at this point none of the
the water to always be at maximum sediment sat- height maps resemble the original at all; the op-
uration: Any water evaporation is immediately timized implementation reaches its high score by
followed by sedimentation of the material that ex- changing the entire height map to a few almost
ceeds the transport capacity. Since m = Kc × w completely levelled terraces divided by very steep
for every cell, there is no need to maintain a sep- slopes.
arate sediment map. Even with Kc < Ks this is a After 100 iterations, the optimized version scores
good approximation, since w drops exponentially 20% better than the reference and has a much
which means that maximum saturation is reached higher erosion score growth rate during the first
very quickly. 25 iterations where the reference implementation
To limit reads and writes to the height and wa- produces almost no increase in erosion score at
ter maps further, all changes are written directly all.
instead of using difference maps that are applied
only after the entire iteration has been completed. 2.5
2.3
Analysis 2.0
Erosion score
1.8
Calculation time averages for the first 500 itera-
1.5
tions of the two implementations can be seen in
1.3
Figure 20. Time required per iteration remains
1.0
very close to constant for both implementations,
0.8
but the reference implementation takes 5.5 times
0.5
longer; 500 iterations are calculated in 148 sec- 0 100 200 300 400 500
onds on average, while the speed optimized ver- Iterations
sion does it in 27 seconds.
Reference Optimized
150
125 Figure 21: Erosion scores of the first 500 itera-
100 tions of the reference and optimized implementa-
Time/s
Iterations 5.0
4.0
Reference Optimized 3.0
2.0
Figure 20: Calculation times of the first 500 it- 1.0
erations of the reference and optimized implemen- 0.0
0 2500 5000 7500 10000
tation of hydraulic erosion.
Iterations
Figure 21 shows erosion score averages of the first Reference Optimized
500 iterations. Apart from the first 100 iterations,
both versions apparently resemble linear func-
tions with the optimized implementation climb- Figure 22: Erosion scores of the first 10,000 it-
ing twice as fast as the reference. Due to the re- erations of the reference and optimized implemen-
altime requirements, results from more than 100 tation of hydraulic erosion.
iterations are irrelevant, but to see how erosion
scores eventually develop, a graph showing scores Rate of change is shown on the chart in Figure
for the first 10,000 iterations can be seen in Figure 23 where change per 10 iterations is plotted. As
22. Here, both curves appear more like logarith- opposed to thermal erosion (see Figure 16), both
mic functions, but where the reference implemen- curves start out at very low values and quickly
tation climbs to an erosion score of 2.8 during the climb to a maximum about one fourth the rate of
11
change in thermal erosion. From here, the ref- optimized version of thermal erosion and at the
erence implementation seems to stabilize much same time emulate what causes the hydraulic ero-
faster than the optimized version: After 500 it- sion to reach a high score. This was achieved by
eration, the rate of change is 3 times higher for modifying the speed optimized version of thermal
the optimized version. erosion as described below.
The difference between the outputs of the two im-
plementations after 100 iterations is 1% on aver- Overview
age, where a difference of 100% corresponds to a
height map with all height values at 0 versus a The high erosion score of the speed optimized ver-
height map with all height values at 1. sion of hydraulic erosion is caused by two factors:
To create an algorithm that combines the speed of The algorithm was found to work well with a Von
thermal erosion with the high erosion score of hy- Neumann neighbourhood and values of T between
8 16
draulic erosion, it has to be as simple as the speed N and N .
12
Figure 24: Comparison between the reference implementation of hydraulic erosion (left) and the speed
optimized version (right). Images show the height map after 100 iterations.
10
9
d2 < T 8
h1 h h2 h1 h h2 7
6
Time/s
t=0 t=1 5
4
3
2
1
d2 > T 0
0 100 200 300 400 500
h1 h h2 h1 h h2 Iterations
t=0 t=1
Figure 27: Calculation times of the first 500 it-
erations of the new proposed algorithm.
Figure 26: Two examples of the new proposed
erosion algorithm. In the first case, d2 < T so h
and h2 are levelled out, while in the second case, exist. Erosion scores rise quickly: After 50 iter-
d2 > T which leaves both h and h2 unaffected. In ations they reach between 70-80% of the level at
both cases h1 > h and is therefore ignored. 500 iterations.
With T = 16 N an erosion score of 2.15 is reached in
50 iterations, corresponding to 1 second of calcu-
Analysis lation time. For comparison, the speed optimized
version of hydraulic erosion does not reach this
Calculation time averages for the first 500 itera- score until after 450 iterations, corresponding to
tions can be seen in Figure 27. Time required per 24 seconds of calculation time.
iteration remains constant and the 500 iterations The change per 10 iterations graph shown in Fig-
are done in approximately 10 seconds, matching ure 29 confirms that most of the change happens
the speed optimized version of thermal erosion. during the first 50 iterations after which the al-
Figure 28 depicts erosion score averages for dif- gorithm seems to stabilize quickly. Not surpris-
ferent values of T during the first 500 iterations. ingly, the rate of change matches that of thermal
For the three sampled values, a proportional re- erosion whereas hydraulic erosion only changes
lationship between T and erosion score seems to at one fourth the speed during the first 50 it-
13
Figure 25: Renderings from the two height maps shown in Figure 24 - the left image shows the reference
implementation after 100 iterations, and the right image shows the speed optimized version after 100
iterations.
3.5 0.007
Change per 10 iterations
3.0 0.006
0.005
Erosion score
2.5
0.004
2.0
0.003
1.5
0.002
1.0 0.001
0.5 0.000
0 100 200 300 400 500 0 100 200 300 400 500
Iterations Iterations
Figure 28: Erosion scores of the first 500 itera- Figure 29: Change per 10 iterations of the first
tions of the new proposed algorithm. 500 iterations of the new proposed algorithm.
erations. Together with the quick initial rise in up to 30 seconds are not uncommon.
erosion score, this suggests that the optimal num-
ber of iterations for producing profound erosion
effects as quickly as possible is around 50.
Playability issues
Height maps after 50 iterations with T = N8 and To explore the use of procedurally generated ter-
T = 16N as well as rendered scenes of these, can rain in computer games a bit further, a few playa-
be seen of Figure 30 and Figure 31 respectively. bility issues for games in the realtime strategy
Larger values of T creates more levelling of the genre are discussed here. This type of game makes
terrain and leaves less but steeper slopes. more demands to the terrain shape than just vi-
With 50 iterations of this algorithm, an eroded sual appearance, as player units must be able to
terrain meeting the criteria defined at the begin- move around in the terrain, and there must exist a
ning of this paper can be synthesized from scratch decent number of flat spots of a certain minimum
in less than 2 seconds for N = 512 (about one size for various structures to be placed upon.
quarter of a million height values) and in less than
7 seconds for N = 1024 (about one million height Main criteria
values). This actually makes it possible to use
these techniques for runtime terrain generation The above considerations regarding unit move-
in modern computer games, where loading times ment and building placement can be formalized
14
Figure 30: Comparison between T = N8 (left) and T = 16
N (right) for the new proposed algorithm.
Images show the height map after 50 iterations.
in two criteria: Since both units and buildings may take up more
space than one cell, the variables Nu and Nb are
• Cells with an inclination below a certain used to denote the side length of the square repre-
threshold Tu allowing unit movement should senting the space occupied by units and buildings
be connected in an area as large as possible. respectively. For example, Nu = 1 means that a
unit only occupies one cell, while Nb = 5 means
• Cells with an inclination below a certain
that a building occupies a square of 5 × 5 cells.
threshold Tb < Tu allowing building place-
Taking unit and building size into consideration
ment should cover an area as large as possible
means modifying A before calculating U and B,
(although not necessarily a connected area).
such that only the cells of value 1 that can form
Only cells included by the first criterion are
squares of sizes Nu × Nu remain 1. When cal-
considered (i.e. a spot suitable for building
culating U from A, Nu must also be taken into
placement is worthless if it is isolated from
consideration when determining whether two ar-
the rest of the map).
eas are connected, e.g. a unit taking up 3 × 3 cells
To analyse height maps according to these crite- cannot pass through a narrow connection only 1
ria, the following binary maps (maps containing cell wide. An illustrated example of how U is
either the value 0 or 1) of the same size as the calculated can be seen in Figure 32.
height map in question are defined: Likewise, B must be modified such that only the
cells of value 1 that can form squares of sizes Nb ×
• A, the accessibility map, is a binary map Nb remain 1.
representing the cells hi,j of the height map A ”unit score”, υ, and a ”building score”, β, are
whose corresponding slope values si,j < Tu then defined as the fraction of the cells of U and B
such that si,j < Tu ⇒ ai,j = 1. whose value are 1 (the same as the average value
of the maps).
• U , the unit map, is a binary map containing Because a completely flat height map (which is
the largest connected area of cells from the undesirable) would maximize υ and β, a final
A map whose value is 1. overall ”game suitability score” γ is defined as
• F , the flatness map, is a binary map repre-
senting the cells hi,j of the height map whose γ =ε×υ×β
corresponding slope values si,j < Tb such
that si,j < Tb ⇒ fi,j = 1. i.e. the product of the erosion score, unit score
and building score. The terrain must now achieve
• B, the building map, is the binary map con- high unit and building scores while retaining a
sisting of all bi,j = ui,j × fi,j . high erosion score.
15
Figure 31: Rendered views of the two height maps shown in Figure 30. A much larger part of the
terrain is levelled out when using T = 16
N.
Figure 32: The construction of the unit map U . Step 1 shows an eroded height map H and step 2 its
corresponding accessibility map A based on the threshold value Tu = N8 . In step 3, A is reduced to those
cells that can contain squares of size Nu × Nu (where Nu = 7 in this example). In step 4, the map is
finally reduced to U which is the largest unit-accessible area taking the unit size Nu into consideration.
To guarantee that every height map generated It was noted earlier that the use of the coefficients
by random seeds meet certain playability criteria c1 = −1 and c2 = 1 gave the Voronoi diagram a
(a unit score υ > 0.75 for instance) is impossi- useful property. The usefulness lies in the fact
ble without some sort of iterated feedback system that it allows for individual control of each of the
where the height map is analyzed and changed ”hills” of the Voronoi diagram by using a related
repeatedly until the desired criterion is met. This domain map.
however requires far too much work to to be done A domain map is created by assigning a value
runtime, so instead the methods for synthesizing to each of the feature points of the Voronoi di-
terrains must be adjusted until it can be shown agram. When the Voronoi diagram is rendered,
statistically that the criteria are met in, say, 99% the domain map is calculated at the same time
of the cases. by giving each cell the same value as the closest
These adjustments can be done in many ways; feature point. This creates a number of patches
one way is to introduce more flat areas during of one colour, whose borders represent the coor-
synthesis of the base terrain as described below. dinates where d1 = d2 .
The coefficients of the corresponding Voronoi dia-
gram ensure that the values located at the domain
Base terrain modifications borders are always 0, since
16
the hills can then be scaled individually without
creating sudden jumps in the height values. Fig-
ures 33 and 34 show some examples of how this
can be done.
The fact that these Voronoi diagrams always have
a value of 0 midway between two feature points
also makes it possible to widen the passages be-
tween the hills. This can easily be done by sub-
tracting a constant from all values and clipping
negative values to 0 - see Figure 35 for an exam- Figure 35: Subtracting a small amount of the
ple. height values (and clipping negative values to 0)
Any of these modifications only add a about 10 of the original Voronoi diagram (left) widens the
milliseconds to the time required for the synthesis narrow passages between the hills (right).
of the base terrain for N = 512 and 40 millisec-
onds for N = 1024.
Examples of use section:
8
Tu =
N
2
Tb =
N
Nu = 1
Nb = 9
N
With a height scale of 16 , Tu equals an inclination
of 26.6 degrees and Tb equals an inclination of 7.1
Figure 33: Multiplying a domain map with ran- degrees. A unit takes up only one cell, while a
dom values (left) with the Voronoi diagram, pro- building covers 9 × 9 cells.
duces hills of varying height (right). Table 2 show average scores for terrains created
by different erosion methods.
Although most of the base terrain is accessible
by units, almost no flat areas of sufficient size for
building placement exist, resulting in a minimal
game suitability score.
Both versions of thermal erosion manage to flat-
ten 98% of the terrain to an inclination below Tu ,
but the problem with this method is that most of
the terrain will attain exactly the same inclination
as the algorithm’s talus threshold T = N4 , leaving
no areas with an inclination below Tb = N2 , which
again results in a minimal game suitability score.
The two versions of hydraulic erosion produce
Figure 34: Multiplying a domain map with ran- slightly better building scores, but the overall
domly assigned values of either 0 or 1 (left) with game suitability scores are still too low for them
the Voronoi diagram, produces a mixture of flats to be of any practical use, especially when taking
and hills (right). realtime generation into account. More iterations
would have given them higher scores, but the cal-
culation work would become too demanding. An
interesting observation is that while the reference
and speed optimized version have similar erosion
Analysis and unit scores, the optimized version seems to
produce more almost completely flat areas.
A large number to of test runs were made to de- The new algorithm is very sensitive to the value of
termine average game suitability scores for the T . With T = N8 , it produces so many slopes with
different kinds of erosion algorithms described an inclination above Tu that the terrains often
in this paper. The constants used were similar are broken up into several large areas inaccessible
to those found in the project described in the from each other, causing a very low unit score.
17
Terrain type ε υ β γ
Base terrain 0.665 0.713 0.002 0.001
Reference thermal erosion, 50 iterations 0.614 0.980 0.002 0.001
Optimized thermal erosion, 50 iterations 0.626 0.983 0.002 0.001
Reference hydraulic erosion, 100 iterations 0.916 0.834 0.050 0.039
Optimized hydraulic erosion, 100 iterations 1.077 0.828 0.157 0.140
New algorithm, 50 iterations, T = 8/N 1.339 0.303 0.173 0.070
New algorithm, 50 iterations, T = 12/N 1.850 0.752 0.393 0.580
New algorithm, 50 iterations, T = 16/N 2.204 0.905 0.434 0.877
New algorithm, 50 iterations, T = 20/N 2.340 0.949 0.429 0.953
Table 2: Erosion, unit, building and game suitability scores for terrains created by different erosion
methods.
18
Terrain type ε υ β γ
75% hill coverage 2.280 0.916 0.487 1.017
50% hill coverage 2.337 0.923 0.526 1.134
25% hill coverage 2.371 0.929 0.556 1.225
Vertical offset -0.1 with clipping 2.256 0.910 0.468 0.962
Vertical offset -0.2 with clipping 2.312 0.918 0.511 1.086
Vertical offset -0.3 with clipping 2.346 0.922 0.539 1.166
Vertical offset -0.4 with clipping 2.361 0.926 0.557 1.219
Vertical offset -0.5 with clipping 2.372 0.928 0.567 1.249
Table 3: Erosion, unit, building and game suitability scores for terrains using different modifications to
the Voronoi diagram used in the synthesis of the base terrain.
Figure 37: Screenshot from Tribal Trouble show- Figure 38: Screenshot from Tribal Trouble show-
ing the use of the unit map U . The yellow crosses ing the use of the building map B. When placing
indicate inaccessible cells of the height map, i.e. a building, all cells must be green, i.e. none of the
cells whose inclination are above Tu . cells covered can have an inclination above Tb .
the strict realtime requirement, was used to eval- A new algorithm using the same simple method
uate methods of terrain synthesis and implemen- as the speed optimized version of thermal erosion,
tations of two of the classical erosion algorithms. but modified to change the terrain in another way,
For base terrain synthesis, it was shown that more was introduced. When evaluated, the algorithm
natural-looking terrains than just plain 1/f noise was able to triple the terrain’s erosion score in 1
could be synthesized in less than 1 second for second for 512 × 512 height maps and 4 seconds
512 × 512 height maps, and in less than 3 sec- for 1024×1024 height maps, making it much more
onds for 1024 × 1024 height maps on a standard suitable for games.
PC. Finally, two important demands to the terrain
Not even with speed optimizations (at the cost used in realtime strategy games were discussed.
of physical correctness) that reduced calculation Methods for evaluating terrains according to
times to between one fifth and one sixth, did any these criteria were introduced, and it was shown
of the classical erosion algorithms meet the re- that the methods for evaluation together with
altime requirement while producing the desired modifications to the synthesis of the base terrain
output: The speed optimized version of thermal could be used to fine-tune the terrains to meet
erosion was found to be fast enough, but scored playability criteria.
much too low in evaluation. The output of hy-
draulic erosion scored a lot better, but even the
speed optimized version was too slow.
19
Figure 36: Screenshot from Tribal Trouble, a realtime strategy game using the methods described in this
paper for fast runtime generation of terrains.
20