Add setting to also limit acceleration when using realistic braking

pull/590/head
Jonathan G Rennison 10 months ago
parent 3840a37999
commit 8a14d8c246

@ -307,6 +307,10 @@ GroundVehicleAcceleration GroundVehicle<T, Type>::GetAcceleration()
extern std::vector<Train *> _tick_train_too_heavy_cache;
_tick_train_too_heavy_cache.push_back(Train::From(this));
}
if (Train::From(this)->UsingRealisticBraking() && _settings_game.vehicle.limit_train_acceleration) {
accel = std::min(accel, 250);
}
}
return { accel, braking_accel };

@ -191,6 +191,9 @@ STR_CONFIG_SETTING_TRAIN_BRAKING_MODEL_HELPTEXT :Select the phys
STR_CONFIG_SETTING_REALISTIC_BRAKING_ASPECT_LIMITED :Realistic train braking is aspect limited: {STRING2}
STR_CONFIG_SETTING_REALISTIC_BRAKING_ASPECT_LIMITED_HELPTEXT :In the realistic train braking model, limit the look-ahead of trains to the aspect of signals (i.e. do not allow reserving and looking ahead an unlimited number of signals).{}This requires a NewGRF which provides multi-aspect signals.{}{}This is an expert setting which will likely increase gameplay difficulty and will require additional thought about signal types and placement.
STR_CONFIG_SETTING_LIMIT_TRAIN_ACCELERATION :Limit train acceleration: {STRING2}
STR_CONFIG_SETTING_LIMIT_TRAIN_ACCELERATION_HELPTEXT :When using the realistic train train braking model, also limit the maximum acceleration of trains. This is to prevent passengers from spilling their drinks due to some train types otherwise accelerating excessively quickly.
STR_CONFIG_SETTING_THROUGH_LOAD_SPEED_LIMIT :Train through load maximum speed: {STRING2}
STR_CONFIG_SETTING_THROUGH_LOAD_SPEED_LIMIT_HELPTEXT :The maximum permitted speed for trains when through loading at a station

@ -2236,6 +2236,7 @@ static SettingsContainer &GetSettingsTree()
physics->Add(new SettingEntry("vehicle.train_acceleration_model"));
physics->Add(new SettingEntry("vehicle.train_braking_model"));
physics->Add(new ConditionallyHiddenSettingEntry("vehicle.realistic_braking_aspect_limited", []() -> bool { return GetGameSettings().vehicle.train_braking_model != TBM_REALISTIC; }));
physics->Add(new ConditionallyHiddenSettingEntry("vehicle.limit_train_acceleration", []() -> bool { return GetGameSettings().vehicle.train_braking_model != TBM_REALISTIC; }));
physics->Add(new SettingEntry("vehicle.train_slope_steepness"));
physics->Add(new SettingEntry("vehicle.wagon_speed_limits"));
physics->Add(new SettingEntry("vehicle.train_speed_adaptation"));

@ -643,6 +643,7 @@ struct VehicleSettings {
uint8 train_acceleration_model; ///< realistic acceleration for trains
uint8 train_braking_model; ///< braking model for trains
uint8 realistic_braking_aspect_limited; ///< realistic braking lookahead is aspect limited
bool limit_train_acceleration; ///< when using realistic braking, also limit train acceleration
uint8 roadveh_acceleration_model; ///< realistic acceleration for road vehicles
uint8 train_slope_steepness; ///< Steepness of hills for trains when using realistic acceleration
uint8 roadveh_slope_steepness; ///< Steepness of hills for road vehicles when using realistic acceleration

@ -1425,6 +1425,14 @@ strhelp = STR_CONFIG_SETTING_REALISTIC_BRAKING_ASPECT_LIMITED_HELPTEXT
cat = SC_EXPERT
patxname = ""realistic_braking.vehicle.realistic_braking_aspect_limited""
[SDT_BOOL]
var = vehicle.limit_train_acceleration
def = false
str = STR_CONFIG_SETTING_LIMIT_TRAIN_ACCELERATION
strhelp = STR_CONFIG_SETTING_LIMIT_TRAIN_ACCELERATION_HELPTEXT
cat = SC_EXPERT
patxname = ""realistic_braking.vehicle.limit_train_acceleration""
[SDT_VAR]
var = vehicle.roadveh_acceleration_model
type = SLE_UINT8

Loading…
Cancel
Save