Operation Framerates, phase III

sniper297

Coconut God
Phase I and II here;

http://forums.auran.com/trainz/showthread.php?t=76129

Main problem with Trainz is it was originally designed to simulate small model railroads, and they never programmed in a "player bubble" subroutine that most simulator games have. Anything inside the player bubble, usually a circle 1 to 3 times the maximum view distance, gets all the heavy duty number crunching while anything outside the bubble gets a simplified low memory and CPU usage approximation calculation program. The high level processing doesn't kick in until it gets close to the point where it's actually needed, thus saving system resources for where they are needed close to the player's viewpoint.

Since Trainz loads and fully processes the data for every car and loco and train in the entire session regardless how far away, one solution to the loose consist problem is the "sleep script" described in post 12 and 13 of the above linked thread.

Next problem is AI traffic trains, the sleep script doesn't hurt any but it's no help for AI trains either.

24492290.jpg


30FPS at the start of the session, one 6 car player train and three 6 car AI trains.

47285488.jpg


With one AI train spawning from each end every six minutes, at the 54 minute mark there are 21 six car AI trains running - none are in view, only 3 or 4 are within the 2500 meter visibility radius of the player, but the framerates are down to 16.6FPS due to the CPU loading down with all the calculations for all 21 running AI trains.

Solutions, nothing practical as yet. I've tried cloning engine specs and chopping out all but the basics to make an AI only specific engine spec, can't see that it makes any difference in framerates. Using CPC emit train on trigger would solve the problem for a rapid transit route by limiting the number of AI trains to only the ones near the player, but that would require something ridiculous like 100 spawn and destination portals with triggers and short connecting tracks on both sides every mile or so, along with several weeks or even months of tedious programming and debugging to get it all to work.

The most practical answer is probably some kind of script, but what? The default parse interval near as I can tell is 0.03 seconds, is there a way to script it so the interval is 1 second until it's within 10,000 meter range of the player, then kick over to 0.03? Without derailing or running off path, obviously, I suspect it's possible to increase the timestep to some outrageous number like every five seconds, but that would result in a lot of missed signals and track markers outside the trigger radius.
 
Snipe I am totally with you on trying to work this one out. My Clovis route is out to about 150 miles and test sessions in TS10 and 12 literally grind to a standstill after an hour or so. In camera view there is never more than a couple of trains on screen, and 95% of the time there is just one train in view. This NEVER changes. But as more trains are spawned on to the route from portals the performance drops constantly from silky smooth at the start to stutter...stutter...stall.

The problem is that on the route (though as much as 100 miles from the camera) there are more and more 8,000 foot trainz running at 70 mph, and as you say, Trainz appears to attempt to keep track of every single piece of rolling stock. I know it's the rolling stock because if I try an identical session where each train is replaced by just a couple of locomotives performance remains crisp.

Surely the software could track just the locomotive, or some digital 'equivalent' of the consist rather than constantly making sure that the one hundred and twenty-fifth boxcar in a train 100 miles from the camera is still the specified distance behind it's locomotive (or whatever the heck else it's doing!)

Trainz allows the creation of almost infinite prototypical routes, the performance bottleneck is the performance of sessions on said routes...

Andy
 
Andy, you just said it tries to keep track of every bit of Rolling Stock,

Would they be interactive with industries?



@ Jim, try creating locos and cars with no industry-active capabilities

Jamie
 
Andy... Would they be interactive with industries?

I'm not sure there is any recent rolling stock not set up to be interactive, but in my sessions there is no industry interaction with 95% of trains running portal to portal unchanged...

Andy
 
Yeah, I've tried stuff like simplified consists with no industry interactive cars and them sliding disk wheels, no effect. Looking at this again;

http://en.wikibooks.org/wiki/Trainz/Trainzoptions.txt

I found something that confirms what the monitoring software was telling me about the .03 second parse interval;

"-heartbeat=XXX Specify the time interval at which the physics heartbeat occurs (in seconds). Defaults to 0.03sec. Larger intervals decrease processor usage for physics at the expense of accuracy. Intervals larger than 0.05sec are not recommended. Changing this option is probably unnecessary and may have a negative impact on physics accuracy."

Increasing from 0.03 to 0.05 wouldn't have much impact, so I tried 0.09 and the AI trains tended to get stuck a lot. Increase to 0.30 and they do exactly what I predicted, run red signals, derail, go the wrong way on switches and get lost. So that kills that idea, what's left?
 
Have you tried the Frame Limiter? I have with some improvement at 30fps. I just have a feeling that n3v has not taken full advantage of this since CPU and GPU go down but "some" stuttering remains. If it was on, looks like plenty of available cycles to apply to graphics and other things that are now more of interest to the customer than they may have been in 2004.
 
Doesn't help with my system specs, difference between your computer and mine is like the stomping the Steelers did to Cincinnati last night. :cool: If you're running at 60FPS and get occasional drops to 40 causing stutters the framerate limiter helps, if you're struggling to keep the FPS above 9 limiting the max to 30 doesn't do anything since I don't get up that high with a lot of AI traffic running. I originally envisioned running 10 minute commuters with 5 minute L trains and 15 minute freights on this route, chopped it to 20 minute commuters and 40 minute freights on the main route with no L trains running, different session for the L/subway route with no freight or commuter traffic on the main route. Nowhere near as cool as it should be, but the framerates are unplayable if I try to do it all in the same session. The L/subway sessions are the current problem, 10 minute intervals ain't enough for the era I'm trying to do, but it's almost too much for the program. Currently testing 12 and 15 minute spacing, what I'm hoping for is some way to get a reasonable traffic volume (reasonable for Chicago, not SleepyTown Iowa which has only one railroad running thru it) and keep the framerates up. That's why I posted this, I don't see any practical way to overcome or work around the limitations built into the game other than laming down the volume of AI traffic trains.
 
You could try MSI Afterburner. It does two primary functions. You can overclock your video card and/or measure the video card temperature, GPU usage, fan speed, core clock mhz and video memory usage. Between that and the Task Manager it is possible to get a good idea of the bottlenecks. I have my video card overclocked. It is simple to use the Afterburner program and go back and forth between default and overclock to see the improvement as well as keep an eye on the temperature. You can also create your own fan speed profile to make sure it stays within bounds.

There is also a way to allow programs to access more than the 3.2gb under W7-32bit.
See: http://forums.uktrainsim.com/viewtopic.php?f=314&t=120867
 
I have with some improvement at 30fps.

I always run at framerate=30, I have also tried =20 for no improvement.

Snipe two other things worth checking are ARN and signal scripts.

ARN on rolling stock is imho a waste of resources. ARN keeping track of a couple dozen locos is one thing, but keeping track of up to a couple thousand items of rolling stock is something else again. It adds up. I became aware of this issue back in 04 days on a woeful computer where I tried to release a session with an all-arn hopper train which just point blank wouldn't run. I got the guy who made the hoppers do a non-ARN version and the identical same session ran smooth as silk with the only change being no ARN rolling stock. Wandering OT, but (again imho) somebody who's idea of fun is to sit beside a static camera and watch a 100 car train go by and complain that the first, fourth, twenty-third and ninety-seventh boxcar had the same running number is in dire need of a life! A couple of skin variations with no ARN is all anybody needs.

The other thing to check is signal script. Get performance stats up in Driver and watch 'Worst performing Script' (or whatever). You will find that the sig script memory usage increases dramatically as time passes, and I have noticed in your screenshots a lot of signals. Might be something there...

Andy
 
Hmmm, worst trouble I have with that thing is trying to figure out what all the numbers mean;

55764072.jpg


No documentation anywhere that I can find, I've read that worst buffer count is the main one, never heard anything about scripts. The worst buffer count shown here is a chain link fence I could get rid of, the worst index count is "portland cement", probably a factory. In any case it don't apply to this topic, I get 30FPS when my train is the only train on the route, or in the case of the pic above at the beginning of the session when there are only half a dozen or so AI trains running. All the signals are still there whether I'm all alone or there are 30 AI trains, I suppose it's possible all the trains tripping the signals might have an affect, but that much? In TS2009 SP4 we're talking about a drop from a minimum of 25-30FPS down to 8-15FPS when there are 20+ AI trains running, seems like a lot to blame on signal scripts.

Dick, I tinkered with overclocking starting back in the 80386 MSDOS days, when the Pentium era came along I decided the small gain I got from overclocking anything wasn't worth the instability. I talked to my local computer guru today, he's gonna see if he can dig me up a cheap used Pentium D 3.4ghz that will fit my existing socket to replace the 2.8ghz. Might not sound like a drastic improvement, but it is an additional 600,000 cycles per second which should give some improvement. Doesn't answer the question here tho, we're trying to figure out how to ride a $100 dollar bicycle over the hills, since we don't all have $11 million to buy one of them giant bulldozers to plow through them.
 
Chain link fence is easily fixed, looks like that is Taffwebs, by adding uncached_alphas 1 to the config, or changing the config to stitched mesh. Either method and it works perfectly with a considerably lower worst buffer count, I'm using the fixed version and the highest worst buffer count I have on my route is 40 which is my track, currently without lod.
 
To sum it all up... if the realistic graphics & overall reality of Trainz were combined w/ the arcade simplicity of "RailRoad Lines" then you would have a FUN GAME...right now it's a game by programmers for programmers...I don't want to pay for a game that turns into a full time learning curve & researching job...maxkurt usmc
 
Tom9cf,

I believe the term 'railway/railroad simulator' sums things up.

It's a simulator rather than an arcade game.

There are solutions to most problems that crop up, and there are tutorials for the basic aspects of the game (under the Tutorials button).

Shane
 
Back
Top