diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index e5ee18f1b82..0aefe0cf81c 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -307,6 +307,10 @@ GroundVehicleAcceleration GroundVehicle::GetAcceleration() extern std::vector _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 }; diff --git a/src/lang/extra/english.txt b/src/lang/extra/english.txt index 2d04e7854d5..3cc0b2661f5 100644 --- a/src/lang/extra/english.txt +++ b/src/lang/extra/english.txt @@ -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 diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index a3d81092bcc..bae6eb40fcb 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -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")); diff --git a/src/settings_type.h b/src/settings_type.h index faedde97d88..8dbc231a229 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -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 diff --git a/src/table/settings/settings.ini b/src/table/settings/settings.ini index c480dfc9b4f..49e950f813d 100644 --- a/src/table/settings/settings.ini +++ b/src/table/settings/settings.ini @@ -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