Skip to content

Fixes and stuff - #1439

Merged
leezer3 merged 13 commits into
leezer3:masterfrom
adfriz:fixes-and-stuff
Oct 2, 2026
Merged

leezer3 merged 13 commits into
leezer3:masterfrom
adfriz:fixes-and-stuff

Conversation

@adfriz

@adfriz adfriz commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

assorted fixes and stuff, Maybe useful, if needed can be cherry picked

} else {
CarWidth = a;
CarExposedFrontalArea = 0.65 * CarWidth * CarHeight;
CarExposedFrontalArea = 0.6 * CarWidth * CarHeight;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that's really odd...

Looking back at the original source code from Michelle, the same mix of 0.6 and 0.65 values are used there.
This feels intentional, I'll have to try digging a bit...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just follow the double CarExposedFrontalArea = 0.6 * CarWidth * CarHeight; at line 246 it was set to 0.6 , idk why it set to 0.65 later in the end...

but if im not mistaken this just a variable for air resistance calculations right?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, see my later reply after doing some digging in the decompiler....

}

if (Arguments.Length >= 6 && Arguments[5].Length > 0 && !NumberFormats.TryParseDoubleVb6(Arguments[2], out contactHeight))
if (Arguments.Length >= 6 && Arguments[5].Length > 0 && !NumberFormats.TryParseDoubleVb6(Arguments[5], out contactHeight))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks like copy + paste typos...

@leezer3

leezer3 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

OK, really interesting....

Running BVE4 through the decompiler shows it's not actually using the car width / height/ unexposed frontal area figures at all- The BVE to BVE5 convertor also similarly ignores them.
BVE2 is a bit more difficult to look into, as it's not .Net or VB.

Digging around looking for a copy of the BVE2 train editor at the minute.


Using the 0.65 figure rather than 0.6 gives approximately a 10% increase in wind resistance.

At the minute, I'd actually be more inclined to use the 0.65 figure in the first calculation (where width / height not set at all) and update the documentation with this, simply because a majority of stuff is going to have set the car width / height figures, and thus 'used' the 0.65 number....

leezer3 added a commit that referenced this pull request Oct 2, 2026
…mats

Not supported by BVE, may contain junk data, so disable when hacks on
#1439
@adfriz

adfriz commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

OK, really interesting....

Running BVE4 through the decompiler shows it's not actually using the car width / height/ unexposed frontal area figures at all- The BVE to BVE5 convertor also similarly ignores them. BVE2 is a bit more difficult to look into, as it's not .Net or VB.

Digging around looking for a copy of the BVE2 train editor at the minute.

Using the 0.65 figure rather than 0.6 gives approximately a 10% increase in wind resistance.

At the minute, I'd actually be more inclined to use the 0.65 figure in the first calculation (where width / height not set at all) and update the documentation with this, simply because a majority of stuff is going to have set the car width / height figures, and thus 'used' the 0.65 number....

that unexpected, i thought BVE Trainsim use most of that stuff...


should i change both exposed and unexposed as named constant? maybe it easier to read than putting the value inline

@leezer3

leezer3 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

More interesting yet:
BVETS train editor for BVE2 doesn't add them either.

Looks to me as if they're an OpenBVE addition, just not documented as such....

@leezer3

leezer3 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

should i change both exposed and unexposed as named constant? maybe it easier to read than putting the value inline

To be honest, you might as well leave them alone at this point, other than us standardising on either 0.6 or 0.65 (will require an errata note too....) :)
I have done a conversion of the train.dat parser to block format here:
#1361

Haven't merged at the minute, mostly as converting the object parsers caused so many bugs...
It does have the advantage though of getting that to a clean licence state.

@adfriz

adfriz commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

More interesting yet: BVETS train editor for BVE2 doesn't add them either.

Looks to me as if they're an OpenBVE addition, just not documented as such....

if that code from the old era, maybe michelle was known bve2/4 at the time didn't have correct calculation and just add it?

@adfriz

adfriz commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

should i change both exposed and unexposed as named constant? maybe it easier to read than putting the value inline

To be honest, you might as well leave them alone at this point, other than us standardising on either 0.6 or 0.65 (will require an errata note too....) :) I have done a conversion of the train.dat parser to block format here: #1361

Haven't merged at the minute, mostly as converting the object parsers caused so many bugs... It does have the advantage though of getting that to a clean licence state.

alright.

you can cherry pick other commits if needed, especially the copy paste typo above.

@leezer3

leezer3 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Another point of reference, the earliest saved copy of the original documentation contains these values.
https://web.archive.org/web/20100516145131fw_/http://openbve.trainsimcentral.co.uk/develop/train_train_dat.html

I can't find any mention of them in the developer logs from the old page though:
https://web.archive.org/web/20080501074027/http://openbve.zxq.net/

Sadly the archive didn't save any of the linked source code...
I've got a lot of stuff kicking around, but no really early source code for the sim.

leezer3 added a commit that referenced this pull request Oct 2, 2026
@leezer3
leezer3 merged commit d7fe432 into leezer3:master Oct 2, 2026
5 checks passed
@adfriz

adfriz commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

didnt expect to get merged this soon, but thanks.

@leezer3

leezer3 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Fixes are a lot easier than new stuff.

@adfriz adfriz mentioned this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants