Basic PrincipleThe tracks are simple meshes that are placed on the map. They have a collision mesh on which all rail vehicles drive. The track gauge is approximately 1435mm, which is the most common in the world. In reality train wheels have flanges. In RoR wheels can’t have such a geometry, so we use nodes with low friction to keep everything on the rail (we call them guidance nodes). Propulsed rail vehicles use standard wheels spanning the two rails. The result is a quite long wheel what may be odd on the first sight, but if you think about it real train wheels are basically the same. This also helps to keep the nodecount down. See Figure 1.
Basic node and beam principles
To make your rail vehicle working well, you need to obtain certain principles.
- First of all your bogie geometry needs to be exactly as shown in Figure 3
- Your guidance nodes (those running on the inner side of the rail) need to be contacters. Give them a mass of 50 kilos. Give them low friction using set_node_defaults. If you don't use a wheel, the nodes sliding on top of the rail also need low friction.
- Node 0 needs to be exactly in the middle of your vehicle and 0.5 meters below the rail. Otherwise it won't spawn correctly in the train spawner. Don't forget to flag it with "c": don't detect ground contact.
- Make your wheels very hard using the spring and damping options.
- Make the bogie node and beam very stiff using set_beam_defaults.
Building a railway line
There are two ways to place the tracks on a map
1. Placing tracks using RoRToolkit
Beware: Due to a bug in RoR Toolkit you can't build train tracks going up- or downhill properly...Download RoRToolkit 0.37. Since RoR 0.38 the Toolkit will only work after you renamed the RoR Content folder in my documents from "Rigs of Rods 0.38" to "Rigs of Rods". Start RoRToolkit, choose your map and start placing the tracks, Fig. 4.
This will add the node and beam of the switch so you can actually change direction. Don't forget to rename your RoR content folder to "Rigs of Rods 0.38", otherwise RoR won't start any more.
2. Placing the tracks in a 3d modeling program (for professionals :-P )
When you want to create your track layout in a 3d modeling program (Blender, 3ds Max), you need to make sure the coordinates in the 3d modeling program are the same as in RoR. Open the terrain *.zip and search for a *.cfg file. Read out the size of the terrain, switch to your 3d modeling program and create a plane with the same size in the correct position:
This will be our placement help.Now load the tracks from the blender file and start assembling them to a nice railway track. It is quite similar to RoR Toolkit. When finished, you need to attach all track pieces together, but DO NOT ATTACH THE SWITCHES! We only placed them to read out the coordinates and we will place them on the map using the terrn file. For that purpose, open the terrn file, click each switch in blender/3ds and copy the coordinates (including rotational values) over to the terrn file. Then do the same as in Fig. 5 to place the node and beam. Annoying, I know ;-) When done, it's time to export the track layout. It should look like in Fig. 7, with gaps for the switches.
If you choose to place your track using a 3d modeling program, you can also generate a track from a spline.
Building Railroad vehicles
This tutorial can be found here: Building Railroad vehicles
If you have a question on the system, please post here.