NEC - Performance increase

General discussion about RailWorks, your thoughts, questions, news and views!

Moderator: Moderators

Locked
styckx
Very Active Forum Member
Posts: 3989
Joined: Mon Jul 27, 2009 8:33 pm

NEC - Performance increase

Post by styckx »

Ahhh, the NEC.. This route in general ran ok, but certain scenarios were destroyers of framerates. Acela Express scenario would be the worst offender.. It was unplayable for the most part.

The first.. What this will do is at the start of a scenario turn off every red marker light on the amfleets in the game. Each Amfleet has 4 lights attached to it which are always on, on every single Amfleet in game. Acela Express scenario has 596 amfleets in it.. That's 2,384 additional lights on in the scenario..

Open: Wagon_Script
In: /RSC/Northeast Corridor/RailVehicles/Passenger/Amfleet/Amcoach

Insert this code at the bottom of the script. Put your cursor at the end of "end" hit enter twice, and just paste this in.

Code: Select all

function Initialise ()

Call("Fwd_Taillight_1:Activate", 0 )
Call("Bwd_Taillight_1:Activate", 0 )

end
Before: (and unplayable)

Image

After: (and playable)

Image

You will still have marker lights only at the end of the train when the headlights are turned on. This light is part of the model and not the bolt on type.

Image

The second little tweak. It seems the AEM-7's lights were set to cast shadows. BAD!

Open: Loco_Headlight.bin
In: /RSC/NortheastCorridor/Lights

Change This:

Code: Select all

<CastShadow d:type="bool">1</CastShadow>
To This:

Code: Select all

<CastShadow d:type="bool">0</CastShadow>
Before:
Image

After:
Image
nobkins
Very Active Forum Member
Posts: 4421
Joined: Fri Jun 12, 2009 11:51 pm
Location: Leeds

Re: NEC - Performance increase

Post by nobkins »

I thought all train headlights cast shadows. I get a noticable performance drop on any train when turning headlights on (that has TS2012 headlights).

I did suggest to RSC that a good option in the graphics detail settings would be to have various "light" options.
  • High Quality Lights
  • Player Train Cast Shadows, AI does not
  • Train lights do not cast shadows (AI or Player)
Obviously the wording needs tweaking but you get the idea.

I just got the generic email back so I don't think it was taken seriously. As shadow casting lights are such big performance hitters it would seem a good way to allow trains to be setup with hi quality shadow casting lights yet still allow the player to choose when they are used (all the time, Player train only, no trains).
TrainSimDev.com The community dedicated to those who create content for any Train Simulator.
Includes: Free downloads via torrent or browser, forum browsable by all, membership by invitation (any member can invite someone)
styckx
Very Active Forum Member
Posts: 3989
Joined: Mon Jul 27, 2009 8:33 pm

Re: NEC - Performance increase

Post by styckx »

Shadow casting lights should be disabled at the core, there is absolutely zero beneficial purpose for them at this point. Best would be to implement an override option in the game settings to have lights set to cast shadows to instead not to. 1 shadow casting headlight will drop framesrates by around 6-10fps on average.. For those with lower end systems that's the difference between playing and enjoying a scenario, or playing and suffering through one.
nobkins
Very Active Forum Member
Posts: 4421
Joined: Fri Jun 12, 2009 11:51 pm
Location: Leeds

Re: NEC - Performance increase

Post by nobkins »

Sounds like we both live in hope of them implementing an option for the user to choose if shadow casting lights actually do cast shadows or not.

I have no problem leaving the ability enabled in core just give the user control over when it is enabled.

I wonder if this is something that RWTools could do or maybe that new batch bin editor. Should be a simple search and replace I would have thought.

Jim
TrainSimDev.com The community dedicated to those who create content for any Train Simulator.
Includes: Free downloads via torrent or browser, forum browsable by all, membership by invitation (any member can invite someone)
tofwings
Established Forum Member
Posts: 314
Joined: Tue Jun 15, 2004 12:21 pm
Location: Wolverhampton

Re: NEC - Performance increase

Post by tofwings »

Thanks for the info,

Brian
chrisreb
Very Active Forum Member
Posts: 3134
Joined: Fri Oct 17, 2008 10:48 am
Location: Southampton UK

Re: NEC - Performance increase

Post by chrisreb »

Thanks for this will give it a go as I had given up with the Acela because of performance issues.
User avatar
jevon
Established Forum Member
Posts: 420
Joined: Fri Jan 30, 2009 9:24 pm
Location: SoFla

Re: NEC - Performance increase

Post by jevon »

Thanks, Bill. These edits make a huge difference in performance. Great find.
- Jev H.
Before you seek to enlighten him, walk a mile in the other guy's shoes.
i7-2600k @4.7GHz / Asus P8P67 Pro rev 3.1 / eVGA GTX580 1.5G
8GB Corsair Vengeance / Crucial M4 256G/512G / Antec Kuhler 920 / WIN7-64
User avatar
Shadders
Established Forum Member
Posts: 322
Joined: Sun Oct 14, 2007 7:58 pm

Re: NEC - Performance increase

Post by Shadders »

Thank you so much Bill!

I have no idea how you managed to track down the problem to four lines of lua, but I'm really glad you did.
I have to admit that the first thing I do with any new loco now is check all the lights for shadow casters and turn them off, just too much a frame rate hit.

Cheers,

Shad.
styckx
Very Active Forum Member
Posts: 3989
Joined: Mon Jul 27, 2009 8:33 pm

Re: NEC - Performance increase

Post by styckx »

Shadders wrote:Thank you so much Bill!

I have no idea how you managed to track down the problem to four lines of lua, but I'm really glad you did.
I have to admit that the first thing I do with any new loco now is check all the lights for shadow casters and turn them off, just too much a frame rate hit.

Cheers,

Shad.
:) You're welcome. Didn't just figure it out, the lights were always known to be a major issue. You could delete them, but that's rather drastic and could cause issues with stability among other things. Was just recently I started picking up dribs and drabs of lua scripting. Second thing I did was turn off the Amfleet lights via the script because they all don't belong on, all the time, on every amfleet. Just reminded myself this morning about the performance bump when I accidentally played the Acela Express scenario and could actually play it!

Explaining how to insert 4 lines of lua is 100x easier (and more safe) than explaining how to remove 100 lines of child objects in the blueprints for two coaches. :)

Glad it's helping people though! I was happy myself that I could finally play scenarios I gave up on ages ago.
MisterWho
Established Forum Member
Posts: 477
Joined: Fri Sep 10, 2010 4:02 am

Re: NEC - Performance increase

Post by MisterWho »

Bill,
many thanks for this tip. As a result, I might actually buy the NEC route in the next RS.com sale instead of leaving it on my "do not buy" list ...

regs,
moi

:lol:
Locked

Return to “[RW] General RW Discussion”