Allows configuring the height at which rainforests start, which by default was controlled by dividing the map maxheight by 4 in landscape.cpp. Default setting is 8 which matches and should provide default behavior in new map creation.

This commit is contained in:
reldred 2021-03-20 20:53:22 +10:30
parent 4386da53ee
commit 07397783f8
7 changed files with 23 additions and 1 deletions

View File

@ -995,7 +995,7 @@ static void CreateDesertOrRainForest()
{
TileIndex update_freq = MapSize() / 4;
const TileIndexDiffC *data;
uint max_desert_height = CeilDiv(_settings_game.construction.max_heightlevel, 4);
uint max_desert_height = _settings_game.game_creation.rainforest_line_height;
for (TileIndex tile = 0; tile != MapSize(); ++tile) {
if ((tile % update_freq) == 0) IncreaseGeneratingWorldProgress(GWP_LANDSCAPE);

View File

@ -1447,6 +1447,8 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximum distanc
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limit for how far from the map border oil refineries and oil rigs can be constructed. On island maps this ensures they are near the coast. On maps larger than 256 tiles, this value is scaled up.
STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Snow line height: {STRING2}
STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Control at what height snow starts in sub-arctic landscape. Snow also affects industry generation and town growth requirements
STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT :Rainforest line height: {STRING}
STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT_HELPTEXT :Control at what height rainforest starts in sub-tropic landscape. Snow also affects industry generation and town growth requirements
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Roughness of terrain: {STRING2}
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(TerraGenesis only) Choose the frequency of hills: Smooth landscapes have fewer, more wide-spread hills. Rough landscapes have many hills, which may look repetitive
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Very Smooth

View File

@ -1273,6 +1273,8 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximum distanc
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Oil refineries are only constructed near the map border, that is at the coast for island maps
STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Snow line height: {STRING}
STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Control at what height snow starts in sub-arctic landscape. Snow also affects industry generation and town growth requirements
STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT :Rainforest line height: {STRING}
STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT_HELPTEXT :Control at what height rainforest starts in sub-tropic landscape. Snow also affects industry generation and town growth requirements
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Roughness of terrain: {STRING}
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(TerraGenesis only) Choose the frequency of hills: Smooth landscapes have fewer, more wide-spread hills. Rough landscapes have many hills, which may look repetitive
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Very Smooth

View File

@ -1339,6 +1339,8 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximum distanc
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limit for how far from the map border oil refineries and oil rigs can be constructed. On island maps this ensures they are near the coast. On maps larger than 256 tiles, this value is scaled up.
STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Snow line height: {STRING}
STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Control at what height snow starts in sub-arctic landscape. Snow also affects industry generation and town growth requirements
STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT :Rainforest line height: {STRING}
STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT_HELPTEXT :Control at what height rainforest starts in sub-tropic landscape. Snow also affects industry generation and town growth requirements
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Roughness of terrain: {STRING}
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :(TerraGenesis only) Choose the frequency of hills: Smooth landscapes have fewer, more wide-spread hills. Rough landscapes have many hills, which may look repetitive
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Very Smooth

View File

@ -1814,6 +1814,7 @@ static SettingsContainer &GetSettingsTree()
genworld->Add(new SettingEntry("game_creation.tgen_smoothness"));
genworld->Add(new SettingEntry("game_creation.variety"));
genworld->Add(new SettingEntry("game_creation.snow_line_height"));
genworld->Add(new SettingEntry("game_creation.rainforest_line_height"));
genworld->Add(new SettingEntry("game_creation.amount_of_rivers"));
genworld->Add(new SettingEntry("game_creation.tree_placer"));
genworld->Add(new SettingEntry("vehicle.road_side"));

View File

@ -361,6 +361,7 @@ struct GameCreationSettings {
byte land_generator; ///< the landscape generator
byte oil_refinery_limit; ///< distance oil refineries allowed from map edge
byte snow_line_height; ///< the configured snow line height
byte rainforest_line_height; ///< the configured rainforest line height
byte tgen_smoothness; ///< how rough is the terrain from 0-3
byte tree_placer; ///< the tree placer algorithm
byte heightmap_rotation; ///< rotation director for the heightmap

View File

@ -2217,6 +2217,20 @@ strhelp = STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT
strval = STR_JUST_COMMA
cat = SC_BASIC
[SDT_VAR]
base = GameSettings
var = game_creation.rainforest_line_height
type = SLE_UINT8
guiflags = SGF_NO_NETWORK
def = 8
min = 1
max = 255
interval = 1
str = STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT
strhelp = STR_CONFIG_SETTING_RAINFORESTLINE_HEIGHT_HELPTEXT
strval = STR_JUST_COMMA
cat = SC_BASIC
;;game_creation.desert_amount
[SDT_NULL]
length = 1