OpenTTD Source 20260311-master-g511d3794ce
tgp.h File Reference

Functions for the Perlin noise enhanced map generator. More...

Go to the source code of this file.

Functions

void GenerateTerrainPerlin ()
 The main new land generator using Perlin noise.
uint GetEstimationTGPMapHeight ()
 Get an overestimation of the highest peak TGP wants to generate.

Detailed Description

Functions for the Perlin noise enhanced map generator.

Definition in file tgp.h.

Function Documentation

◆ GenerateTerrainPerlin()

void GenerateTerrainPerlin ( )

The main new land generator using Perlin noise.

Desert landscape is handled different to all others to give a desert valley between two high mountains. Clearly if a low height terrain (flat/very flat) is chosen, then the tropic areas won't be high enough, and there will be very little tropic on the map. Thus Tropic works best on Hilly or Mountainous.

Definition at line 1057 of file tgp.cpp.

References _height_map, _settings_game, AllocHeightMap(), Clamp(), FreeHeightMap(), GenerateWorldSetAbortCallback(), GWP_LANDSCAPE, H2I(), HeightMapGenerate(), HeightMapNormalize(), IncreaseGeneratingWorldProgress(), MakeVoid(), Map::SizeX(), Map::SizeY(), TgenSetTileHeight(), TGPGetMaxHeight(), and TileXY().

Referenced by GenerateLandscape().

◆ GetEstimationTGPMapHeight()

uint GetEstimationTGPMapHeight ( )

Get an overestimation of the highest peak TGP wants to generate.

Returns
The estimated map tile height.

Definition at line 271 of file tgp.cpp.

References H2I(), and TGPGetMaxHeight().

Referenced by GenerateWorld().