A newer version of OpenBVE

View previous topic View next topic Go down

A newer version of OpenBVE

Post by graymac on Sun Jul 27, 2014 8:10 pm

Noticed on a visit to the UK Train sim board:

by BVECOLORADO on Mon Jul 14, 2014 1:22 am
A new version of openBVE, v143a by Chris Tarana AKA CT1660 has been posted at
http://obts.wikia.com/wiki/OBTS_Wiki#OBTS_Programs_.26_Documents

This new version allows openBVE to use more than 2GB of RAM, if installed.
On my PC, the FPS seems improved by roughly 33% compared to v1430.

I haven't yet downloaded or tried it myself, but the performance boost looks worthwhile.

graymac

Posts : 1708
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: A newer version of OpenBVE

Post by leezer3 on Sun Jul 27, 2014 8:35 pm

Interesting, I wish he'd posted the source code, but if all that's been changed is the large address aware flag, this is likely to be hokum....
(For that matter, I'm not sure *any* route currently manages to munch over 2gb of RAM)

As it's packaged with no source it's very hard to get anything of any use; C# can be decompiled without much trouble, but doing a diff on decompiled versus raw source code isn't going to do squit Razz

I did build against OpenTK a while back, which would be more likely to give performance gains. I'll try and dig that out and do some testing.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 750
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: A newer version of OpenBVE

Post by graymac on Sun Jul 27, 2014 8:44 pm

Yes, I thought it might be (potentially) of interest. Mr Colorado has reported an improvement of FPS in use, so it's worth checking out. I'm assuming this download is a "fork" compiled by a USA enthusiast - I don't follow the US scene.
I might find time to give it a go later in the week and do a simple FPS comparison using one of my routes.

graymac

Posts : 1708
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: A newer version of OpenBVE

Post by leezer3 on Sun Jul 27, 2014 9:11 pm

OK, sorry looks like the source is included. (Didn't look hard enough!)

At the moment, his compiled source is running at ~40fps with my default settings after loading the Plymouth route.
Compiling myself gives me ~30fps.

He's done something funky when building, but I can't say that I'm sure what. Changing the LBA flag isn't doing anything for me....
The only really significant change is changing the target framework to .Net 4 instead of .Net 2, and as his source gives me lower FPS when compiled myself, there may have been other changes??

I'll investigate, but I don't do low-level stuff nearly so well.

Edit:
The source included is identical to the official, so I suspect it's not the one he built from....

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 750
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: A newer version of OpenBVE

Post by Dexter on Mon Jul 28, 2014 8:06 am

Interesting. It would be worth it having the new source code. After all, openBVE has always been open source, so there's nothing to be worried about regarding copyright etc.

Dexter

Posts : 1780
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: A newer version of OpenBVE

Post by LabRatAndy on Mon Jul 28, 2014 9:26 pm

leezer3 wrote:
The only really significant change is changing the target framework to .Net 4 instead of .Net 2, and as his source gives me lower FPS when compiled myself, there may have been other changes??
I was under the impression that the newer versions where already compiled to target .net 4.
May be the only change is the large address aware flag, sadly I've no idea what this actually means and what what if any difference it would make to performance.

LabRatAndy

Posts : 95
Join date : 2011-08-29

Back to top Go down

Re: A newer version of OpenBVE

Post by leezer3 on Wed Jul 30, 2014 11:55 pm

LabRatAndy wrote:
leezer3 wrote:
The only really significant change is changing the target framework to .Net 4 instead of .Net 2, and as his source gives me lower FPS when compiled myself, there may have been other changes??
I was under the impression that the newer versions where already compiled to target .net 4.
May be the only change is the large address aware flag, sadly I've no idea what this actually means and what what if any difference it would make to performance.

Not sure, I didn't follow the release requirements closely Smile
The original aim was definitely to target .Net 2 though.

The large address aware flag is simply a few bytes in the application header that tells the .Net runtime that it's able to access more than 2gb worth of RAM. On x64 systems, this gives a maximumum RAM usage of 4gb, and on x32 systems, in theory it can use anything that the OS isn't/

It's highly unlikely to me making any sort of difference- I don't know of any route that uses more than a couple of hundred megabytes.
 The best I can say at the moment is that he's probably made changes that aren't in the included source, as that seems to be identical to the official one, and compiling it myself with the LBA flag gives a FPS figure about a third lower than the one he's compiled.

I compiled with VS2010 and the default compiler options, and haven't tried playing with agressive compiler optimizations at the minute, I'll try those at some point and report back Smile

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 750
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: A newer version of OpenBVE

Post by Quork on Thu Jul 31, 2014 6:29 am

The last big project Michelle executed before leaving us (I still hope she will show up some time, and be it anonymously... Most of us do live her freedom vision!) was to switch to .NET 4

Quork

Posts : 1031
Join date : 2012-05-05
Age : 25
Location : Frankfurt am Main (Frankfurt on Main), Hessen (Hesse), European Union (Deutschland (Germany))

http://www.parkbahnschmiden.de/

Back to top Go down

Re: A newer version of OpenBVE

Post by Quork on Wed Aug 06, 2014 5:59 pm

Finally got around to testing it thoroughly myself. Suddenly I'm well able to drive Les Taux-St Julien with "fluid" fps, never dropping below 20! That's great news.

Quork

Posts : 1031
Join date : 2012-05-05
Age : 25
Location : Frankfurt am Main (Frankfurt on Main), Hessen (Hesse), European Union (Deutschland (Germany))

http://www.parkbahnschmiden.de/

Back to top Go down

Re: A newer version of OpenBVE

Post by Dexter on Wed Aug 06, 2014 10:25 pm

That sounds interesting, I am curious to test it myself when I get back home (Sun / Mon).

Dexter

Posts : 1780
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: A newer version of OpenBVE

Post by phileakins on Thu Aug 07, 2014 9:16 pm

Well, I'm impressed!

I've never driven Anthony B's route into Birmingham NS without screen 'stutter' until now. A solid 60 FPS throughout.

Phil

phileakins

Posts : 89
Join date : 2011-08-08
Age : 69
Location : Swanage, Dorset

Back to top Go down

Re: A newer version of OpenBVE

Post by graymac on Fri Aug 08, 2014 9:51 pm

I used the Cwm Twypsin route from Abergavenny and the Class 175 Arriva to compare fps. The newer version returned a solid 60fps. Nothing more, nothing less.
Yet curiously, the v1.4.3 version fps varied quite widely. Between 60 & 80 fps yet never less than 60.
So I really don't know what to think, just say "the jury's out".

graymac

Posts : 1708
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: A newer version of OpenBVE

Post by Quork on Fri Aug 08, 2014 10:11 pm

Sounds like you have vertical synch on in the newer version's settings, which caps the fps on the screen refreshment rate.

Quork

Posts : 1031
Join date : 2012-05-05
Age : 25
Location : Frankfurt am Main (Frankfurt on Main), Hessen (Hesse), European Union (Deutschland (Germany))

http://www.parkbahnschmiden.de/

Back to top Go down

Re: A newer version of OpenBVE

Post by graymac on Sat Aug 09, 2014 4:06 pm

Sounds like you have vertical synch on in the newer version's settings, which caps the fps on the screen refreshment rate.
Yes, you're right. I unchecked it (it was the default option it seems) and I'm getting 86-107fps on the same bit of route.
So there is a measurable  improvement after all.

graymac

Posts : 1708
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: A newer version of OpenBVE

Post by Dexter on Wed Aug 13, 2014 12:29 pm

Well, this has put an end to my testing so far. The Microsoft link is not very useful (as usual), I tells me to write a script, I suppose?


Dexter

Posts : 1780
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: A newer version of OpenBVE

Post by Quork on Wed Aug 13, 2014 2:21 pm

My first guess would be to simply reboot, my second one to reinstall .NET

Quork

Posts : 1031
Join date : 2012-05-05
Age : 25
Location : Frankfurt am Main (Frankfurt on Main), Hessen (Hesse), European Union (Deutschland (Germany))

http://www.parkbahnschmiden.de/

Back to top Go down

Re: A newer version of OpenBVE

Post by phontanka on Wed Aug 13, 2014 8:34 pm

I got the same error message as Dexter.

phontanka

Posts : 215
Join date : 2012-05-08
Location : Hungary

http://phontanka.wordpress.com

Back to top Go down

Re: A newer version of OpenBVE

Post by Dexter on Wed Aug 13, 2014 9:01 pm

@Quork: Nope, that does not work. I do have .NET 4.5 (I think there is 5.0 on the market already), and the openBVE is supposed to be targetting 4.0. Everything else is working without any issues and reinstalling .NET is a major pain in the lower back.

Dexter

Posts : 1780
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: A newer version of OpenBVE

Post by Dexter on Wed Aug 13, 2014 9:06 pm

Just tried on another PC, same result.

Dexter

Posts : 1780
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: A newer version of OpenBVE

Post by leezer3 on Wed Aug 13, 2014 10:15 pm

http://blogs.msdn.com/b/drew/archive/2009/12/24/xunit-and-td-net-fixing-the-attempt-was-made-to-load-an-assembly-from-a-network-location-problem.aspx

Wink

It's the Windows security attempting to block files downloaded from the internet.
Absolute utter pain in the neck, I turn it off as soon as I can.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 750
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: A newer version of OpenBVE

Post by Dexter on Wed Aug 13, 2014 11:09 pm

I tried to unblock it, but I got a message "openBVE stopped working" anfd the sim crashes with no message. Could by a firewall setup, I will check it again at home.

Dexter

Posts : 1780
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: A newer version of OpenBVE

Post by phontanka on Fri Sep 05, 2014 10:53 pm

I unblocked the DLLs today and tested this build. It increases the FPS three to five times, for example the FPS went above one thousand using bilinear mipmapping on the Ferencháza-Vécse line is OpenBVE 1.4.3a, whereas it is just above 300 in 1.4.3.

It would be great if the latest source code was included.

phontanka

Posts : 215
Join date : 2012-05-08
Location : Hungary

http://phontanka.wordpress.com

Back to top Go down

Re: A newer version of OpenBVE

Post by Ad1992 on Sat Sep 06, 2014 4:22 pm

Tell me Phontanka, what are the differences in fps when you run my central line on each bve version?

Ad1992

Posts : 231
Join date : 2012-06-04

http://bvewr.webs.com/

Back to top Go down

Re: A newer version of OpenBVE

Post by leezer3 on Sat Apr 25, 2015 3:00 pm

I've been playing with the main OpenBVE source over the last few days, and I now understand why this version is faster Smile


Technical details for those interested:
Originally BVE2/ BVE4 were developed on Windows only, and thus route/ object files were not case sensitive when loading objects/ textures, so for example both of these would resolve to the same item:
Code:
.freeobj(0) object\example\example.b3d
Code:
.freeobj(0) object\example\EXAMPLE.b3d

On Linux/ OSX filenames are case-sensitive, and thus, EXAMPLE.b3d & example.b3d are two different and distinct files.

Michelle chose to implement her own path combination & resolution namespace, rather than relying on System.Path to allow for accessing older routes transparently on Windows/ Linux.

Let's go back to our example above; We want to load this file:
Code:
Object\Example\ExamPle.B3D

Note the case of all three parts (Incredibly irritatingly, NTFS stores the case, but Windows ignores it) Smile
We reference this in our routefile like this:
Code:
object\example\example.b3d

Michelle's implementation requires several loops:
First, it looks to match the top-level directory, but attempting a string match-
Object does not match object
It then runs through all the possible case variations of Object, until it finds the correct match.
This alone requires a possible maximum of 64 loop itinerations.

This process is repeated for any subdirectories and the filename/ extension.

This means that our object requires a total theoretical maximum of 328 itinerations to load.
Now, obviously it'll actually take less than this, but each check requires CPU cycles and disk accesses

Expand this by a thousand objects, each containing ~10 paths, each of which is evaluated as the sim loads the object, and it's easy to see why this can be a potential source of slowdowns.

The linked build (1.4.3a) changes OpenBVE to use the System.Path library rather than Michelle's implementation (OpenBVEApi.Path)
This approach works perfectly on Windows, but on Linux or Mac will result in failure to load files and textures for which the cases on disk and in the route/ object files don't match.


I haven't got as far as digging my way through the rest of what's been done, but the path resolution changes are almost certainly going to be one of the biggest causes of the FPS increase.
I think there's also been a few changes to the way certain memory objects are assigned [Copying variables rather than using the ref parameter], which are also going to be having an effect, but the path resolution changes really stand out to me Smile

The main reason I've been playing with this is because I've been fiddling with API improvements.
I'm not posting anything public at the minute, but I thought that the technical details of what I've found might be of interest to some people Smile

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 750
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: A newer version of OpenBVE

Post by Ad1992 on Sat Apr 25, 2015 4:24 pm

Very interesting keep it up. Anything that alleviates the lag on my central and future routes is good. Smile

Ad1992

Posts : 231
Join date : 2012-06-04

http://bvewr.webs.com/

Back to top Go down

Re: A newer version of OpenBVE

Post by Sponsored content Today at 10:24 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


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