Open goodgerster opened 3 years ago
I think the easiest way to do that is to add a condition to apply realistic braking only if GetAccelerationType returns 2 or less
Unfortunately the only valid values are 0, 1, and 2. There aren't any extra acceleration types. Wired and PIPE appear to use type 2 (maglev).
I’ve (tried to) read the code that computes braking force, and it looks to me like it’s equal to acceleration force in all cases, which (while not physically accurate) ought at least to produce a symmetric speed graph. It seems maglevs get special treatment to correct what I assume is similarly incongruous behaviour from them. So I’m not sure what’s going on with this.
Tractive forces and acceleration are calculated in a simpler way for maglevs than the other two acceleration types, so the deceleration code matches that.
Deceleration is currently capped at an acceleration-type specific value. Acceleration isn't currently capped. There is room for improvement here. Mostly I've been focused on the other end of the scale with ordinary rail slow/heavy freight and passenger trains. Even without any capping, the speed graph is not symmetric because drag forces (part of which are proportional to v^2) have a large impact at higher speeds.
Either way, it would be good if Wired/PIPE/etc were not subject to realistic braking
I've added a per-rail type flag to disable realistic braking physics for trains of that type. For now I've set it by default for the wire and pipe rail types.
Some NewGRFs (notably Wired and PIPE) create railtypes to which train physics should not apply. Wired in particular has a ‘train’ with a top speed of 3000 km/h, weight of 10 t, and power of 45 MW.
I’ve (tried to) read the code that computes braking force, and it looks to me like it’s equal to acceleration force in all cases, which (while not physically accurate) ought at least to produce a symmetric speed graph. It seems maglevs get special treatment to correct what I assume is similarly incongruous behaviour from them. So I’m not sure what’s going on with this.
Either way, it would be good if Wired/PIPE/etc were not subject to realistic braking. I think the easiest way to do that is to add a condition to apply realistic braking only if GetAccelerationType returns 2 or less.
Thanks as always. :)