I read articles about train deceleration. Generally irl, there is deceleration limit around 1ms^2. Some freight trains have it lower (0,6ms^2), some EMU's higher (1,3ms^2). This is because some surface steel coefficient blah blah and other complicated reasons.
As everybody knows, train acceleration in ttd isn't real on any meaningful scale. Deceleration is just a bad joke. So I picked one scale, which is time in seconds. I will ignore ttd days since now (they can be changed via daylenght patch anyway).
Reason why the acceleration is wrong - it counts ticks as seconds. So we have quite good model, but it's scaled "wrong" for gameplay purposes. Here is my first attempt to do something about it.
- computed acceleration in YAAM is in real seconds, instead of seconds substituted by game ticks.
- trains see 3 tiles ahead (when it's enabled in Yellow PBS settings, this has side effect, that it enables sooner acceleration too, I will separate this later) - they can attempt to brake sooner on yellow/double yellow signals.
- there is assumption, that every engine and wagon has brakes with force 1kN per 1ton of weight, which results in 1ms^2 deceleration.
- engines have additional dynamic brake, this is basically old method of braking scaled to seconds.
Some of my observations:
To test this, I built something similar to Circular particle accelerator
Trains with less wagons have shorter braking distance - dynamic brake reason.
AsiaStar without wagons going 265km/h (max speed) needs 35 tiles to stop.
Maglev Lev4 of lenght 8 (2x loco and 14 empty wagons) needs, ~60 tiles to stop.
According to seconds point of view, tile has ~18 meters.
Things I think about adding in next version:
Make that unsafe version with trains passing red lights.
Introduce emergency braking on red signals - by breaking down the train. This will be nice, because emergency brake needs some time to be released. On safe version, train will break down. On unsafe train will break down and pass the red signal.
Gradually braking in front of red signal, something like - planned speed 1 tile before red signal will be 20km/h, 2 tiles 30km/h etc.
I might be wrong, but tunnels and brigdes most likely don't understand my 3 tiles ahead thing. <- fixing this, making 3 tiles configurable and try to make repeating signal
But I must ask if this is taking the train characteristics into consideration?
Almost all DMUs and EMUs have close to instant brake response since their brakes are controlled electronically (and most even have magnet brakes for use in emergencies).
But then we have the traditional locomotive(s) and wagons trains that use air preassure to controll their brakes. Longer train = longer brake response.
And, of course, the train's total weight has a very high impact on its stop distance.
I'm not sure, if brake delay isn't more annoying than wanted feature. It complicates whole idea, and simulating pipe pressure is little overkill for me, when you can't control trains. I'm little lost at weight. Do exist brakes depending on train load? I mean when wagon is fully loaded, then it would unlock more braking power, because there is more adhesion..? (even if doesn't this patch acts like it does
here is patch including yellow pbs and yaam.
Edit attached NewGRF with signal sprites.