Train Simulator 2012

Point & Spot Lights

There are two new blueprints in the Blueprint Editor, SpotLightBlueprint and PointLightBlueprint these describe a point or spot light.

Point Light

  • Set the colour of the light (alpha is not used)
  • Set the radius, the light will fall off to 0 at radius and falloff is linear
  • Set the shadow caster flag (Warning: the render component has a shadow caster flag as well) this should be false for all but very special lights (see performance constraints)
  • Set the day-night flag, for scenery lights (e.g. street lighting, shop lighting etc) this should be true. If true the light will come on at night and be off in the day.
  • Set the projected texture. This is a special cube map image for point lights which can be used to modify the colour/shape of the light to do advanced effects such as lampshades, stained glass, fixed shadows etc
  • Set the animation texture, this is an uncompressed (suffix _nm.ace) texture which acts as an animation for the colour (r,g,b channel) and size of the light (alpha channel). This should be a power of 2 size texture with at least 32 texels. The animation runs at 32 fps and multiplies the light colour by the colour of the texture and the radius by the alpha channel. This can be used for example to create a firebox light which flickers like a real fire.

Spot Light

  • Set the colour of the light (alpha is not used)
  • Set the radius, the light will fall off to 0 at radius and falloff is linear
  • Set the Umbra(Phi) the angle of the cone and Penumbra(Theta) the angle within the cone that has full
  • intensity. Phi should be greater than or equal to theta. if theta is less than phi the angle between phi and theta has a linear falloff in light intensity.
  • Set the day-night flag, for scenery light (e.g. street lighting, shop lighting etc) this should be true. If true the light will come on at night and be off in the day.
  • Set the shadow caster flag (Warning: the render component has a shadow caster flag as well) this should be false for all but very special lights (see performance constraints)
  • Set the projected texture. This is a special image which can be used to modify the colour/shape of the light to do advanced effects such as lampshades, stained glass, fixed shadows etc
  • Set the animation texture, this is an uncompressed (suffix _nm.ace) texture which acts as an animation for the colour (r,g,b channel) and size of the light (alpha channel). This should be a power of 2 size texture with at least 32 texels. The animation runs at 32 fps and multiplies the light colour by the colour of the texture and the radius by the alpha channel.
To connect lights to the train headlight controls the light children need to follow the following naming convention. Fwd for forward running, Bwd for backward running and headlight for headlights and taillight for trailing lights (taillights).

Fwd_Headlight_#
Bwd_Headlight_#
Fwd_Taillight_#
Bwd_Taillight_#

Where # is any value. e.g. Fwd_Headlight_1, Fwd_Headlight_2 to have two forward headlights.

Usage

Point and spot lights can be placed in routes or scenarios or attached as child objects. Where point or spot lights are placed as simple objects they can have their properties (colour, range etc) altered by double-clicking on the light editor object and editing the properties in the fly out.

Performance Constraints

  • Simple lights are those that have no projected texture and do not cast shadows. These are efficient and can be placed relatively freely. A scene could contain hundreds or even thousands of these and may still perform well though you should consider those with lesser PC specifications.
  • Lights with projected textures have a small additional overhead and should be used more carefully.
  • Lights that cast shadows are expensive and these should be used very sparingly/carefully, large point light shadow casting lights are the worst offenders, small spot light shadow casting lights are less expensive.

Decal Material

Decal materials are a special second pass material allowing the application of decals over surfaces without issues with z-fighting and allowing alpha blending. Useful for graffiti, train numbering, signage etc.

Normal decals

  • The material should be called decal_XXX where XXX is a logical material name.
  • The shader is TrainDecal.fx
  • This material supports full alpha, so a full 32-bit image should be used.

Dynamic Numbering

Dynamic number fonts now support alpha, which has two advantages:
  • It produces nice anti-aliased fonts against the bodywork.
  • It reduces the number of font textures that need to be created for multiple liveries. For example, a loco might have a red and a blue livery which both have white numbers. Previously this would require font textures for white numbers on blue, and white numbers on red because of the edge aliasing. With alpha support, it simply requires a white font with alpha edges.

How to Set Up

  • The materials must be prefixed with "decal_". For example, the materials in your primary digits Multi-Sub Material would be called "decal_primarynumber_0", "decal_primarynumber_1", "decal_primarynumber_2", etc.
  • The shader must be TrainDecal.fx for each of the primary digit materials in your Multi-Sub Material.
  • The textures are still called primarynumber_0, primarynumber_1, primarynumber_2 as before, but can now have a full 8-bit alpha channel (instead of 1-bit as previously).

Usage

Dynamic numbers or fonts, train logos on sides of tenders, etc.

Performance Constraints

There is only a small overhead to using decals. Care should be taken to avoid overdraw as this may hinder performance and could cause artefacts.

Emissive Glowing Materials

To make a glowing object use the shader TrainEmissiveGlow.fx, texture one is the standard diffuse channel, channel 2 is the emissive colour.

Usage

Use to create strip light like effects, etc.

Cab Shadow Mapping

By default, all geometry will cast shadows. All that is required is that a polygon faces a light, and a shadow will be cast by it. However, for cabs, the problem is that polygons face inwards, so they are not recognised as occluders.

To ensure old interior geometry looks good, all interior model geometry will cast shadows by treating all faces as two-sided. This presents two problems. The first is that the game unnecessarily renders interior geometry twice (once with backface culling and once with front face culling), wasting graphics processing time. The second is that light bleeds into the interior models at edges due to two-sided polygons acting like thin geometry.

To combat both these problems, a new shader has been introduced. “TrainShadowOnly.fx” is a shader that can be applied to geometry that doesn’t show up in game, but still casts a shadow, similar to a shadow volume. This shader should be used to create a shell around the interior acting as the exterior model.

Note: This is not the same as a shadow model used in stencil shadows. There are no naming requirements, and no need for the model to be a closed mesh. The only requirement is that there are faces that face outwards from the interior to allow shadows to be cast into the interior.

Any interior model that makes use of this shader will be assumed by the game to not require rendering geometry twice, which will improve performance, so make use of this shader for all interior models. This will also prevent light bleeding, as the shadow only geometry should have a gap between itself and the interior geometry. 

Performance Constraints

As with all geometry, performance decreases as poly count increases, so try to stay within poly count budgets. Also, even if a cab looks fine with the in-code workaround, it still has an impact on performance, so make use of the TrainShadowOnly.fx shader for interior models to turn off the workaround and manually setup a shadow casting model.

Remember that these models are not shadow volumes, and don’t require a closed mesh. Cutting out a hole for windows is therefore fine to do. You could use the exterior geometry as the occluding geometry and apply the shader to the whole thing.

Uneven Track

The default is set in the Track Rule Blueprint.

Usage

The default can be overridden in route or scenario editing using track properties. Debug track rendering will show unevenness on the seventh press of the spacebar - white is flat, red is ultra, with colour grading accordingly.

 Spacebar Presses  Track Debug
 0 (default)  Normal rendered track
 1  Line Type (Yard, Main, etc)
 2  Directionality
 3  Speed Limits
 4  Sounds
 5  Electrification
 6  Superelevation
 7  Uneveness
 8  Track Linked Objects
 9  Return to Default (0)

Water Blueprint Setup & Placement

The appearance of water has had a number of updates/improvements. These don’t require many changes. There are two new properties, a colour and a murkiness depth. The murkiness depth is the depth in metres at which the water will appear opaque.

Usage

Water is placed as before but now also has a property page:
  • Set the colour if required using the colour button or enter a hexadecimal value.
  • Set the murkiness depth.
  • Set the size and height.
  • Where multiple pieces of water are placed as part of a large lake or sea, make sure the height is exactly the same otherwise reflections will not match causing artefacts.

Performance Constraints

Water has a fixed overhead when visible, place as required.

Block Assets

There is now a single instance of AssetBlockBlueprint, no further setup is required.

Usage

  • Place the asset block.
  • Set the density per square km. This controls how many assets are created.
  • Set the size.
  • Choose an asset to populate the block with.
  • Choose the variance for height and rotation, these will scale and rotate the assets randomly.

Performance Constraints

  • Asset blocks speed the game up in most cases as they reduce the number of draw calls from the CPU to GPU.
  • Asset blocks can increase the polygon throughput, in particular, they are expensive if used with high polygon assets.
  • Asset blocks should mostly be used for blocking out the distant scenery.

Specular Track

Track sections should be placed as documented, however, a new shader has been created to allow specular on the rails LoftTexDiffSpec.fx
Assigning this shader to the rails will create a specular Phong highlight on the rail depending on the direction of the light source. This Phong size is fixed.

Usage

Use this on track rails.

SkyDome

The skydome is set up as per documentation but with support for a few new layers. The hierarchy is now:
  • 1_0000_skyhack
    • 1_0000_cloud_storm
    • 1_0000_cloud_wispy
    • 1_0000_cloud_thick
    • 1_0000_cloudband_1
    • 1_0000_cloudband_2
    • 1_0000_cloudband_3
  • 1_0000_stars
The new layers here are ‘cloudband_1’, ‘cloudband_2’, ‘cloudband_3’ and ‘stars’.
  • The background sky dome hemisphere (skyhack) uses TrainSkyDome.fx
  • Three Cloud layers (cloud_storm, cloud_wispy, cloud_thick) uses BlendATexDiff
  • Stars layer (stars) uses Stars.fx
  • 3 new cloud bands (cloudband_1, cloudband_2, cloudband_3) uses BlendATexDiff
For the three new cloud bands, cloudband_1 is drawn first, cloudband_2 is drawn second, then finally, cloudband_3 is drawn. Previous we could not represent Cumulus clouds in the skydome, as the original 3 layers rotated about all axis. These three new cloud bands only rotate around the Y axis allowing the clouds to always appear on the horizon. The speed at which these three new bands rotate is linked to the wind speed set-up in the blueprint.

The stars layer is a simple sphere with generic star map applied. The shader supports transparency, so therefore the alpha channel of the stars texture should predominantly be black with white pixels representing the stars.

Usage

Skydome only.

Window Particles

  • Windows should be mapped onto a square texture, using as much of the texture as possible. All glass panels should be mapped to a unique part of the texture.
  • Should be able to fit on a 512x512 or 1024x1024.
  • If large areas of the texture are wasted (unused) the raindrops may appear too large.
  • If the texture is not square, the raindrops may appear elliptical.
For Passenger views simply remove the wiper mask reference and both slave animation references. Only the World Space Normal map reference is required here.

Telegraph Wires & Railings MSAA Shader

Some thin parts of a mesh (railings etc) or overhead wires can create problematic flickering and aliasing.

Two new shaders have been created which should be assigned to the problematic parts of the model or loft. These should be used sparingly on polygons where the problem occurs only.
  • LoftPostDPPTexDiffSpec.fx - This should be used on lofts such as lofted wires or catenary wires.
  • TrainPostDPPObjectDiffuse.fx - This should be used on scenery geometry or rail vehicles geometry (non-lofts).

Performance Constraints

See section on MSAA assets.

Platform Entry & Exit Gates

There are three new assets already set up. Platform Entry Gate, Platform Exit Gate and Platform Entry and Exit Gate.

Usage

Place this platform loft linked object where you want passengers to leave and enter by. The link position defines the height of the gate, so make sure it is near the asset if the platform is sloped.

When a platform has an entry or combined gate, existing platform spawning behaviour is disabled. When an exit or combined gate is placed, existing platform exiting behaviour is disabled.

Superelevation

The track rule defines the maximum tilt and the tilt to radius ratio.

Usage

Track properties have a checkbox on track selection to make the track cant. The whole ribbon is superelevated. The curve must be eased. The easement must also have cant selected. Do not use in the scenario editor.

Debug rendering will show superelevated ribbons.

 Spacebar Presses Track Debug
 0 (default) Normal rendered track
 1 Line Type (Yard, Main, etc)
 2 Directionality
 3 Speed Limits
 4 Sounds
 5 Electrification
 6 Superelevation
 7 Uneveness
 8 Track Linked Objects
 9 Return to Default (0)

Scenario Track Properties

As per normal track property editing except that the editing is done from the scenario edit tab rather than linear objects tab.

Distant Terrain Setup

There is a 20km x 20km area of mid-distance terrain, this should be generated as a bare minimum around the track to avoid the world edges being visible.

To import ASTER GDEM data the old ‘T’ key has been replaced with a new dialogue accessed from a button in the paint tools tab. The area option controls the amount of data, the data type allows a choice of SRTM and ASTER data sources.

Aster data is available on the internet as .tif files.

Very distant terrain may also be generated using the distant terrain button, this generates very low res 4km x 4km patches from the height field data, and is saved to the file DistantPatches.bin.

Usage

To import terrain use the import terrain button up to 19 x 19km squares can be imported at once. After each import save.

To generate distant terrain patches, import terrain for all required areas, then while in tile 0,0 use the generate distant terrain button to build distant terrain patches. Save (F2) after generation.

Performance Constraints

Distant patches have some overhead and should only be used as required.

Static Consists & Consist Operations

RW3 now supports AI pick up rail vehicles, in addition, to drop off under certain limitations.

Usage

  • Setup a pickup rail vehicle instruction as per Player consist operations.
  • AI can only pick up consists from the starting location in the scenario.
  • The scenario creator is responsible for making sure the path takes the driver around the consist if the train must run around to do the collection.
  • AI will fail to get the pick-up point correct (and therefore crash into the rail vehicles) if:
    • The consist order is wrong.
    • The consist has extra or missing elements.
    • Duplicate rail vehicle numbering makes the correct consist difficult to identify.
    • The consist to pick up moves prior to the pickup.
Static consists now present warnings in the scenario editor, these should be investigated as they may lead to AI crashes. The links are clickable so the scenario creator can examine where the paths overlap.

Scenario Unlocking

Usage

The scenario properties now have another page. You can define which scenarios the current scenario locks. These scenarios will be greyed out until the unlocking scenario is successfully completed. They can be career or standard scenarios.

Depth of Field Camera Setup

This is currently turned on or off under options, and remains constant for all cameras. This may change in future (with other camera effects) to allow high-quality screenshot setup.

Fire & Particle Shaders

The particles are set up as documented. However, a new field has been created in the Particle XML to control the material on the particles:
  • TrainParticleDefault - the default plain shader, this is only lit by the global lighting colour.
  • TrainParticleEmissive – an emissive shader used for things like flames.
  • TrainParticleLit - a wrap around lit shader, this take lighting from the sun/moon and gives a thicker more realistic look.
Ensure that the correct shader is specified in the Particle XML.

Usage

Diesel smoke, house smoke, fire, steam etc.

Performance Constraints

TrainParticleDefault is the cheapest shader, TrainParticleEmissive and TrainParticleLit have a small additional overhead.

MSAA Assets

The new method of antialiasing is a type of morphological antialiasing (MLAA). In the best case, this has an antialiasing effect comparable to multisample anti-aliasing (MSAA) x4. However, in the worst case, artefacts can be seen.

These artefacts are seen in very thin geometry, such as wires. This happens because MLAA uses edge detection to smooth edges, but thin geometry may be thinner than a single pixel.

The workaround for this, in order to make wires appear anti-aliased as they extend into the distance, is to use an MSAA shader.

There are two shaders, “TrainPostDPPObjectDiffuse.fx” for basic geometry, and “LoftPostDPPTexDiffSpec.fx” for lofts. These shaders should be avoided, and only used in the small number of cases where thin geometry is present and required.

The reason they should be avoided is that they use the legacy method of rendering. Geometry rendered using this method only receive shadows and lighting from the sun and moon, and do not receive effects such as volumetric fog or depth of field.

Usage

The anti-aliasing on this geometry is then controlled by the multisampling setting in the launcher.

Performance Constraints

Performance should be the same provided the shaders are only used for thin geometry. Applying this shader to all geometry will lower performance due to both MLAA and MSAA not taking advantage of the faster-deferred shader approach.

Tunnel Ambient Shader

These three new shaders are specifically for use on tunnels. They create an ‘ambient occlusion’ effect where the entrance and exit of the tunnel are ‘brighter’ and the middle section of the tunnel darker. The length of the ‘brightened’ section of the entrance and exit is fixed and cannot be modified.
  • LoftTunnelTexDiff.fx - Used on the rails.
  • LoftTunnelTexDiffTrans.fx - Used on the ballast if transparent edges are required.
  • LoftTunnelBumpSpec.fx - Used on the tunnel walls. Allows for normal maps and specular.

Usage

These shaders should be used on tunnel walls, tunnel track rails and tunnel ballast.

World Editor Favourites

To keep a list of the most useful assets when route building, the asset browser list now includes three favourite lists, Red, Green and Blue.

To view the selection simply press the button for the required list.

To add a selection to the list right mouse click on the list, this will cycle through the red list, green list, blue list.

To remove a selection right mouse click on the list.

Mouse Selection Filtering

Where scenery, track, lofts or roads overlap it may be difficult to correctly select the object in order to ease this, filtering keys filter the selection. The keys S, N, R, and L, and the number keys 2 - 9 when held while hovering the mouse over a potential selection filter to a category or choose an alternate selection.

Usage

  • Right-click to clear any current selection
  • Hold S before left clicking to filter for just scenery selection, all lofts roads and track will be ignored.
  • Hold N before left clicking to filter for just track selection
  • Hold R before left clicking to filter for just road selection
  • Hold L before left clicking to filter for just loft selection
  • Hold 2 - 9 to filter the scenery selection to the nth selection, for example while hovering over 2 overlapping groups of bushes if only 1 is ever being highlighted holding key 2 will highlight in yellow the second selection and left clicking with 2 should pick the correct object.