Import reduced tree patch

http://www.tt-forums.net/viewtopic.php?p=890778#p890778

Update to recent trunk, use extended savegame framework.
Add setting help text, tweak setting name.
Pre-calculate tree growth probabilities.
pull/6/merge
patch-import 9 years ago committed by Jonathan G Rennison
parent 9826c2481e
commit c5f9d8b6de

@ -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}

@ -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"));

@ -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. */

@ -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

@ -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);

Loading…
Cancel
Save