Now commence Operation Framerates

sniper297

Coconut God
Phase one complete, on the download station now are assorted 297 static trains for route developers to use as scenery objects in routes with big yards. Best use is on tracks that are not actually attached at either end, I have seen dummy cars used on routes where I tried to couple on and passed thru them, to avoid that don't give the player a path to get there. These are in track objects under "297", place on tracks like a dummy buffer, slide back and forth to get the couplers visually aligned. The boxcars have no actual couplers, so if you use them close to the real tracks it's a good idea to place a gondola or tank car (higher polys, have couplers on the ends) at the end of each string.

60317016.jpg


Right side is an actual car, left is one of the fakes, I used the old "disk" wheel non animated bogies since those are only 322 polygons. Tank car has the highest poly count at 1149, gondola 784, boxcar 645. Still possible to overdo it, so test in game to see what kind of framerates you get. Following shots have a mix of real and fake cars.

35563704.jpg


45604509.jpg


20052678.jpg
 
Jim. I don't want to rain on your parade but have you seen the spline vehicles of Magicland and Wiley4 (plus a couple of UK ones of mine) on the DLS. They are of kind track and one lays them (with shift+LHB) over the track.
 
But aren't trackside objects more framerate friendly than splines?

I wish we had stuff like this for the UK!

Paul
 
"But it's raining, raining in my heart..."

Hey, I LIKE people raining on my parade, gives me a chance to show off my Precision Parasol and Umbrella Drill Team. :cool:

Yeah, I did look into the spline cars, two problems;

57876530.jpg


Splines being a variable size it takes some fiddling to get the correct size, usually just after it "pops" the next one out. Other problem is a single texture, yard with 100 D&H boxcars the exact same color and shade don't work for me. That said, no reason why they can't be used in addition to these;

64985719.jpg


Few spline cars here and there or in the background with static cars in the foreground. Wanna get really crazy take some pics of North Platte and make a billboard, set that behind everything.
 
Why thank you, that's a very generous offer! I'll need two of them, my son's system is identical to mine, six year old refugees from a landfill. :wave:

Seriously, dunno what state of the art is these days, but I'd bet whatever it is you could still bring the FPS down to single digits with a big enough yard full of cars. The splines are actually easier on the framerates since they're lower poly than these, the "static car" is one of them in-between compromises. I did find one similar to this, but it's 3748 polys and it's classed as a signal, these have the advantage of being a trackside object which snaps onto the rails, doesn't add signals to the map, and can be cloned and reskinned easily for your choice of railroads. For my purposes I deliberately made them generic looking with no road name, so when I finish and upload route and sessions the player won't be confused over which cars he can actually couple onto and haul away. :confused:
 
Hi Jim
I've downloaded them and they look good. However I have one grumble, that shows up in your first picture, the body/coupler is too low. I played about with a position tag and found if it is 0.3m higher it looks better and the couplers line up with real rolling stock.

Also I found I could use Narrowgauge's invisible buffer stop to run locos right up to your "dummies". I'm now playing about with some similar cars that Whitepass made a long time ago as kind mosignal but I haven't got them to work correctly in 2010 yet (probably my fault) so can't suggest you make your cars the same kuid kind.

Keep up the good work. Oh yes, you commented on splines being repetative. Some of Wiley4's boxcar splines have four different types in the spline and when setting out you can mix'n match.
 
Last edited:
Well I know when I created a map of the Bailey yard, rolling stock and scenery assets weren't the problem when it came to killing frame rates. I laid out every bit of track for all the various parts of the yard. And I could put a single locomotive running down the mainline and it would be getting 200 frames per second until that yard came into view, then the bottom would drop out, and as long as the track was in view it would crawl.

Now that is with absolutely no scenery or no other rolling stock, and I tried every available track (except for the stuff that since has been released for TS12 since I did this map in 2010) including a lot of payware tracks and they all had the same effect on frame rates.

I chalked it up to overbuilding, which is very easy to do when working with Trainz. I haven't revisited the project since and I put the map up on my website but I don't think I included the track.

Too many of one thing really tends to bog Trainz down, it's been that way since the beginning and I don't think you're going to find a graphics engine that could handle that many actual assets with the level of detail that Trainz assigns each instance of track that will do any better.

Because the way I understand at least, if you put 100 pieces of track side-by-side the graphics engine in Trainz is going to assume that you're going to run over any of those pieces of track at any given time so it makes it all high detail, there's no way to tell the graphics engine this track is just for scenery only.
 
I've managed to get tank4 to work as a mosignal but it isn't worth the hassle as I had to move everything in the y axis to get the right position. Using an invisible buffer stop is far easier.
 
I looked at one of the existing static boxcars, it was classed as a mosignal - why would you want to add a bunch of unused signals to the database? Or is that intended as a scenery car on the end of a spur?

Anyway, yeah, I see the problem;

14284183.jpg


I never intended to use them in combination with real cars on the same tracks myself, but if others want to use them that way it won't take me long to whack out a KUID2 set. Fix is in the main mesh, I added position numbers to the bogies, add a position for the default mesh;

44982372.jpg


According to my hacknotes the numbers are left/right, fore/aft, and up/down, with positive numbers being left aft and up, add a minus sign in front of the number for right forward and down. Wanna move this up so leave out the minus sign, convert French postage stamps to real money 0.1 meters is about 4 inches, so raise it up 0.2, about 8 inches.

95842667.jpg


Not quite enough, I'll try 0.3 and see what that looks like. Cars are different types, so might need to compromise between coupler height and platform height to get something that looks right.
 
What I did, Jim, was just add the line position 0,0,0.3 under the autocreate line in the default container to bring it up to correct level.

As regards the mosignal point, I have some sidings on George Fisher's CCLE route which are partially filled with the spline cars and I used an invisible signal so that AI trains could use the beginning of the sidings. As I said it isn't worth modifying the dummies as it is simpler to add an invisible signal/buffer. As Magicland never produced a tank car spline I will find your tank cars especially useful.
 
Free to modify, if you can figure out a way to use the mesh in a spline have at it. I haven't had any luck cloning splines and replacing the mesh in TS2010, for some reason I just get invisible track and the mesh never shows up.

I'd actually like to find a lower poly tank car, in fact lower polys for all of these, but that's a tedious search - gotta download everything, edit in explorer and open the mesh with PEV Trainz Mesh Viewer, right click and select "mesh data" for each one to see the poly count. My favorite is the Auran GATX tanker, but that's 1734 polys without the bogies and using that mesh as a scenery object would eat framerates like candy.

Phase 2 of Operation Framerates is currently in progress - Justin Cornell wrote a simplified "sleep script" which, added to a freight car, causes it to set the handbrake and disable the physics when it's not moving and not coupled into a train with a loco. Testing is still ongoing, but it looks good so far, once the player couples on it loads the physics and behaves like any regular car, uncouple and kick or hump it it rolls the same distance, doesn't set the handbrake and "go back to sleep" until the speed drops to 0mph.

Again I'm utterly baffled as to why Auran chose to program this thing so that every single car in the session, including loose consists, has to have the physics loaded into memory and continuously hammer the CPU with processing data it has absolutely no current use for. Someone obviously saw the need for a solution and found a fix in 2004, yet I'm newly discovering the problem in 2011? Tests with 1000 regular cars scattered around the route with the player loco 10 miles away from the nearest loose consist, 15FPS. Tests with the same cars modified with the sleep script, 28FPS, nearly double. And no downside so far that I can find, which is what makes it so baffling that this was not incorporated into the game long ago.
 
Phase 2 - FIRE IN THE HOLE!

On the DLS now, 40 some odd KUID2 replacements for the PO&N and Chicago Metro freightcars with Justin's Magical Dreamy Sleep Script.

80598372.jpg


Scattered all over the route, 1000 or more have no effect on framerates unless you have a couple hundred in view, at which time the video card can get bogged down with polygons despite the load these remove from the CPU. Extensive testing shows the script works first time every time, towing unmodified versions of the same cars up assorted grades I get the same results so the physics do load when I couple onto these cars. For some reason the C-41 steam loco don't load the message but it works anyway;

51976183.jpg


Using diesels with the F7 message window open you can see the "Releasing handbrake" message as the physics are loaded for any string that has one or more of the sleep script cars in it. You don't need the message window, the whole thing is completely seamless and you can switch them around, kick or hump them like any other car, nothing special has to be done.

Free to clone, modify, and redistribute, free to steal the carfizzix.gs for your own cars, modify and redistribute. Be advised however, Justin and I will not be providing tech support for modified scripts because it's too easy to screw it up. See the hoppers and reefers for examples of how to modify the script to include pre-existing scripts, testing the hoppers the sleep script works, the coal loads and unloads the same as the unmodified ones. Doors and ice loading hatches on the modified reefers also work the same way as the originals.

With that problem solved, maybe I can dump all this techy stuff and get back to creating art, hopefully I can get this blasted route finished and uploaded by Christmas. Christmas 2019 at the rate I'm going here. :hehe:
 
Jim --

The sleep script sounds excellent.

I take it that it works just as well with AI trainz?

What we need now is an easy way of adding the script to all the cars on the DLS - or perhaps as we add them PCs using Content Manager.

Phil
 
Justin and I have been kicking this back and forth for several weeks, the original idea was some type of global script that any car could reference. That turned out to be too complex and too iffy, plus you would have to modify every car to use it anyway, so no time saver there.

No help for AI trains but no hindrance either. We originally thought we might need two sets, one for loose consists and one for AI, but when the car is coupled into any train with an engine the physics are active and the sleep script is inactive, so there's no performance loss from using them in an AI train. The only application where it would help is if you have a lot of AI trains picking up and dropping off cars, for that the sleep script would kick in and disable the physics after the AI loco uncouplez from, then sit there looking pretty without bothering the CPU until the player or another AI train couples on. For AI trains just running around the route they don't help, but they don't hurt either.

Used anywhere you would normally use regular cars there's no problems and there's nothing special in the handling, so there's no real downside I've found so far. The only place you'll see any performance gain is on large routes with hundreds of loose consists scattered for miles in all directions - with normal cars the physics for all cars no matter how far away are loaded into RAM and continuously worried over by the program, that's what these are designed to overcome. Got a turbocharged alienware system running a session with 25 loose consist cars you won't gain anything from this, got a Celeron clunker running a session with 3000 loose consist cars you'll see a major difference. :cool:
 
hey don't hate on us with the supercharged alienware systems, that's twice in a week :p

I could not vsually see the differences with the cars after making the script, but I could detect it in other ways of monitoring thnigs, so it does in fact make a difference, enough so that I thought the idea needed to be carried out.
 
Well, trade systems with me, then I'll have nothing to be jealous about. :hehe: Humyo link to a beta of the upcoming route with session here;

EDIT: Removing Humyo link since it's out of beta now, look for;

Chicago Metro V1.1,<kuid2:522774:100027:1>

And the sessions;

Chicago Metro V1 templ8,<kuid:522774:100061>
Chicago Metro V1 Tourist Freight,<kuid:522774:100063>
Chicago Metro V1 Tourist Scoot,<kuid:522774:100057>



About 500 some odd loose consist cars and a bit over a dozen AI traffic trains running at any given time, halfway decent FPS on my system - 15-20FPS, which may not seem like much unless you compare to the default routes. Or the same route with 500 regular cars, the script makes a major difference on my clunker. :cool:
 
Last edited:
Jim --

The sleep script sounds excellent.

I take it that it works just as well with AI trainz?

What we need now is an easy way of adding the script to all the cars on the DLS - or perhaps as we add them PCs using Content Manager.

Phil

This might help.

http://www.knowlesys.com/software/search-and-replace-master/

You can select portions of text and use this to insert lines in a particular section. I use this to add in missing mesh file references in multiple copies of a similar asset. I chose a specific place in a config.txt file copy that portion of the text, past that into the search for window, then paste the same modified text with the additional lines in the replacement window.

With this I could edit 25 or more assets all at once and save a ton of time.

John
 
I did batch processing in groups, copying and pasting text one at a time tho. Biggest problem is cars that already have scripts, I'm a hacker rather than a programmer so I usually have to trial and error my way to something that works. What I came up with that seemed to work for any type was to edit the config to replace the existing script lines with carfizzix.gs, then edit the fizzix.gs file to add the lines;

include "reefer.gs"

class fizzix isclass reefer {

That's for the reefer, I somehow screwed that one up between testing and uploading which is why there are KUID2:yadayada:2 versions to replace the KUID2:yadayada:1 versions which disabled the door and ice hatch animations. That's the main thing with existing scripts, however you do it test to make sure the sleep script and the original script both work.

Obviously you can't batch process and globally add "class fizzix isclass reefer" when the original is grainhopper.gs or there is no original script, or you'll get errors when content mangler can't find the script referred to in the sleep script. I did try it the other way, editing grainhopper.gs (for example) to add "include carfizzix.gs" but that always blew up on me for some reason. Again, I am NOT a programmer, so there are probably easier ways to do this.
 
Back
Top