Australian MSTS @ steam4me Tutorials Perfect car lengths

Achieving perfect car length parameters

by Yuri Sos

***(updated 2 June 2006, using input from Ian Bowles aka "gallop3", Joe Morris and Lukas A Lusser aka "Swissie")***

EXECUTIVE SUMMARY

Quick reference summary of values to be changed:
  • Get true length of model from Ctrl-C in Shape Viewer;
  • Set length in the Size parameter in .WAG file to length minus 0.4m;
  • Set length in the InertiaTensor parameter in .WAG file to length minus 1.0m;
  • Set length in .SD files to values 1m less than min Z and and max Z from Ctrl-C in Shape Viewer;
  • Check width and height parameters .SD files; truncate all values to two decimal places.

DETAILS

Every now and then you come across a model like this................

In this case, we're dealing with us2freightcar5; frustrating as the train rumbles past with wagons separated by a metre or more distance.

Checking the bounding box in this model (press Ctrl + : the + key on the numeric keyboard), we can see that it's ok as far as the BB is concerned: in fact this particular model couples and uncouples correctly, but the vehicles remain separated.

So how can we reliably repair wagons such as these?

The first thing we need to know is "What is the correct length of this vehicle?"

The answer lies in using Paul Gausden's magnificent Shape Viewer and then performing a little judicious editing of the model's .WAG file.

Open the model in Shape Viewer and press Ctrl-B to see the dimensions of the wagon in a visual sense (the red shaded box in the image above), then press Ctrl-C to bring up the pop-up box listing the dimensions of the model. It should be noted here that these dimensions are calculated from the shape file itself with no reference at all to the .SD or .WAG file.

The key dimension to read here is the length of 20.269m, say 20.27m (we don't need more than two decimal places and there's some evidence to suggest that these long numbers may delay or even confuse MSTS). This is the complete length of the model from coupler to coupler.

Open the model's .WAG file in the Unicode-aware editor of your choice. It will look something like the image below.

You will note that the length in the .WAG file is shown as 21.3m. This is where the problem lies.

It's been stated elsewhere that the length of a model should be calculated as the distance between coupler centres. So if we take the end-end dimension from the .S file of 20.27m and subtract say 0.4m, you'll end up with a coupler centre-coupler centre dimension of 19.87m.

Change the numbers in the Size line to read 19.87m (as in image above).

Change the numbers in the InertiaTensor to read 19.27m (as in image above). The InertiaTensor length is inter-related with the coupler damping characteristics and should be the same or just slightly smaller than the actual Size.
Save the file.

While you're there, check the .SD file (see below).

Examine the ESD_Bounding_Box line.

Firstly, what do these numbers mean? These numbers define the limits of the bounding box from the centre of the model in the format

ESD_Bounding_Box ( front-x lower-y front-z rear-x upper-y rear-z);

the parameters are in meters:
x: left negative, right positive relative to origin;
y: positive above, negative below origin;
z: positive forward of, negative to the rear of the origin.

So an ESD_Bounding_Box ( -2 0 5 2 3 -5 ) would define a bounding box 4m wide, 3m high and 10m long, extending 2m either side of the origin of the model, up 3m from the origin of the model and 5m fore and aft of the origin of the model.

Several things to check:

  1. The second parameter (in this case 0.957m) should be 0.6m or higher as it delineates the lower limit of the bounding box: some models have this figure as low as 0.01m which may cause derailments on uneven track or level crossings.

    Route Riter 6.1.63 or higher now has a button under "MISC" enabling you to change all the minimum height bounding box values to 0.90.

    In the case of a flatcar, such as this one, it might pay to increase the height of the bounding box to say 2.5m to ensure it doesn't get "run over" by an adjacent vehicle.
     

  2. Add the third and sixth figures (ignore the minus sign on the third parameter): these two figures should add up to a figure less than the model length figure in the .S file. The easiest way to achieve this is to change the third parameter to Shape Viewer's min Z figure plus 1 and the sixth parameter to Shape Viewer's Max Z minus 1. This pretty well always leaves the bounding box covering the physical shape of the wagon excluding draft gear and couplers.
     
  3. Truncate all values to two decimal places.
     
  4. Make sure the width and height parameters are correct. Some bounding boxes are way out width-wise and you may get collisions with vehicles on adjacent tracks: set the width (1st and 4th parameters) to -1.47 and 1.47 on all (standard gauge) rolling stock.

    See image below for an example of a Bounding Box WAY out of line.

    Example of a badly defined Bounding Box

When you've done all the above, this is how your .SD file should look:

Final appearance of .SD file

And this is how it should look in Shape Viewer - from the side.....

Side on view in Shape Viewer

....and from the end......

End on view in Shape Viewer

Now let's look at this models in the simulation again. You can see that these wagons now appear correctly coupled and couple and uncouple correctly.

Consequences of Too Long a Bounding Box: the BB will prevent the engine or car from properly re-coupling.
Consequences of Too short a Bounding Box: the shortened BB prevents the car from being stopped in buffer-type collisions at the end of track before it "falls off the rails".

You may wish to alter some of the figures I've presented here, but at least you have a formula for establishing correct dimensions for model length and bounding boxes.


10 December 2004,
3 June 2006