The func_tracktrain entity has annoyed me for a long time. It seems like setting the 'Distance Between the Wheels' keyvalue was always guesswork to get the smoothest cornering. But with a little experimentation (and some help from Boojum) I've got it figured out.
This isn't particularly important for payload carts since they're quite short, but anything longer will be helped by the correct settings outlined here. Where it will really help though is if you have multi-carriage trains.
I've always noticed multi carriaged trains will swing wildly around and the joints between them would have long sheared if that much force was actually being applied.
Anyhow, enough ramblings and onto what settings to use:
The origin of the tracktrain
Move the origin to the centre of the back axel. This is where the train is driven from.
The Distance Between Wheels keyvalue
Set this to be the distance, in hammer units, between the centre of the back axel and the front axel
How this works:
-The train is driven by the back axel. The back axel always stays on the track line shown in hammer.
-The front axel stays on the track until it passes a path_track. Then it starts turning. It does not stay on the track. Instead the train simply turns so that by the time the back axel reaches that path_track the front is in line with the track again. This means if your corner is sharp, the train won't follow it nicely.
-Another very small consideration is that trains don't quite follow path_tracks perfectly. They don't turn right and drift a little but it's very hard to notice unless you're doing any precise tracks. Even if you are it's usually not a problem.
This isn't particularly important for payload carts since they're quite short, but anything longer will be helped by the correct settings outlined here. Where it will really help though is if you have multi-carriage trains.
I've always noticed multi carriaged trains will swing wildly around and the joints between them would have long sheared if that much force was actually being applied.
Anyhow, enough ramblings and onto what settings to use:
The origin of the tracktrain
Move the origin to the centre of the back axel. This is where the train is driven from.
The Distance Between Wheels keyvalue
Set this to be the distance, in hammer units, between the centre of the back axel and the front axel
How this works:
-The train is driven by the back axel. The back axel always stays on the track line shown in hammer.
-The front axel stays on the track until it passes a path_track. Then it starts turning. It does not stay on the track. Instead the train simply turns so that by the time the back axel reaches that path_track the front is in line with the track again. This means if your corner is sharp, the train won't follow it nicely.
-Another very small consideration is that trains don't quite follow path_tracks perfectly. They don't turn right and drift a little but it's very hard to notice unless you're doing any precise tracks. Even if you are it's usually not a problem.