Evolution of Artificial Terrains for Video Games Based on Accessibility
Miguel Frade – Instituto Politécnico de Leiria, Portugal F. Fernandez de Vega – University of Extremadura, Spain Carlos Cotta – University of Málaga, Spain
Istanbul, Turkey 7 – 9 April 2010
Introduction(1) ●
There are a wide range of techniques for terrain generation ●
●
procedural techniques, like fractals are common
But how to control terrains features?
Introduction (2) ●
With constraints ●
●
●
●
●
computing the interpolation of point clouds or contour lines down-sampled elevation data sets using radial basis functions patches, small-scale or microscopic features of existing terrains to synthesize new ones deformation of initial fractal terrain by applying local modifications constrained fractal model
Introduction (3) ●
Limitations of current constraints approaches ●
●
●
are focused on the reconstruction of Data Elevation Models most suffer from either time and/or manipulation complexity use only height constraints ●
●
both the height and location of constraints must be specified this kind of constraints are too strict
Introduction (4) ●
●
There are situations were less strict restrictions are preferable, like: ●
a nearly flat, or mountainous terrain
●
without specific size or location
Approaches with less strict constraints ●
Technique proposed by J. Olsen (2004) ●
●
May not fully meet the constraints
Our previous work: GTPi ● ●
Interactive Evolutionary Computation Might be tiresome
Introduction (5) ●
Our Goal –
●
automatically evolve terrains with GP based on accessibility constraints
Why accessibility? ●
●
highly influences the attainable movements of characters/avatars as well as placement of buildings and other structures easily evaluated by computers ●
Accessible if slope < slope threshold
Evaluation Algorithm 1) Generate height map H from TP 2) From H calculate slope map S 3) From S calculate accessibility map A 4) Determine largest connected area on A 5) Calculate accessibility score – fitness value
1) Generate height map H from TP TP = cos(atan(minus(exp(X),myDivide(multiply(0.07358, 0.93756), myDivide(X,myLog(myLog(sin(Y)))))))) Dx
y
Terrain area at 100%
Dx/ S x
View area
Lx
(0,0)
Ly
Dy Dy Sy
x
2) Calculate slope map S from H
3) Calculate accessibility map A from S
4) Largest connected area on A ●
Component labeling algorithm
●
Smaller areas are removed
●
Ca = number of cells of largest accessible area
5) Calculate accessibility score nr n c = , Ca
C a≠0
nr nc t = , ⌈ p nr nc ⌉
{
70 % Test values p= 80 % 90 %
0 p1
s=∣− t∣
Tests Parameters
T 1= { noise x , y , erc } T 2 ={ x , y ,erc } T 3 ={ noise x , y , x , y , erc }
●
3 terminal sets, 3 pa values
●
Total 9 tests
GP Function Set
Results (1) – T1 ●
●
●
present several distributed obstacles smooth transitions terrains tend to be similar
Results (2) – T2 ●
●
●
Many diverse terrains geometric patterns and sudden height changes tend to present a single large obstacle
Results (3) – T3 ●
●
●
some geometric patterns Some natural looking terrains Some odd looking terrains
Results (4) ●
Subjective classification of terminal sets –
Realism ●
–
Diversity ●
–
T3, T1, T2 T3, T2, T1
Suitability ●
T1, T3, T2
Results (5) ●
GP run data
Results (6) ●
All runs reached the goal of fitness = zero
●
How different are the resulting terrains? –
Measure accessibility maps overlap
Results (7) ●
Accessibility maps over lap
Conclusions (1) ●
Fitness function is able to find many solutions
●
The number of generations is little influenced by
●
●
–
changing the terminal set, or
–
the amount of desired accessible area (p)
The terminal set has a great influence on the terrain look Rich terminal sets allow shorter TPs
Conclusions (2) ●
●
Our fitness function does not account for terrain realism –
requiring a visual inspection before using them
–
But less visualizations than with IEC systems
–
minimizes designer fatigue
Sometimes terrains present a single or a few large obstacles
Conclusions (3) ●
Technique in use in Open Source video game Chapas http://sn.im/chapas
Play demo video
Thank you!
Any questions ?