Does Adding Lots of Rolling Stock Bog Down the Computer?

As a beginner, I am finally able to enjoy running trains. I have been practicing on the Mojave Subdivision. This subdivision could literally hold thousands of freight and passenger cars in its yards and spurs. If I were to gradually add a lot of cars, and locomotives, does this bog down the computer, or cause any kind of problems?

I am not referring to downloading, only adding lots of copies of cars already available.

Dean
 
Having rolling stock on sidings does have a performance impact even if they aren't in sight. There was a thread recently on this.

Basically the AI has to keep track of them.

If you could get scenery versions and drop them on the tracks the impact would be much lower.

Having said that a high end machine might not blink anyway.

Cheerio John
 
One word, yes. Locomotives more so than vehicles probably. I must confess I must have lots of interactive dustries, rolling stock and locomotives. I have come up with a solution of sorts though. You need some skill at route building although but I self taught myself. I can do track and some pretty basic painting and terrain to make it look better than a bare baseboard but the track is the main thing. Anyway I,m going off topic. I create a yard and maybe a MPD (motive power depot) and start a session with everything on one or two baseboards in an out of the way place. OK, so it is pretty laggy but that makes the rest of the route better. If you download "GHOO" megaroute you will see what I mean. Travelling from Clarkesville to Millhurst there is a short branchline on the left which leads to a bare baseboard containing sidings, turning circle and a waste disposal chute (really!) Thats the route I,m working on now and I,ve added 2 further boards at the "Mainline" end and 1 at the Gladston end for a freight yard, ECS sidings, 2 steam and one diesel servicing point, 2 more turning circles and 4 portals for future operations. Going off track again. But you get the idea. Now what was
the question again?:)
 
Yes, dependent on your system. Once you get over 10 AI consists it starts to slow it down (FPS).
Sniper297 has a sleep script that works on cars/wagons not coupled to a loco, so lessening the impact.
 
http://forums.auran.com/trainz/showthread.php?t=76129

The AI doesn't HAVE to keep track of all the loose consist cars everywhere on the route, it only does it because the developers didn't bother to make the program more efficient.

Download station, search category rolling stock, username sniper297. All those cars have Justin Cornell's "Sleep Script" which sets the handbrake and disables the physics when the car is not coupled into a train with an engine. The carfizzix.gs file can be copied from any of the boxcars to other cars, add lines to the config.txt;

script "carfizzix"
class "fizzix"

If those other cars already have scripts change the config.txt lines to those two lines, and edit the carfizzix.gs file to add;

include "originalscript.gs"

class fizzix isclass originalscript {

"originalscript" being whatever the name of the original script is, see the reefers and grainhoppers for examples.

Not a panacea, polygons is polygons so if you use 2000 freight cars in a yard it will bog down the GPU when the camera view is facing the yard, what this fixes is the way Trainz is programmed to constantly hammer the CPU with
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
even when the blasted thing is 30 miles away. Also doesn't do anything for the AI, since AI trains by definition DO have an engine and are supposed to be moving so the physics for all those are always loaded. That should also be more efficient, most train and flight simulators have a lower load "basic rough calculation" type program when the vehicle is outside the "player bubble" (in TS2010 that's a max of 5000 meters) only switching to more precise math when the vehicle is within a certain radius of the player. Sleep script don't do anything for that, and I haven't found any other kind of kludge for it yet.
 
Last edited:
Wiley4 and magicland have made a lot of non-functional rollingstock scenery in the form of track splines that you can fill your yard with without much of an fps hit. Examples of each are 4 car1 box rail,<kuid2:45203:672:1> and PRR hopper rail,<kuid:58843:38026>.

Bob Weber
 
Thanks, Jim for making this available. This will definitely help with the physics monitoring of all the cars scattered all over the routes.

John
 
Thank Justin Cornell, he did all the heavy lifting. :cool: Next step is to somehow someway do something about AI trains so we can run twenty passenger trains and thirty 100 car freight trains at the same time, and get the game to only hog system resources for the ones that are actually in sight. Toss in 100 streetcars and interurbans cruising around the streets, get rid of them horseless carriage contraptions. :hehe:
 
What about scripting?

On what I hope is a related note, does the presence or absence of elaborate scripts for rolling stock, including long lists of available queues, extensions, etc. (clouds of dust, sound effects, opening doors) add to the overhead? I've made a point of deleting all such scripting when installing rolling stock, and if it's too extensive to delete I just don't install that rolling stock. But this is just based on a gut instinct that each car on the layout is going to take up a certain amount of processing time in checking for whether or not a script is being triggered. Any real evidence one way or another about this?

Lamont
 
Every locomotive is scripted, even if it doesn't have a script in its folder. Its script is "locomotive.gs" and it is situated in "scripts" folder of your trainz installation. Other rolling stock is scripted with "vehicle.gs", and its interiors are scipted by "cabin.gs" (loco's interior with "defaultlocomotivecabin.gs", steam loco's with "defaultsteamcabin.gs").

does the presence or absence of elaborate scripts for rolling stock, including long lists of available queues, extensions, etc. (clouds of dust, sound effects, opening doors) add to the overhead?
Some of them do, and some of them only increase the time to load session. Also, clouds of dust consume resources independently from script (on account of their polygon count).

PS I've checked script that simultaneously recalculated swaying of 1600 vehicles (for each vehicle its own new position, every 0.1 second) - FPS was reduced from 60 to 15, but not lower.

what this fixes is the way Trainz is programmed to constantly hammer the CPU with
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
LOAD CAR 29834 PHYSICS IS IT MOVING YET?
it is possible to switch off the physics calculation for any vehicle. And i'm sure that switch-off-physics rules exist on DLS. But it is not possible to move a loco with switched off physics - it is sticked.
 
Last edited:
I am pretty sure that just having an extremely large Local file bogs down Trainz.

If you use Iportal, and create a yard route called "Staging Yard" and store all your railcars & loco's there ... you can send consists via Iportal to your route that you want to run, and versa visa:hehe: vice versa
 
Thats a cunning plan Cascaderail. Havn,t used Iportal so I need a bit of self training. The other thing is don,t you need 2 computers to do that?
 
Haven't figured out the point of Iportals yet, I create a train on my computer and send it into an iportal so that train appears on someone else's computer? Aside from the novelty for kids, what's the point of trading moving trains on the internet? If it could solve the AI traffic problem somehow that would make it worth looking into.

http://www.trainsim.com/vbts/showthread.php?303107-Testing-123-how-to-run-tests

Used AI traffic as an example for how to run tests in a way that you're actually proving something rather than just fooling yourself into seeing what you want to believe. :hehe: Same thing with scripts, to actually find out what impact they have you need to do destructive testing - make a test route with 2 mile long 32 track yards, load up one session with 2000 cars that have complicated scripts, then another session using clones of those cars with no scripts, observe results. Justin and I spent several weeks doing exactly that kind of testing on cars with no scripts, cars with normal animation scripts, cars with the sleep script, cars with both the sleep script and the original animation script, testing with up to 5000 cars at a time to make sure we weren't just having a fantasy about this, it actually DOES make a dramatically measurable difference in FPS.


"it is possible to switch off the physics calculation for any vehicle."

Yes, that's what the sleep script does.

"And i'm sure that switch-off-physics rules exist on DLS."

I'm not sure, got a KUID number for a rule that does it? If I had known about one that worked I wouldn't have bothered with the sleep script since it would be simpler to use a session rule.

"But it is not possible to move a loco with switched off physics - it is sticked."

I didn't bother with locos, the biggest hit comes when you have a big route with hundreds of industrial spurs and dozens of routes with 500 or more freight cars sitting around waiting to be switched (shunted). You rarely have more than a dozen locos for the player to drive sitting around here and there, so it's not really needed for locos.

One thing I did try was making an AI specific engine spec, removing all the throttle, dynamic, and brake values so there was nothing left but the basic controls needed for DCC mode. Made no measurable difference when running 25 to 50 AI trains simultaneously, framerates are the same with the full engine spec as they are with a stripped down engine spec. Might be worth looking into, possibly there's other stuff involved, altho I also tried it with the old low poly "sliding disk wheels" paintshed skins for AI trains, no measurable difference there either.
 
Last edited:
Colourlight: I’m speaking as a TRS-2006 user, but I love the I-Portals. I have many routes all are I-Portal equipped. You can send consists from one route to another on the same PC. The disadvantage is that if your cars and locos use auto numbering they will renumber as they come out of the I-Portal on the new route. But, I think they do that whenever you save a session in a route and then reopen it anyhow. If cars depart route 1 loaded with cement then they will arrive on route 2 loaded with cement, etc. That’s great. With I-Portals you can operate a national railway system without building one single very large route. I have US routes set in all areas of the country. Most are payware or free routes that I have modified to suit my needs. If a route came with regular portals rather than I-Portals or had no portals at all then that is the first thing I changed. It would be great if you could put a large number of consists on one route and it still not bog it down, but I hasn’t happened yet. Setting up the I-Portal in Surveyor is pretty simple. You give it a portal name and ID. You can set to which portal the consist is to be sent in Surveyor. But, even if you do and change your mine, you can redirect the consist to another destination I-Portal in game before you allow the consist to enter the I-Portal.
 
Here is a hypothetical situation:

Suppose I have five consists on a route. Four of the consists will never change. (They will move, but they will not change cars, locomotices, etc.) The fifth consist has fifty freight cars. Suppose I run the fifty car train, and drop-off one freight car at each spur.

After this is finished, I now have fifty-five consists instead of five, but I still have the same number of cars and locomotives. Will the computer run just as fast, or does the number of consists slow it down?

Dean
 
Good question. For Central Portal Control "CPC Emit Train on Trigger" that would make a difference. Central Portal Control settings;

Maximum trains on route -

Remove excess trains -

Remove which train -

"Maximum trains on route" defaults to 25, can be set to a max of 99.

"Remove which train" options are last created or oldest.

"Remove excess trains" options are yes and no. As near as I can tell that switch is busted, yes means yes and no means yes, excess trains will be removed even if you don't want them removed. So you need to choose either last created or oldest, if you choose oldest it will remove the oldest one already on the route, if you choose last created it will refuse to spawn a new one if the number of trains on the route meets or exceeds the "Maximum trains on route" number.

Where the problem comes in, every consist is counted as a train, so if you're using CPC and split one consist of 50 cars into fifty consists of 1 car each, CPC will count all fifty consists as trains on the route.

Don't take that for the gospel according to the god of coconuts, remember I'm a Trainz n00b and only observed the problem then went back to using regular portals, I have not run exhaustive tests to positively confirm that observation - didn't see a need since I don't intend to use CPC.

Leaving CPC aside, would it have a performance impact? With 50 cars I kinda doubt it, at least none that you could measure. I suspect you'll need to run that test with 10 50 car trains, split up into 500 individual cars, to see any actual difference if it does make a difference.

Be advised you have different factors involved here, the GPU on the video card will bog down with 200+ cars in the field of view, it's the CPU and RAM that get bogged down with physics calculations from all the stuff that's not visible on screen. With that in mind you would probably need to set that up with two 50 car trains each in 5 different yards several miles apart, with a loco in each yard to take the trains apart, and jump from one yard to another after breaking them up. Otherwise 500 cars all in the same yard will bog the GPU down so much it will be impossible to tell what effect, if any, splitting the trains up has on the CPU.
 
Here is a hypothetical situation:

Suppose I have five consists on a route. Four of the consists will never change. (They will move, but they will not change cars, locomotices, etc.) The fifth consist has fifty freight cars. Suppose I run the fifty car train, and drop-off one freight car at each spur.

After this is finished, I now have fifty-five consists instead of five, but I still have the same number of cars and locomotives. Will the computer run just as fast, or does the number of consists slow it down?

Dean

Dean,

Trainz will probably run with little difference in performance with fifty-five consists than it does with five if they are all the same locomotives and freight cars.

The program will only load these meshes once into memory and reference these for the different models on the route the same way it does for cars, trees and scenery objects. The only time you'll see a difference is if all fifty-five of the consists are different.

The impact of the scripting maybe the biggest effect on your system, however, because the program keeps track of the physics and load of each rail car in the simulation.

John
 
I appreciate your answers and explanations. I doubt I ever would divide the train into 50 consists, but it was a good example to use.

I am new to TrainZ, and trying little by little to understand things. I am also an old coot who knows very little about computers, gaming, and things like that. Most of my life was spent when people didn't even know what a computer was. I am really a train fan, not a computer fan.
 
I appreciate your answers and explanations. I doubt I ever would divide the train into 50 consists, but it was a good example to use.

I am new to TrainZ, and trying little by little to understand things. I am also an old coot who knows very little about computers, gaming, and things like that. Most of my life was spent when people didn't even know what a computer was. I am really a train fan, not a computer fan.

Hi Dean,

I'm the opposite who has spent over 25 years supporting computers right down to the hardware level, which when I started were still mainframes connected to video terminals. I actually used to troubleshoot bad chips on the circuit boards. Today is a far cry from what we used to have back in the 1980s. And I can add that I was always a rail fan right from the time I was about 3 years old! :D

Anyway, don't under estimate the number of consists you may have on a route. When your route grows, you'll be placing freight cars on sidings, dragging whole trains across the map and spitting out new consists from the portals. The next thing you know, you'll have more than fifty consists floating around. I can say this from experience. My route is now about 188 miles long, based on a drive from end-to-end with the custom HUD enabled to see the mileage.

Along this route, I had placed freight cars on sidings, had various AI drivers driving commuter and long distance passenger consists. In other areas, I had freight yards with some long and short consists of freight cars of various types, and even a periodic coal train spitting out of a portal.

The route does run pretty well, and does get a bit boggy when I came into view of the yards. The performance, however, has improved drastically since the earlier versions of Trainz. When the area is boggy, I tend to be driving a bit slower anyway, which helps a lot. If you think about it, the trains would be moving slower through yard and big junctions anyway, particularly as they approach the passenger terminals as well.

John
 
Torino I,ll take a look at the IPortal tutorial. The only drawback that I can see so far is you have to rely on the internet/server being up. Otherwise it would serve my purpose so I,ll give it a go. I have a lot of rolling stock/ locos on my routes so storing them on another route would work well. I may even do what you do and have 2 proper routes rather than one route and the other one merely a storage facility
 
Back
Top