The International Simutrans Forum

 

Author Topic: Tilting trains not tilting  (Read 421 times)

0 Members and 1 Guest are viewing this topic.

Online Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Tilting trains not tilting
« on: April 22, 2020, 07:26:16 PM »
I have invested in those new fancy pendolinos, and they negotiate curves at the same speed as normal trains. Can be observed at stephenson-siemens game, player : gretat beltwell railroad, line hollyingchester - lininglow, for example on approach to dalenchurch station (from south) - (776,60)

Offline Freahk

  • Devotee
  • *
  • Posts: 1055
  • Languages: DE, EN
Re: Tilting trains not tilting
« Reply #1 on: April 22, 2020, 09:27:02 PM »
I guess it's a feature, not a bug ;)
There is a minimum curve radius for tilting that can be set in the dats.

Online Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Tilting trains not tilting
« Reply #2 on: April 23, 2020, 07:47:32 AM »
Oh yes: tilting_min_radius_effect=1000
But I found that Czech pendolino class 680, can tilt on corners from 250 m

I was not able to quickly find any value for british rails, but I expect it to be similar.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19820
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Tilting trains not tilting
« Reply #3 on: April 23, 2020, 10:05:22 AM »
Oh yes: tilting_min_radius_effect=1000
But I found that Czech pendolino class 680, can tilt on corners from 250 m

I was not able to quickly find any value for british rails, but I expect it to be similar.

Thank you for that. Are you able to link to a source for this information?

Online Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Tilting trains not tilting
« Reply #4 on: April 23, 2020, 10:20:01 AM »
https://cs.wikipedia.org/wiki/Elektrick%C3%A1_jednotka_680

Unfortunately the information is only in the Czech version. If you look at the specs on the right column:

Minimální poloměr
projížděných oblouků    
s naklápěním: 250 m
bez naklápění: 190 m
do 10 km/h: 150 m

Minimum curve radius:
with tilting: 250 m
without tilting: 190 m
speed <10 km/h: 150 m

However I had in simuconf.tab for pak.cs minimum value of 300 m, but I was unable to find the source. Maybe the wikipedia article had been updated.

Offline Freahk

  • Devotee
  • *
  • Posts: 1055
  • Languages: DE, EN
Re: Tilting trains not tilting
« Reply #5 on: April 23, 2020, 10:44:06 AM »
German train protection system for tilting trains activates tilting at speeds above 70 km/h.
https://en.wikipedia.org/wiki/Geschwindigkeits%C3%BCberwachung_Neigetechnik

Real-world calculations tell me that pasing a 250m curve at 70 km/h at a maximum lateral acceleration of 1 m/s² requires a superelevation of ~80mm.

In simutrans we always assume a superelevation of 0.
Further, maximum lateral acceleration is set to 0.918 (1/10 G) in simuconf.

In this case, a curve radius of 385m is required to reach 70 km/h.

 :coffee:

I could not find such detailled information about TASS, the British eqivalent to GNT. The only informations I could find about it were moreover advertising the technique as it increased lne speed on some lines from 110 mph to 125 mph
« Last Edit: April 23, 2020, 12:13:13 PM by Freahk »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19820
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Tilting trains not tilting
« Reply #6 on: April 23, 2020, 11:52:17 AM »
Thank you all for that: that is most helpful. I have just pushed an update to the pakset to reduce the minimum radius for tilting trains to 375m (chosen to be an integral number of tiles at 125m/tile, i.e., 3 tiles).

The change will not affect existing saved games: I cannot now recall whether this setting can be modified in the advanced settings dialogue, which would allow it to be changed in existing saved games.

Offline Ranran

  • Devotee
  • *
  • Posts: 978
  • Languages: ja
Re: Tilting trains not tilting
« Reply #7 on: April 23, 2020, 11:58:32 AM »
I cannot now recall whether this setting can be modified in the advanced settings dialogue, which would allow it to be changed in existing saved games.
Code: [Select]
#progdir_overrides_savegame_settings = 1
#pak_overides_savegame_settings = 1

By enabling the settings related to this, you can overwrite the settings in simuconf.tab even after the game starts.

Offline Freahk

  • Devotee
  • *
  • Posts: 1055
  • Languages: DE, EN
Re: Tilting trains not tilting
« Reply #8 on: April 23, 2020, 12:22:26 PM »
The change will not affect existing saved games: I cannot now recall whether this setting can be modified in the advanced settings dialogue, which would allow it to be changed in existing saved games.
It cannot be modified in the dialog.

By enabling the settings related to this, you can overwrite the settings in simuconf.tab even after the game starts.

Exactly.
There is yet another one: userdir_overrides_savegame_settings = 1
If all are set to 1, servers settings will always be up-to-date, whilst server specific changes that differ from pakset defaults should be put in userdirs simuconf.
Sadly, one cannot enforce climate levels in simuconf, or at least I don't know how.

Online Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Tilting trains not tilting
« Reply #9 on: April 23, 2020, 04:01:39 PM »
I tried to hack the xml save, but I cannot load it back even if not modified at all:
Code: [Select]
Warning: karte_t::load: Fileversion: 120004
FATAL ERROR: loadsave_t::start_tag() - expected "/roadsign_t", got "koord3d>
  b�"
Aborting program execution ...

For help with this error or to file a bug report please see the Simutrans forum at
http://forum.simutrans.com
Neúspěšně ukončen (SIGABRT)

Is there some nice explanation what these *_overrides_savegame_settings options do?
If I have simutrans isntlaled in ~/simutrans ?  What takes precedence over what?
I have some non-default settings in the save, is there a way to dump them? Ideally in form of simuconf.tab?

Where could I hack the setting dialog to add the tilting option?

Offline Freahk

  • Devotee
  • *
  • Posts: 1055
  • Languages: DE, EN
Re: Tilting trains not tilting
« Reply #10 on: April 23, 2020, 04:10:35 PM »
I tried to hack the xml save, but I cannot load it back even if not modified at all:
Many text editors will somehow mess up the save. Simutrans is extremely sensitive to the format.

Is there some nice explanation what these *_overrides_savegame_settings options do?
It actually does what it pretends to do. Settings in simuconfs will take precedence over settings stored in the savegame.
For the three different simuconfs the usual rules apply:
games simuconf is loaded first, then paksets simuconf will override these settings and finally users simuconf will override again.

Online Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Tilting trains not tilting
« Reply #11 on: April 23, 2020, 05:29:18 PM »
Many text editors will somehow mess up the save. Simutrans is extremely sensitive to the format.
As I said I cannot load it back even if not modified at all.

Wat's the differnece betwee game's and user's simuconf if game is installed in ~/simutrans ?

Offline Ranran

  • Devotee
  • *
  • Posts: 978
  • Languages: ja
Re: Tilting trains not tilting
« Reply #12 on: April 23, 2020, 05:39:20 PM »
Those 3 parameters need to enable only one correct depending on which folder you have set to save sve files.

Offline Freahk

  • Devotee
  • *
  • Posts: 1055
  • Languages: DE, EN
Re: Tilting trains not tilting
« Reply #13 on: April 23, 2020, 05:55:56 PM »
Wat's the differnece betwee game's and user's simuconf if game is installed in ~/simutrans ?
In that case there is no difference in extended.
Standards userdir seems to be ~/.simutrans, at least that's the case in opensuse.

Online Vladki

  • Devotee
  • *
  • Posts: 3328
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: Tilting trains not tilting
« Reply #14 on: April 23, 2020, 06:48:37 PM »
So It was indeed a bug. Th etilt_min_radius was working as tilt_max_radius. Here is the patch:
https://github.com/vladki77/simutrans-extended/commit/03d368ec9fb29e245c67f33fcd8de56670b3682b

And also added the option to settings dialog:
https://github.com/vladki77/simutrans-extended/commit/7db50c35df065ec44e02f2edf14ebe7caea202c3


Code: [Select]
diff --git a/gui/settings_stats.cc b/gui/settings_stats.cc
index 93d3816c2..7e2a638bd 100644
--- a/gui/settings_stats.cc
+++ b/gui/settings_stats.cc
@@ -241,6 +241,7 @@ void settings_extended_general_stats_t::init( settings_t *sets )
        INIT_NUM("max_diversion_tiles", sets->get_max_diversion_tiles(), 0, 65535, gui_numberinput_t::AUTOLINEAR, false );
        INIT_NUM("way_degradation_fraction", sets->get_way_degradation_fraction(), 0, 40, gui_numberinput_t::AUTOLINEAR, false );
        INIT_NUM("sighting_distance_meters", sets->get_sighting_distance_meters(), 0, 7500, gui_numberinput_t::AUTOLINEAR, false );
+       INIT_NUM("tilting_min_radius_effect", sets->get_tilting_min_radius_effect(), 0, 10000, gui_numberinput_t::AUTOLINEAR, false );
        INIT_NUM("assumed_curve_radius_45_degrees", sets->get_assumed_curve_radius_45_degrees(), 0, 10000, gui_numberinput_t::AUTOLINEAR, false );
        INIT_NUM("max_speed_drive_by_sight_kmh", sets->get_max_speed_drive_by_sight_kmh(), 0, 1000, gui_numberinput_t::AUTOLINEAR, false );
        INIT_NUM("time_interval_seconds_to_clear", sets->get_time_interval_seconds_to_clear(), 0, 10000, gui_numberinput_t::AUTOLINEAR, false );
@@ -361,6 +362,7 @@ void settings_extended_general_stats_t::read(settings_t *sets)
        READ_NUM_VALUE( sets->way_degradation_fraction );
        READ_NUM_VALUE( sets->sighting_distance_meters );
        sets->sighting_distance_tiles = sets->sighting_distance_meters / sets->meters_per_tile;
+       READ_NUM_VALUE( sets->tilting_min_radius_effect );
        READ_NUM_VALUE( sets->assumed_curve_radius_45_degrees );
        READ_NUM_VALUE( sets->max_speed_drive_by_sight_kmh );
        sets->max_speed_drive_by_sight = kmh_to_speed(sets->max_speed_drive_by_sight_kmh);
diff --git a/vehicle/simvehicle.cc b/vehicle/simvehicle.cc
index 609e418e5..1c913ec71 100644
--- a/vehicle/simvehicle.cc
+++ b/vehicle/simvehicle.cc
@@ -1962,7 +1962,7 @@ sint32 vehicle_t::calc_speed_limit(const weg_t *w, const weg_t *weg_previous, fi
 
                        // Adjust for tilting.
                        // Tilting only makes a difference to reasonably wide corners.
-                       if(is_tilting && radius < tilting_min_radius_effect)
+                       if(is_tilting && radius > tilting_min_radius_effect)
                        {
                                // Tilting trains can take corners faster
                                corner_limit = (corner_limit * 130) / 100;