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?

3 posters

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 3:25 pm

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 : 10
Join date : 2020-02-17
Age : 60
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 Mon Mar 09, 2020 6:58 am

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 : 120
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 8: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 : 1978
Join date : 2011-08-24

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

- Similar topics

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