Rivens Train Speed Signs


This mod makes trains respect speed sign values through the circuit network. (youtube demo included)

Content
1 year, 11 months ago
1.1
3.00K
Trains

b [testing] Trains don't respect global speed limit.

2 years ago
(updated 2 years ago)

Main issue :

Trains in my game just don't care about map setting : global train speed limit.

I tried picking up trains and placing them again, but... They just don't care. They exceed it. I'm using Electric locomotive 3 and setting : braking, not throttling.

Side-problem :

Also sometimes train just ignore rail signal... I have chain rail with setting V=80. Train has speed 120 [from previous signal (v=120), that worked fine ] After passing chain rail with setting V=80, it keeps going 120km/h... Maybe mod wasn't tested on 2-way railways? It seems that train ignores signs that are on chain signals that are on 2-way segments.

Game-save, in which train ignores speed limit : https://drive.google.com/file/d/1pdoNon7ezR7Od5fIshQyXxQMnvVAB-j2

You sit in train on manual setting. Just swap manual to automatic. Train should start accelerating up to 120 (it's last passed speed limit), despite starting up near 80-limit sign.

After testing for a while - adding wire that connects signal facing the other way fixes the problem, but I'm not satisfied with it, because I only care about speed limit to work in one direction. It seems like mod finds rail signal near train correctly, but it doesn't care if signal is facing correct side, or if there are more signals.

1 year, 11 months ago

Thanks for reporting this. The underlying code simply checks whether there are any rail-signals (with V-signal) near the locomotive, regardless of the side of the track. This could certainly be improved. By the way: two-way railways do not affect the logic. If the train passes a signal, it will remember the speed-limit value (forever, or until it sees another signal). So when you remove a train, and put a new one on the track, it will not have a speed-limit, until you pass a signal.

The trains are not supposed to ignore the 120 -> 80 speed-limit drop. I'll look into it. I check the nearby rail-signals every few frames. Maybe it somehow misses the signal, but I'd expect that mainly to happen with overly fast trains.

1 year, 11 months ago

I think there is a misunderstanding about the global speed limit, it should be renamed to 'default speed limit' - it is used when there isn't an explicit speed limit set for the train. I'll rename the property in the next upgrade.

I'll look into your save-game later, thanks for providing it!

1 year, 11 months ago

Aaah, this is what it means. It was missunderstanding indeed, I thought it means absolute speed limit.

1 year, 11 months ago
(updated 1 year, 11 months ago)

Fixed both issues you reported:
1. the global speed limit now actually works like a global speed limit, as opposed to a default speed limit.
2. when there are 2 rail-signals on a single track, it will correctly pick up the (lowest) specified value, ignoring the rail-signal without a value.

I think I tested all edge-cases -- could you give it a test too?

1 year, 11 months ago
(updated 1 year, 11 months ago)

It works for my save, though I just did shallow testing. I loaded my bug-report save and first ensured just in case that it doesn't work in 1.6 and then after updating to 1.7 train respects limits just as I would expect it to, so everything seems to be working

I think "global speed" setting (change #1) might have been already set by some players based on what it did. Also I don't know, maybe default speed limit is more useful setting (then absolute max speed), I don't want to have strong opinion.. Maybe I should have just adjusted my in-game setup to what this setting really does.

The change #2 is step in good direction, I believe.

New response