Trains accelerating too fast
Moderator: OpenTTD Developers
Trains accelerating too fast
Hi,
in a recent discussion over at the German forums it was found that the kinematic model in OpenTTD allowed trains to accelerate much better and faster than the realistic acceleration as implemented in TTDPatch. Since this has quite an impact on set design and gameplay, I toyed around a bit and compared the behaviour of trains in both games. Trains which struggled going across hills or barely reached their top speed in TTDPatch were running without any problems in OpenTTD - so there definitely is a huge and obvious difference. Then I looked at the OpenTTD source. To my limited understanding, the resistance computed for friction and air resistance etc. seems to be much too small. I therefore changed around some of the lines in the acceleration code to get a train behaviour similar to the one found in TTDPatch. The result is a very small patch, which should mainly be thought of as a base for further discussion, rather than a real solution. Being involved in graphics set developments, I'd like to see the acceleration be comparable in both TTDPatch and OpenTTD, making it a easier for set developers to balance the sets.
Regards,
Uwe
in a recent discussion over at the German forums it was found that the kinematic model in OpenTTD allowed trains to accelerate much better and faster than the realistic acceleration as implemented in TTDPatch. Since this has quite an impact on set design and gameplay, I toyed around a bit and compared the behaviour of trains in both games. Trains which struggled going across hills or barely reached their top speed in TTDPatch were running without any problems in OpenTTD - so there definitely is a huge and obvious difference. Then I looked at the OpenTTD source. To my limited understanding, the resistance computed for friction and air resistance etc. seems to be much too small. I therefore changed around some of the lines in the acceleration code to get a train behaviour similar to the one found in TTDPatch. The result is a very small patch, which should mainly be thought of as a base for further discussion, rather than a real solution. Being involved in graphics set developments, I'd like to see the acceleration be comparable in both TTDPatch and OpenTTD, making it a easier for set developers to balance the sets.
Regards,
Uwe
- Attachments
-
- sloweracceleration.zip
- Small patch for slower train acceleration
- (1.03 KiB) Downloaded 175 times
Re: Trains accelerating too fast
Please upload patch files as .diff or .patch, not zipped. That makes it much easier to view them.
Re: Trains accelerating too fast
i'm not entirely sure why you remove the drag area calculation from the non-maglev case, and only apply it to maglevs.
- Emperor Jake
- Tycoon
- Posts: 3440
- Joined: 24 Apr 2007 09:37
- Skype: Discord: Emperor Jake #4106
- Location: Not Actually Japan
- Contact:
Re: Trains accelerating too fast
You could have increased the slope steepness and cargo weight multiplier...
Although you likely knew about these and they didn't provide exactly what you wanted, I could see why you made a patch.
Although you likely knew about these and they didn't provide exactly what you wanted, I could see why you made a patch.
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Trains accelerating too fast
As already mentioned, this topic has been discussed on the German tt-forums. And because Uwe did chose the DB Set´s BR92 as a "standard" for his tests, I´ve been posting its "performance table" there.
Might be of help now, to get the right numbers.


regards
Michael
Might be of help now, to get the right numbers.
regards
Michael
Re: Trains accelerating too fast
@Eddi: I tried to work out some approach that comes close to the behaviour of TTDPatch, and I personally am only interested in trains, not maglevs. I therefore only changed stuff for the non-maglev case. It's only a small hackish kind of solution ATM, for a proper development the thing needs to be approached in more depth.
@Emperor Jake: Of course I could have adjusted the game settings to suit my style of playing. But that is not the point, the problem is that with the same settings as used in TTDPatch (5% slopes), trains behave extremely different. And that is the reason why I changed some pieces in the code to see how a behaviour similar to the one in TTDPatch could be achieved.
mb posted the specs of an engine from the DBSetXL, and testing shows that in TTDPatch these specs are roughly matched by what the engine can haul in the game. In OpenTTD, the very same engine is much more powerful - or rather the resistance forces are much less, so that the engine can pull more load to a faster top speed (read: the engine can reach top speed with much heavier trains). In my opinion, it should be possible to have comparable behaviour in both games, otherwise set design becomes even more of the nightmare it already is.
@Emperor Jake: Of course I could have adjusted the game settings to suit my style of playing. But that is not the point, the problem is that with the same settings as used in TTDPatch (5% slopes), trains behave extremely different. And that is the reason why I changed some pieces in the code to see how a behaviour similar to the one in TTDPatch could be achieved.
mb posted the specs of an engine from the DBSetXL, and testing shows that in TTDPatch these specs are roughly matched by what the engine can haul in the game. In OpenTTD, the very same engine is much more powerful - or rather the resistance forces are much less, so that the engine can pull more load to a faster top speed (read: the engine can reach top speed with much heavier trains). In my opinion, it should be possible to have comparable behaviour in both games, otherwise set design becomes even more of the nightmare it already is.
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Trains accelerating too fast
Emperor Jake wrote: You could have increased the slope steepness and cargo weight multiplier...
May I point out that this is because of the way kinematics had been developed in TTDPatch, and not by sheer coincidence? First, Josef and me resuscitated long-forgotten physics basics, then some real data was gathered, and in the end Josef wrote the proper code for TTDPatch.Uwe wrote: mb posted the specs of an engine from the DBSetXL, and testing shows that in TTDPatch these specs are roughly matched by what the engine can haul in the game.
And no, this was not started as an ill-oriented "realistic" approach (people were complaining about trains racing uphill in original TTD), but simply to make different train sets comparable, in case their authors wanted to, i.e. by applying real numbers for weight, power and tractive effort.
regards
Michael
Re: Trains accelerating too fast
Removing the call to GetAirDragArea adds another problem. The GroundVehicle::GetAcceleration function is shared by both trains and road vehicles. Therefore, not calling GetAirDragArea there reverts the air drag value of road vehicles to the one used by trains. Currently GetAirDragArea returns 120 for trains and 60 for road vehicles. To be consistent with your value (12) and to remove this issue, you could adapt GetAirDragArea to return 12 for trains (train.h) and 6 for road vehicles (roadveh.h).
Edit: The area value for road vehicles (half of the train area) was decided after some testing with high speed road vehicles. As long as the air drag area value allows a road vehicle to get to its maximum speed when using the default coefficient of air drag I don't mind changing it either.
Edit: The area value for road vehicles (half of the train area) was decided after some testing with high speed road vehicles. As long as the air drag area value allows a road vehicle to get to its maximum speed when using the default coefficient of air drag I don't mind changing it either.
Last edited by Terkhen on 30 Oct 2010 12:18, edited 2 times in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Trains accelerating too fast
You should really make a switch in the above patch - TTPatch-compatible acceleration model, Uwe. 
I've looked at the patch and it doesn't look too realistic - full of out-of-thin-air magic numbers.
That said - I'm completely satisfied with the current form of Realistic acceleration. It takes into account all the values new .GRF maker can provide, so the argument that different train-sets are not comparable is not valid.

I've looked at the patch and it doesn't look too realistic - full of out-of-thin-air magic numbers.
That said - I'm completely satisfied with the current form of Realistic acceleration. It takes into account all the values new .GRF maker can provide, so the argument that different train-sets are not comparable is not valid.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Trains accelerating too fast
You´re completely missing the point.SirkoZ wrote:You should really make a switch in the above patch - TTPatch-compatible acceleration model, Uwe.
I've looked at the patch and it doesn't look too realistic - full of out-of-thin-air magic numbers.
That said - I'm completely satisfied with the current form of Realistic acceleration. It takes into account all the values new .GRF maker can provide, so the argument that different train-sets are not comparable is not valid.
Problem is that (train) vehicles in OTTD are still acting quite "unrealistic", which is, firstly, not acceptable by "realism" players, and, secondly, causes problems both for players and grf authors when using them in both programs.
Uwe´s patch might need improvement, but that´s exactly the reason why he did post it here.
regards
Michael
Re: Trains accelerating too fast
Reminds me of... http://iis.fuzzle.org/
He's like, some kind of OpenTTD developer.
Re: Trains accelerating too fast
Attached is a proposed patch that tunes the current OTTD realistic acceleration to make the acceleration "slower". Formulas and constants are conforming to real-life physics as far as the game allows. It doesn't try to imitate TTDPatch behaviour.
-- Michael Lutz
-- Michael Lutz
- Attachments
-
- accel.patch
- git patch, use patch -p1
- (7.74 KiB) Downloaded 144 times
Re: Trains accelerating too fast
I have been testing the performance of both implementations (using this patch). The difference between them and with current trunk is very small.
sloweracceleration: 99,46% of trunk time.
accel: 98,87% of trunk time.
sloweracceleration: 99,46% of trunk time.
accel: 98,87% of trunk time.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Trains accelerating too fast
I compared the patch by michi_cc with the behaviour of trains in TTDPatch, and it looks pretty convincing. I did a test with the BR 92 from DBSetXL (as posted by mb) and the behaviour looks pretty much the same in both the patch by michi_cc and TTDPatch. The only noticeable difference was that the train got stuck on an incline in TTDPatch, where it managed to get up with a crawling 9 km/h in OpenTTD - so it's pretty much the same. I also tested the BR 05 as fast express engine with a unrealistically long and heavy train, and it did not reach full speed in neither version. In fact, it was even a bit slower in OpenTTD. From my personal point of view, that's as comparable to TTDPatch's behaviour as I could want, since my main focus is a comparable acceleration in both variants of the game to make set creation and documentation easier.
Re: Trains accelerating too fast
The differences on slopes are expected as TTDPatch slopes are 5% and OTTD has 3% as default (but changeable via an advanced setting).
-- Michael Lutz
-- Michael Lutz
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Trains accelerating too fast
I´d expect Uwe having been set the same slope value in his tests.Michi_cc wrote:The differences on slopes are expected as TTDPatch slopes are 5% and OTTD has 3% as default (but changeable via an advanced setting).
regards
Michael
Re: Trains accelerating too fast
I just doublechecked on the slope setting, and it was at 5% to reflect the one used in TTDPatch. But as I already mentioned, the train almost stalls when going up that slope (barely reaching 10 km/h), which is fine by me.
Re: Trains accelerating too fast
Given the the acceleration changes caused by this thread somewhat backfired; people complaining trains didn't reach their speed anymore, new changes to the acceleration are suggested. Please have a look at the discussion and binaries at http://www.tt-forums.net/viewtopic.php?p=921774#p921774 and tell us whether the trains are still acceleration slowly enough.
Who is online
Users browsing this forum: Bing [Bot], Ricard and 12 guests