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.