diff --git a/src/lang/english.txt b/src/lang/english.txt index 8ac2328db3..bdb8a4614c 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1663,6 +1663,13 @@ STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_HELPTEXT :Adjust placemen STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_RANGE :Arctic tree range: {STRING2} STR_CONFIG_SETTING_TREES_AROUND_SNOWLINE_RANGE_HELPTEXT :Approximate range of arctic trees around snow line +STR_CONFIG_SETTING_TREE_GROWTH :Tree growth speed: {STRING2} +STR_CONFIG_SETTING_TREE_GROWTH_HELPTEXT :Control rate at which trees grow during the game. This might affect industries which rely on tree growth, for example lumber mills +STR_CONFIG_SETTING_TREE_GROWTH_NORMAL :Normal +STR_CONFIG_SETTING_TREE_GROWTH_SLOW :Slow +STR_CONFIG_SETTING_TREE_GROWTH_VERY_SLOW :Very slow +STR_CONFIG_SETTING_TREE_GROWTH_EXTREMLY_SLOW :Extremly slow + STR_CONFIG_SETTING_TOOLBAR_POS :Position of main toolbar: {STRING2} STR_CONFIG_SETTING_TOOLBAR_POS_HELPTEXT :Horizontal position of the main toolbar at the top of the screen STR_CONFIG_SETTING_STATUSBAR_POS :Position of status bar: {STRING2} diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 3e59bacc98..dd94a07b4b 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1788,6 +1788,7 @@ static SettingsContainer &GetSettingsTree() treedist->Add(new SettingEntry("construction.extra_tree_placement")); treedist->Add(new SettingEntry("construction.trees_around_snow_line_enabled")); treedist->Add(new SettingEntry("construction.trees_around_snow_line_range")); + treedist->Add(new SettingEntry("construction.tree_growth_rate")); } environment->Add(new SettingEntry("station.modified_catchment")); diff --git a/src/settings_type.h b/src/settings_type.h index ec121b6298..489763d335 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -359,6 +359,7 @@ struct ConstructionSettings { uint16 clear_frame_burst; ///< how many tiles may, over a short period, be cleared? uint32 tree_per_64k_frames; ///< how many trees may, over a long period, be planted per 65536 frames? uint16 tree_frame_burst; ///< how many trees may, over a short period, be planted? + uint8 tree_growth_rate; ///< tree growth rate }; /** Settings related to the AI. */ diff --git a/src/table/settings.ini b/src/table/settings.ini index b87123d728..41e4c8a516 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -2744,6 +2744,20 @@ strval = STR_JUST_COMMA cat = SC_BASIC patxname = ""everest_treeline.construction.trees_around_snow_line_range"" +[SDT_VAR] +base = GameSettings +var = construction.tree_growth_rate +type = SLE_UINT8 +guiflags = SGF_MULTISTRING +def = 0 +min = 0 +max = 3 +str = STR_CONFIG_SETTING_TREE_GROWTH +strhelp = STR_CONFIG_SETTING_TREE_GROWTH_HELPTEXT +strval = STR_CONFIG_SETTING_TREE_GROWTH_NORMAL +cat = SC_BASIC +patxname = ""reduced_tree_growth.construction.tree_growth_rate"" + [SDT_VAR] base = GameSettings var = game_creation.custom_sea_level diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index b4c3cefa23..bb57b55fb8 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -732,7 +732,16 @@ static void TileLoop_Trees(TileIndex tile) } } if (GetTreeCounter(tile) < 15) { - AddTreeCounter(tile, 1); + if (_settings_game.construction.tree_growth_rate > 0) { + /* slow, very slow, extremely slow */ + uint16 grow_slowing_values[3] = { 0x10000 / 5, 0x10000 / 20, 0x10000 / 120 }; + + if (GB(Random(), 0, 16) < grow_slowing_values[_settings_game.construction.tree_growth_rate - 1]) { + AddTreeCounter(tile, 1); + } + } else { + AddTreeCounter(tile, 1); + } return; } SetTreeCounter(tile, 0);