BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Strange acceleration data in train.dat file - what happens internally?

Go down

Strange acceleration data in train.dat file - what happens internally? Empty Strange acceleration data in train.dat file - what happens internally?

Post by Ghost of Kymlinge Sun Mar 08, 2020 7:25 am

I'm looking into the train.dat file, the acceleration section, for a tram I have not created myself. The numbers are somewhat strange, and causes error messages on loading. Nethertheless, the tram is drivable in OpenBVE.

I'm curious to know how this data is treated internally when a1 is always zero and v2 < v1? Are some of the less reasonable numbers replaced by other default values, or is the simulation in this case actually calculating the tram's behaviour from what is in the train.dat file?

This is a table of the values:







P1P2P3P4P5P6
a0444
4
44
a100000
0
v1808080808080
v2102030405060
e1
11111
Ghost of Kymlinge
Ghost of Kymlinge

Posts : 8
Join date : 2020-02-17
Age : 56
Location : SkellefteƄ, Sweden

https://openbve.net/

Back to top Go down

Strange acceleration data in train.dat file - what happens internally? Empty Re: Strange acceleration data in train.dat file - what happens internally?

Post by Phonteus Nevolius Sun Mar 08, 2020 10:58 pm

It might come from the BVE2 times when tutorials and localised specifications were scarce and developers just didn't have enough information.
Phonteus Nevolius
Phonteus Nevolius

Posts : 111
Join date : 2017-10-05
Location : Hungary

https://phonteusnevolius.wordpress.com

Back to top Go down

Strange acceleration data in train.dat file - what happens internally? Empty Re: Strange acceleration data in train.dat file - what happens internally?

Post by leezer3 Mon Mar 09, 2020 12:39 pm

Looking in the parser, the following happens:

As a0 is zero, a constant 1.0 is used:
https://github.com/leezer3/OpenBVE/blob/master/source/OpenBVE/Parsers/Train/TrainDatParser.cs#L927

As v2 is less than v1, it is replaced by v1:
https://github.com/leezer3/OpenBVE/blob/master/source/OpenBVE/Parsers/Train/TrainDatParser.cs#L212

leezer3

Posts : 1785
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Strange acceleration data in train.dat file - what happens internally? Empty Re: Strange acceleration data in train.dat file - what happens internally?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum