Very slow loading of splines

peterwhite

Steam Rules OK
I have been experiencing a very slow loading of splines on my route which is starting to irritate. It has come on slowly but is progressively getting worse and now can take up to 10 minutes after loading the route that the splines start to appear. The rest of the route loads fine and I can move about with the camera without any stuttering. I have not added anything to the route for quite some time so I don't think it is caused by any particular asset.
I am using an ASUS ROG G752 laptop with an Intel i7-6820 CPU @ 2.70 GHz, 32 GB of RAM, NVIDIA GTX 1070 graphics card and Trainz is on a dedicated Samsung SSD.

Any help would be much appreciated.

Peter
 
A PROBLEM FOR ME AS WELL BUT NOT HORREnDOUS.

i AM BUILDING A HUGE LAYOUT AND i DID EXPECT THIS. (Sorry about caps)

What I have noticed is that the basic stuff arrives followed by the miscellaneous stuff in scenery. If you zoom out you will the individual scenery tiles converting to the colours you have - very pretty to watch!!


I also monitor FPS and I am currently running at about 160 FPS when doing low level stuff.

Everone will tell you that shadows kills the FPS stone dead. I drop down to 40/45 when I swittch shadows on.

You can also play with Vertical sync on the General tab of the menu. You can switch this between None, full and half. I've tried all 3 and I don't have any idea what yhey are for.

I always run mine on none which does show some variations.

Don't ask why.

No idea how long you have been with Trainz but it tends to be idiosyncratic in how things change as you discover
 
just take a break and do a quick database rebuild. trainz 19 is very quirkey and tends to leave frustration in the higher levels.
 
Things to try:
1. Replace the tracks with an invisible track (use "Save as" so you don't need to worry about messing your route up). This will tell you if the problem is a rendering bottleneck.
2. Update to the latest build if you haven't already (or if you have, create a copy of your install and try out the Beta update).
3. Clean your PC fan and GPU in case the problem is thermal throttling
 
I also suffer from very slow loading of splines but have recently cleaned out a huge amount of dust from the pc, fans at full throttle, now a lot quieter.
I shall revert to TRS19 again and see if there is improvement.

edit: Much better!
 
Last edited:
Why would dust slow down the loading of splines in particular? I don’t get the logic of that.
Splines appear to be the slowest loading item to begin with. If the computer is choked with dust and is running at a higher operating temperature, loading splines may take longer as the graphics load increases and further increases the temperature. This may result in performance throttling on the CPU and/or the graphics card.
I give my PC a good clean out every 6 months with my wife's makeup brush and a vacuum, or a can of compressed air.

Graeme
 
Last edited:
Granted, but why are splines the slowest to load in the first place? They are nothing but meshes and textures, no scripts, attachment points or animations to worry about. If observation tells us that splines are slow to load, I believe it well enough, but I want to understand why. If I understand it, perhaps there is something I can do in future to make my splines faster to load, but at this stage there is no explanation of what that should be.


.
 
Last edited:
I suspect that while an object can be loaded and placed in a route in one operation, a spline - though less songle detail, has to be calculated from spline point to spline point as it's loaded. That job is usually passed to the GPU, but it'll need to calculate the spline through a lot of spline points.

Colin
 
The problem probably is in the sequence things are loaded in trainz
and the combined ammount of data that needs to be loaded/processed at start of a session


-smaller size textures helps speed things up, less PBR the better
-less textures is better than more (less drawcalls)
-use of texture atlases instead of all seperate (check the passenger product..oof)
-the driver menu, has animated heads, and makes pics of the all frontmost locs at startup
this takes time
-not every simple wagon needs a script, every script has to be processed at start up (init)
-it seems less essential things are loaded before the base (basic ground texture + tracks=splines)


A few baseboards route, this has no real impact, but when you are going big....with many trains
these things start to seriously matter.
Put atleast your local folder on the fastest drive you have (SSD on the mobo)


Don't think problems in the code of a game should be winked away by saying clean your PC
(cleaning is not a bad thing btw)


have fun with Trainz, GM
 
Don't think problems in the code of a game should be winked away by saying clean your PC

Agree with GM here.

- I think it is some of the content you are using. Maybe some very unoptimized splines Are they PBR or not? I am Curious. Because your loading times are exceptionally long
- Also rethink did you change any graphic setting?
-By the way before the use save as or any experiment with your route I advise to make a. cdp backup from content manager in a separate folder for example on your desktop. Just in case something goes wrong with experimenting.
- Is is possible to go to an older version of the same route? And if so does the problem also occur then?

Anyway these are a few things you could try out.

I have a 130 km route (the Icarus Shinkansen v2.0. in the Japan Screenshots Trainz forum with lots and lots of heavy content and long splines (almost non stop cities) and it just loads almost instantly. I have about the same specs as you. So I don't think it is dust. ;).

I have to say that I am not using a lot of grass splines. I have build a selected library and try to use only that content that I know works.

Also not using the newest build buit instead using Build 105100 of Trainz Platinum. And it just works.

Edited to add:

Try to make a backup first. Make sure that you know how to put your route back up and then start experimenting by bulk replacing some of the splines that you think are causing the problem OR build a quick test route and see if the problems occur there to.
 
Last edited:
Thanks for all the help and advice guys. It seems I have a lot of detective work to undertake.

I don't think it will be any particular asset that is causing the problem because I have everything on pick lists and that is all I use for route building. The picklists have not been altered for quite some time, at least not since I have started having this problem.
Unless, of course, something has been automatically updated without my knowledge.

I must also confess that it seems to get progressively worse the longer I 'play', so it could be something to do with the temp of the GPU.

I have my laptop booked in to the local computer shop to replace an 1TB HDD with a 2TB SSD so I will ask them to 'clean' it at the same time and let you know the results.

Peter
 
Good luck with that, Peter.

Splines are evil critters we can't live with, but we can't live without them either.

The problem is simple. Splines are handled by the CPU rather than the GPU. This was stated quite a long time ago I think by James Moody way back in the TS12 days. Since the geometry-segments are actually individual assets, they need to be loaded up and processed each time they are drawn. This was particularly true of the older chunky-mesh assets which are now obsolete. Bigger chunks are more efficient in some cases and this is why walls and roads load better, but grass does not. This alone can cause chunking and stuttering with older spline objects, but has gotten better with mesh libraries, not used back in the olden days, and with the used of shared textures.

The issue is also the kinds of splines. Grass splines are notoriously asset hungry. They have multiple issues that add up and cause awful slowness due to how they are constructed. Grass is made up of multiple triangles that are crisscrossed and placed in a star pattern. Drawing things at odd angles is tough for graphics cards and CPUs to process due to the extra calculations needed to make them work. This is bad enough, but add in double-sided objects. Yes, each triangle is usually, and 99.999% of the time double-sided meaning there are textures on both sides of a mesh that has polygons on both sides. Combine this now with the fact that the grass triangles are obscuring each other, and now that adds another blob to the stew. The computer, meaning the CPU now has to calculate the removal of hidden surfaces, and the GPU now has to work on drawing those objects with subtracted geometry. Other splines such as fences, roads, and walls aren't as bad because the areas are bigger and get drawn in bigger chunks, so there's less constant loading of geometer, calculating, and figuring out what's going on.

The other problem we run into too is some splines, are made better than others. Some use better low-resolution meshes and low-resolution textures so they load quickly. The only solution here is to look at what works best and what doesn't, and make not of what doesn't and delete it at some point so it's not used again. Remembering to write things down is the hard part!

With all this confusing gobbly-gook, it boils down to this. If you want to use grass splines, go ahead but use them sparingly. Keep them to where they will be seen the most, but don't do thick areas of grass. The more crisscrossing grass splines you have on top of the crisscrossed geometry means that there is this much more load on the CPU and GPU, and this adds more to the slowness.

Not long ago, I thinned, trimmed, and removed a ton of splines from a route I downloaded. There were so many grass splines on the route that I could barely navigate around in Surveyor. Once I trimmed down the amount of splines, the frame-rates jumped dramatically, and what grass was left didn't look any different from what it did with all the splines in it in the first place!

Why is the system slow and getting slower while using the program? There are a number of issues that can cause this, but related to splines it's just that the system is really, really busy handling the splines along with attempting to handle all the scripts for everything else. The other issue too is if there are a lot of AI drivers, this adds insult to injury and as the AI starts to do stupid things, their own actions make things worse. I've noticed this myself on my routes as well. When I start getting messages about lots of stuck drivers, it's then that things overall are slowing down. After I clear up the clog, the performance is better.

The other issue too here is some of the scripts are possibly causing what is called a memory leak. This means that they allocate space in a memory table to store information, but when the information is no longer needed and the information is cleared, that memory space isn't put back into the main memory pool for use again. What this means is there is now less memory for the other processes to use. Later on if the script is loaded up again a new table is created, causing a repeat of the same issue all over again. MS Excel used to suffer from this, and probably still does, and back in the Win95 days would eventually crash the computer.
 
Splines were only handled by the CPU with the old Jet engine so that may have been relevant in TS12 however not with the new game engine, the GPU does all the rendering in TANE and TRS19.

Haven't seen this posted but what build as there was an issue with splines a while back that was fixed.

Would help to know what splines? and is it in just one route or all routes?
Not seeing any issues with them here, either with GTX1080TI or GTX1060

Looking at the log might give a clue if something is making repeated attempts to load, it could be just one asset maybe a spline or something else that is in a failing to load loop and just delaying the rest of the splines to load until it's given up trying to load.
Presumably splines are the last items to load because they are usually quite long and effectively lots of individual assets joined together, if they take longer than a couple of seconds to appear it may well be an indication of a hardware issue, overheating and such or a loop as above.
If it's getting worse though without editing the route and no clues in the log, I would be looking at something else other than just TRS19, like temperatures, GPU throttling and such, laptop full of fluff, or thermal paste needs redoing on CPU and GPU, can happen with high end laptops.



The Preview using the performance test can indicate if a spline is problematic.
 
Well, its taken quite a while but I can finally say I have tracked down the culprit that is causing this slow loading of splines. It is Track Circuit Detectors. Because my route is quite intense, rather than large, I have a lot of yards with 2 way running so I have been adding TCB's to avoid conflicting paths being set, and the more I have added the worse it has got. Removing them all with bulk asset replace and my session runs a lot smoother and I don't have an issue with splines not loading.

So beware, you can have too much of a good thing. Now I come to the part of how many is too much?

Peter
 
Back
Top