Adding Steam Effects with TSM
by Paul DeVerter

A Port City Car Co. Project Copyright © 2004

Overview

This is a tutorial on adding steam and smoke to a steam engine when using Train Sim Modeler. How to do so is another one of those little mysteries that I could not find explained in the Help file that accompanies the modeling program.

I got into this project while trying to follow the tutorial by Richard Osborne: Constructing A Steam Loco Using Train Sim Modeler.

Although the tutorial is written for beginners, I was such a rank amateur that I started the project almost 3 years before I finished it. I simply was not familiar enough with TSM to make a go of it. I kept getting bogged down in the details.

When I was well enough along to try out the basic loco in the Sim, it became apparent that it needed some smoke to make things look right. Well, I could not fathom the instructions for adding such, and so I spent several days trying to figure out the method. I finally did, and these are my findings on how to proceed.

 

Smoke From The Chimney

Once you have constructed the boiler, and added such blobs and gadgets as the smoke stack, safety valve, whistle and cylinders, it is time to animate the model by adding what are known as Steam Effects. If you look into an existing steam eng file, you will find a section like this:

If you are using TSM to construct your model, the program will add the proper items to your eng file for you, if you know how to give it the proper instructions. In order for the smoke to come out of the stack, you not only have to have the proper wording in the eng file, but you must also draw a placeholder or token in the desired location, and give that placeholder the correct Reference Part Name.

Then you have to go to the eng file and adjust the three parameters under the particular effect that you are working on. Thus the major part of this tutorial is about how to set up the placeholder and then how to adjust the three parameters.

The first thing to do is to draw the Chimney or Smoke Stack placeholder in TSM. You do that by using the Create Polygon Tool to designate a small 3-sided polygon, which faces upwards. By small, I mean one that is perhaps 0.5 foot (0.15m) in radius.

If you make it perpendicular to the Y axis it will be in the same plane as the horizon. And since it is only a single polygon, it only has one surface, and that faces upwards. You could make the polygon even smaller, but it turns out that it is not visible in the Sim in any event - small here means unobtrusive.

Once it is drawn, move it over the top of the smoke stack, as shown. Notice that the Z axis is along the track, the Y axis is vertical, and the X axis is orientated across the track. This is the same orientation that lights, and other objects have on engines.

You can see the polygon in the perspective view of TSM, notice the white triangle just above the stack. When you look at it from a horizontal view, it seems to disappear.

Next we need to attend to the Part Properties and give the Smoke placeholder a Part Name, so press F2, and here is what you have:

Smoke requires a special Reference Part Name in order to animate properly. Click on the Reference Part Names button and a new list of Special Reference Part Names appears. You are already familiar with the fact that Reference Parts do not show up in the Sim because you have undoubtedly used the Track Reference Part. The one on this list that makes sense is fx_StackFX, so select that one, and hit OK.

Now you are brought back to Part Properties, and you will see that your Part Name is the Reference Part Name that you selected. Unlike other animated parts, the Parts picked from the Reference Part Names do not need a Part Parent. But you do need to check the Reference Part Only box, toward the bottom.

If you like, you can texture the fx_StackFX by choosing any color that you desire. Here I have colored it green, which you can see just above the stack.

The advantage in doing so is that you can tell that you have it oriented properly, if the green colored side is facing upwardly. On the other hand, there is no real need to texture it at all. And in any event whether it is colored or not, if you have chosen a correct name for the part and if it is a Reference Part, the placeholder will not show up in the Sim.

Next we need to Create a Train Simulator Object and see how our smoke looks. If you have not already done so, you will need to pick a Filename, both short and long, and then fill in the blanks in Create Train Simulator Object. Be sure you also pick a Folder to put you steam engine into, and you must check the boxes dealing with the New eng or wag File, and the New Sound and Cab Files, even if doing so overwrites a prior eng file. The reason is that the eng file needs to have the Special Steam Effects language written into it, and TSM will do it for you since you have chosen a Reference Part Name.

Check the boxes then press Continue and your engine will be generated so that it is ready to be put in the Sim by the Consist Editor. But first take a peek into the newly created (or recreated) eng file. You should find a new section dealing with SteamSpecialEffects in the middle of the eng file:

Now you have only created the smoke for the Stack at this point so this should be the only SteamSpecialEffect listed. Also note that three sets of numbers have been generated by TSM, and placed under the entry StackFX. What do these numbers mean?

Well the first row is the physical location parameter of the little polygon placeholder that you set. The numbers mean that the polygon is located at X=0, Y=3.90144 meters up from the track or origin of the engine, and Z=2.49936 meters in front of the center of the engine along the track. The second row tells you the direction that this particular effect, smoke, will be pointed. Hence, X=0, Y=1, and Z=0, or the smoke will not be going to the left nor right (X), and not forward or backward (Z), but only vertically up (Y). Another way to look at this is that the 3 numbers define a vector in space. The X and Z axes define a horizontal plane, and the Y axis is vertical. So, if you want the smoke to be emitted vertically, then 0 1 0 defines a vector normal to the X-Z plane, or pointing straight up. The third row is an indication of the volume of smoke to be generated. Often you will see a notation to the effect that the third row number signifies the width of the nozzle. Hence you would think that the larger the number the greater the amount of smoke.

However this is not true. It appears to be the reciprocal, and does not seem to have anything to do with width. If you want more smoke, then make the number small, like 0.1 and if you want less smoke then make the number larger, like 0.5. Now this is not strictly true either, because there are other parameters in the eng file that must be taken into account, and they also affect the volume and color of the smoke.

JW Titus, who has done considerable experimenting in this area, says that

"This parameter sets the radius of the smoke port thereby determining the area over which the smoke is distributed. For a given volume of smoke, a smaller area produces a denser smoke column but not as big around; a larger area, a thinner smoke column spread out over the larger area. The volume of smoke is controlled first in the .eng file. See Tech Docs "Eng_and_wag_file_reference_guide.doc": 'CoalBurnage'; 'ExhaustLimit'; 'SteamSmokeUnitsPerPoundOfFuel'; 'SteamMaxSmokeUnitsReleaseRate'; and 'BasicCoalUsage'. These parameters control the basic smoke and steam volume and expulsion rates. Having set these, then the volume and rate of smoke generation is further affected by settings of the various engine controllers in the cab, during operation."

But I am getting ahead of myself. Let's go into the Consist Editor and make up a consist with our now smoking engine and see how it looks. Here is the Consist Editor........

........and you should know how to create an engine and get it up and running. Let's go to the Sim and see what we have.

Notice that we now have smoke and a goodly amount of it too. Also note the green triangle or polygon is not visible above the stack. And note the smoke is starting somewhat above the top of the stack, and needs to be lowered down a bit.

Go back to TSM, where we will adjust the height of the start of the smoke. We do this little trick by simply moving the polygon part fx_StackFX down a bit, while maintaining the X and Z locations directly over the top of the stack.

Then we go back to Create Train Simulator Object and check only some of the boxes, namely Convert to Binary, Replace Existing Files, New eng or wag File, and the New Sound and Cab Files. We need to check the New Engine box so that the relocation of the Reference Part will be transmitted to the eng file. We need to check the New Sound box also because if we don't the engine for some unknown reason will not show up in the Sim. I can not explain why, just trust me.

And here is what we have when we look at the lowered smoke in the Sim:

Not bad at all. We do not need to fiddle with the direction of the smoke as it should go up, but we need to adjust the volume of smoke. This is simply done by changing the parameter in the third row from 0.1 to something else with less volume. Here are two photos showing 0.1 and 0.5 parameters. I finally settled for 0.38, but it is your choice.

 

Steam From The Whistle and Safety Valve

Now that we have the stack taken care of, let's move on to the whistle and the safety valve. The process is much the same except that we must use different names for the tokens or placeholders. Simply set your polygons, texture them if you like, and use the appropriate names from the list of Reference Part Names, namely fx_WhistleFX and fx_SafetyValvesFX.

Here I have used different sizes of polygons to illustrate that the size does not matter, and different colors to illustrate that the color of a reference part does not show up in the Sim. So, I have made the placeholder for the whistle steam red and larger than that for the safety valve, which is smaller and black.

Note that when you create the object in the Simulator, all of the volume parameters are reset to the default, which is 0.1. This means that the smoke volume goes back to the default value as well. Keep notes if you have previously found a volume that you like so you can go back and reinsert that value in the eng file.

Here you see the white steam coming from the whistle and then from the safety valve. And again, the Reference Parts do not show up in the Sim. (I could get the safety valve to pop by turning off the Automatic Fireman in the Options or by setting the fourth parameter in EngineVariables to a number 1 higher than MaxBoilerPressure). All of these Special Effects need to have their volumes adjusted, to your liking.

 

Steam From The Cylinder Cocks

In British practice, the exhaust from the cylinder cocks is usually directed toward the front of the engine, and somewhat off to the side. In US practice, the exhaust is usually directed away from the engine and perpendicular to the tracks. Fortunately, you are allowed to make those choices, by adjusting the parameter for direction, i.e. the second row.

Once again, construct a polygon under each cylinder, in the area where the cylinder drain cocks are located. Since this is a UK engine, I have placed a polygon on each side, under the front end of each cylinder. I have textured them red, just for fun.

The next step is to use F2 and pick the Reference File Name for each side. The obvious choice is fx_CylinderFX. Make sure you check the Reference Part Only box. Then to make the one on the other side, simply Copy and Paste, and go into F2 again. Here you will find the copied placeholder has taken the name fx_CylinderFX.1, and it will already be textured red. It will be on the wrong side of the engine, so change the X Axis Location to a negative number and click OK. Now you have both placeholders for the Cylinder Drain Cocks, one under the front of each cylinder.

Then Create Train Simulator Object, and see what you have in the Sim. As before, you will need to create new eng and Sound files. Then fire up the Sim, and when your locomotive is showing, set the cut-off to perhaps 30%, release the brakes, and open the throttle. The engine moves, but no steam comes out the cylinder drains. So, increase the throttle up to 12-15%. Still no exhaust steam. Toggle the "C" key. No exhaust steam. What happened?

Another Bug in TSM

Something is wrong. Eventually you might conclude that you have not chosen the proper Reference Part Name in TSM (fx_CylinderFX), and if so you would be correct. If you will search through the eng files for those steam engines that have working Cylinder Valves, you will find that the proper reference part name is plural - fx_CylindersFX. I spent 2 days looking for this bug, and finally found out what the problem was in a Forum on the UK Trainsim site.

There are two solutions: both work. Simply go to TSM select the cylinder drain polygon, and press F2, Part Properties. At the top is the Part Name, so simply amend it by adding an "s" after Cylinder. Then recreate the Train Simulator Object once more.

Next go to the Sim and see what you have this time. You will need to increase the throttle to over 12% because, for some unknown reason, the cylinder drain does not exhaust below that Throttle setting. Now you will see steam escaping from the cylinder that you have labeled with the proper reference part name.

But there is no exhaust steam coming out of the other cylinder. The other way to fix the problem is to open the .ENG file in WordPad or ConTEXT and go to the section on SteamSpecialEffects, which will look like this:

You will notice that one of the Cylinders is singular, and the one you just fixed is plural. So change the singular to plural, so that they both read CylindersFX, and save. Now, go back and fire up the Sim, and here is what you should see:

Now steam is exhausting from both cylinders. Of these two fixes the former is preferable, because if you ever have to recreate the eng file, the proper Reference Part Names are now listed in TSM.

But unfortunately it seems to be going straight up, and then trailing backwardly, as the engine moves forward. We need to adjust the direction parameter, found in the second row. The default direction is 0 1 0, and this means the direction of the exhaust steam is not along the X axis, not along the Z axis, but is along the Y axis in a positive direction - namely up. We want the steam to exhaust forwards, which would be a positive Z direction, so change the Z parameter to 1. We do not want it going up, so change Y to 0. And finally we would like it angled a bit to the outside, so make the X parameter read 0.5. So the final numbers for the second line are 0.5 0 1 for the cylinder that exhausts to the right, and -0.5 0 1 for the cylinder that exhausts to the left.

Then adjust the volume parameter, just as you did for the Smoke, and an exhaust volume of 0.4 or so seems about correct. And here is what you have

 

Conclusion

Now you have learned how to add the SteamSpecialEffects to the eng file, and to adjust the location, direction, and volume parameters to fit your chosen locomotive.

What you have not learned is what to do with some of the other Reference Part Names, such as CenterOfGravity, ObjectCenter, InertiaTEnsor, and light. While I can guess, I have not experimented with those yet, so I simply do not know. I also have not yet experimented with the values that would change the color of the stack smoke.

Credits and Beta testers

Thanks to:
Ted Ahner
Ed Hawkins
Frank Thomas
James Titus