Research Article

Breeding Terrains with Genetic Terrain Programming: The Evolution of Terrain Generators

Table 1

GP functions.

NameDescription

plus(h1,h2)Arithmetical functions
minus(h1,h2)
multiply(h1,h2)

sin(h)Trigonometric functions
cos(h)
tan(h)
atan(h)

myLog(h)Returns 0 if h=0 and log(abs(h))
otherwise

myPower(h1,h2)Returns 0 if h1h2 is NaN or Inf, or has imaginary part, otherwise returns h1h2

myDivide(h1,h2)Returns h1 if h2=0 and h1÷h2
otherwise

myMod(h1,h2)Returns 0 if h2=0 and mod(h1,h2)
otherwise

mySqrt(h)Returns sqrt(abs(h))

negative(h)Returns h

FFT(h)2D discrete Fourier transform

smooth(h)Circular averaging filter with r=5

gradientX(h)Returns the gradient (dh/dx or dh/dy) of a height map h. Spacing between points is assumed to be 1
gradientY(h)