Diesel Railcar Simulator

Diesel Railcar Simulator

Not enough ratings
Train editor overview
By Lapioware
The basic concepts of the train editor summarised
   
Award
Favorite
Favorited
Unfavorite
General
The train editor can be started from the main menu under the trains tab. Click on one of the existing trains to edit it, or the "Create new train" button at the end of the list. Some trains can only be opened in non-saveable mode unless you first make an editable copy. Making a copy is easy: just click on the train and select the appropriate option in the main menu.

It's usually easier to make a copy of an existing train and continue from there, than to start from scratch.

The editor starts in 3D-mode with a bone-shaped test track. The camera can be moved and rotated the same way as in the free roam mode (by default: holding down the right mouse button and using WASD keys).

The top of the side panel has buttons for opening and editing various aspects of the train. You can also left or right-click on a visible part of the train (a model node) to edit the node or sounds associated to it.

Side panel editing options:
  • Vehicles (has its own section in this guide)
  • (Fixed) Formations (see "editing vehicles" section in this guide)
  • Models (has its own section in this guide)
  • (Model) Nodes (has its own section in this guide)
  • Physics (has its own section in this guide)
  • Sounds (has its own section in this guide)
  • Metadata: allows you to edit authors and see where the train is loaded from or saved to (folder path)

Additional options can be opened by right-click on an empty spot in the 3D-view:
  • Choose vehicle: select the vehicle or fixed formation shown on the test track
  • Toggle left/right booked stop: open/close passenger doors left/right for testing
  • Boost: accelerate the train by 10mph. Vehicles with automatic brake usually slow down immediately. (At the moment there is no way to actually drive the train in the editor)

In the side panel, many data fields have tooltips explaining the purpose of the field in detail. Keep the mouse pointer still over the label of a field to see the tooltip.

Useful key shortcuts: press [CTRL+S] to save your work, [CTRL+Z] to undo your last change and [CTRL+Y] to redo your last undone change. These are the default keys, but they can be changed from the controls.

Watch the train editor preview video below for a "tutorial" on how to make changes to a train. Slow down or pause the video as needed.

https://steamcommunity.com/ogg/750170/announcements/detail/4642591179207290147
Editing vehicles
Vehicle definitions are individual vehicles, made up of axles and body parts. A single train file (folder) can have multiple vehicles. Note: the total empty mass (tare) of a vehicle is the sum of the masses of its axles.

Axle definitions represent axles or wheelsets. Note that the concept of an axle also exists in the physics domain. Some properties of the axles, like wheel radius and mass of the vehicle resting on a particular axle, are defined in the physics axle. The connection between axle definition and physics axle is via an index number.

Body definitions represent parts of the vehicle that rest on axles and (optionally) have springs, for example bogie parts and the main body of the vehicle. A body won't be visible by itself but requires a model node to be attached to it in order to give it a visual representation.

View definitions are custom viewpoints for the vehicle, like cab, passenger and bogie cameras. Other views like free roaming camera and helicopter view are added automatically (and are not shown in the editor).

Fixed formations can be used to predefine common configurations of vehicles, like typical power/trailer car formations for multiple unit trains. The formations will appear as train set options in the timetable editor, in addition to the individual vehicles.
Editing models
The editor includes an integrated modelling tool for creating 3D-models. It's best suited for creating vehicle bodyshells, but can be useful for other purposes too. For small details like cab components and interior you may want to use items from the built-in library or import your own models instead (this is done in model nodes).

A body represents one model of a vehicle bodyshell. It's essentially a hollow box with holes for doors and windows. Bodies have hundreds of fields (with tooltips) that alter the shape and look of the body. The generated body models can be used by selecting them in model node properties.

Door types define some common properties for sets of side doors used in a body. A door type in itself does nothing and needs to be used with side doors, which are child elements of a body. This is because the cross section of the body side is required in order to generate door models that are usable as the visual representation of a model node.

Seats define simple seat models that by default are oriented across the vehicle body and generated from the cross section of the upholstery, leg shape and properties. The generated seat models can be used by selecting them in model node properties.
Editing model nodes
Model nodes are used for placing 3D-models, cameras (in view definitions) and sounds (in sound protos) to the vehicles.

Creating a model node alone does not make it visible. It needs to be tied to an axle or body definition directly by choosing the node in the axle/body definition properties, or indirectly by choosing a parent node that is directly or indirectly tied to an axle/body definition.

In order to make a node visible it also needs to have a valid 3D-model selected. You can use models from the built-in library, models made with the integrated modelling tool, or models imported from external programs (see Importing 3D-models in this guide). The model source drop-down menu selects where the model is loaded from, and the model id menu the actual model from that source.

A model node does not necessarily need to have a 3D-model. It will remain invisible but can be useful as a parent node for positioning, rotating or animating child nodes more easily.

To add a child node, right click on the parent node in the side panel and "Add ChildModelNodes".

Animation data are used for moving (translating), rotating and changing the visibility of a model node using small scripts. The movement and rotation animations can also be given spring-like properties (note that these are different from the springs used in body definitions).

Please see the C# expressions section of this guide for more information on scripting. See also other trains for examples of animations.

Node materials can override the default materials of the model attached to the node. This can be used to manually configure the materials for an imported model if the imported materials are incorrect. They can also be used to repaint models from the built-in library (see "Repainting").

Interactions bind model nodes to cab controls so that clicking and dragging a 3D-model will operate a specific control like throttle or shifter in the specified control panel. Some interactions can be auto-generated for a specific view. Open the view definition for the cab view to find the button for auto-generation. The generated interactions might not always be correct or could be missing something, so you should test them manually.

What's the difference between a model node and a body definition? - Model nodes can only have one parent and no spring physics. Body definitions can be attached to multiple bodies and axles with springs.

What's the difference between a model node and a model? - A model is the representation of an object as a 3D-mesh and optional texture images, but has no information about its location or number of copies in the world. Model nodes are used for placing, positioning and orientating visible copies of models.
Editing physics
The operation and technical characteristics of vehicles is defined here, except for springs and suspension which are properties of body definitions instead. Physics include brakes, engines, motors, transmission, cab controls, shafts, pipes, (data) buses etc.

Each vehicle is called a device in the physics domain, and all physics components belong to one device either directly or through another component. Vehicle definitions don't necessarily need to have their own unique devices. Instead it's possible for multiple vehicle definitions to refer to the same device in order to reuse the same physics properties without unnecessary duplication.

Please see the tooltips in the physics editor to learn more about the details of each component.
Editing sounds
Sound behaviours define sound files (from the built-in library or external .wavs), volume, pitch and mixing for sounds emitted by the vehicles. Sound behaviours alone are not sufficient to make vehicles play sounds.

Sound protos tie sound behaviours to a particular location in the vehicle (model node + local position). Multiple sound protos can share the same sound behaviour to avoid having to clone similar file/volume/pitch sets.

Various sound sources can be added to sound protos. A source makes the actual sound play according to in-game events and provides variables that can be used to customise volume and pitch in the sound behaviour's expressions. Most of the sources relate to the physics components used in the vehicles.
Importing 3D-models
Please see the separate guide for instructions on how to import custom .obj and .fbx models to the train editor.
Liveries
Vehicle definitions have a "livery for" drop-down menu where you can select another vehicle as the "original". The livery is then no longer a stand-alone vehicle but marked as a livery instead. This means that the physics, sounds and general characteristics are automatically taken from the original when the vehicle is spawned, but the visual axle/body/model-node structure is from the livery.

In order to create a livery for a fixed formation that has multiple different vehicles (like many of the DMU trainsets do) you'll need to create a livery for each of them. All the liveries should have the exact same name, otherwise the livery might not be applied to all of the vehicles in the set when it spawns.

All installed vehicles can be used as the original vehicle. The livery can be in a separate file and uploaded to the Workshop separately. The timetable editor has a livery drop-down menu for choosing the actual livery used for a vehicle.
Repainting
There are two ways to repainting models, depending on how the models have been built. In both cases you should start off by saving a new copy of the vehicle you want to repaint. Then use the "livery for" drop-down menu in then vehicle definition to mark the vehicle as a livery for the original vehicle instead of a stand-alone vehicle.

For models made with the integrated modelling tool (such as railcar body shells) materials can be changed with the modelling tool itself (see "Edit models").

For imported models and models in the built-in library, see the separate model importing guide on how to override materials.

Vehicle models in the built-in library have special repaint kits with detailed instructions in the workshop to get you started.

Here is the colour palette of the integrated modelling tool. Please try to match the colours where it makes sense.

  • BR blue #274D61FF
  • BR green #416143FF
  • BR maroon #783738FF
  • BR olive green #4F5A41FF
  • BR yellow #F2B757FF
  • black #332F27FF
  • dirty brown #594B37FF
  • dirty grey #4A4845FF
  • dirty (BR) red #613836FF
  • light grey #BCBCBCFF
  • matt mint #A1C9B7FF
  • matt sand #BBAB9BFF
  • orange #CD763DFF
  • white #DFDCD5FF
C# expressions
Some physics, sounds and animations can be scripted using a subset of C# expressions[github.com] which in DRS are functions that return a number. You can use mathematical functions from the .NET Math[docs.microsoft.com] library (like Math.Abs, Math.Sin etc.) and variables provided by the game during runtime.

The set of variables available in each use case is currently undocumented because the system will be changed. In the meantime, please see existing trains for examples.

The syntax of the expressions is out of the scope of this guide. Please see existing trains for examples or post a request for help on the forum.
Steam workshop
Trains can be submitted to the Workshop from the main menu trains tab. When submitting a train to the Workshop, the whole train folder is uploaded, including all custom 3D-models, textures, sounds or other files in the folder.

New trains submitted to the Workshop will be hidden from normal users until you make them public (by logging on to the Steam community page with your web browser).

To add a preview or cover image shown when browsing the Workshop, save an image with the filename workshop_preview.png, workshop_preview.jpg, workshop_preview.jpeg, workshop_preview.gif, thumbnail.png, thumbnail.jpg, thumbnail.jpeg or thumbnail.gif to the train folder before submitting.
7 Comments
Lapioware  [author] Sep 22, 2023 @ 12:27pm 
Guide updated to match the changes done in Scenery patch 5
Lapioware  [author] May 28, 2023 @ 10:29am 
Updated guide to remove custom model importing instructions (please see the separate importing guide for more information)
Lapioware  [author] Sep 15, 2021 @ 9:20am 
Asset packing section updated again
Lapioware  [author] Aug 14, 2021 @ 1:39am 
Asset packing section improved
Lapioware  [author] May 2, 2021 @ 10:16pm 
Model node section updated with a paragraph on interactions
Lapioware  [author] Mar 12, 2021 @ 4:38am 
Guide updated after recent editor update. Added section on liveries.
attila racz Aug 30, 2020 @ 1:43am 
WOW! Seriously? I can edit the train body?