Page 1 of 1
NEC - Performance increase
Posted: Tue Feb 07, 2012 9:59 am
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)
After: (and playable)
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.
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:
After:

Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 10:11 am
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).
Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 10:15 am
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.
Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 10:27 am
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
Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 10:56 am
by tofwings
Thanks for the info,
Brian
Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 1:15 pm
by chrisreb
Thanks for this will give it a go as I had given up with the Acela because of performance issues.
Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 6:53 pm
by jevon
Thanks, Bill. These edits make a huge difference in performance. Great find.
Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 9:13 pm
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.
Re: NEC - Performance increase
Posted: Tue Feb 07, 2012 9:27 pm
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.
Re: NEC - Performance increase
Posted: Wed Feb 08, 2012 3:13 am
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
