Assigning Speed Limits - MagnumMacKivler/trakpak3 GitHub Wiki
Why Set a Speed Limit?
Speed limits on railroads are set by a large number of factors, but the chief one is the radius of curvature of the trackage. The tighter the curve, the slower a train must proceed through it to prevent derailments. Typically, speed limits are applied to long sections of track, so that engineers don't need to make frequent speed adjustments--trains are heavy, after all, and they can't speed up and slow down quickly. For a given section of track, the speed limit should be such that a train traveling through it can safely traverse the tightest curve in that section without needing to slow down. So, for example, if a section has one curve good for 30 MPH, one curve good for 40 MPH, and one curve good for 50 MPH, the entire section must be rated for 30 MPH.
Quick & Dirty
Below are some quick reference tables for the default principal Trakpak3 curve radii. Speed values are given in Player Scale MPH/KPH! KPH Values are calculated from the MPH values and rounded to the nearest 5. All track curve radii given are in hammer units (Player Scale inches) and assuming non-superelevated (not banked) curves.
Natural Speed Limits
These are speed limits that will look and feel natural for each radius of curve. These may be used as a starting point and can be adjusted up or down as desired.
| Radius | MPH | KPH |
|---|---|---|
| r2048 | 30 | 50 |
| r3072 | 40 | 65 |
| r4096 | 50 | 80 |
| r6144 | 65 | 105 |
| r8192 | 80 | 130 |
Maximum Safe Speed Limits
These speed limits are the fastest a train can safely navigate a curve of the specified radius. There is an approximate +20MPH safety factor to these values, which allows for some pretty egregious overspeeding without running into tipping issues (more on that below).
| Radius | MPH | KPH |
|---|---|---|
| r2048 | 40 | 65 |
| r3072 | 50 | 80 |
| r4096 | 60 | 95 |
| r6144 | 80 | 130 |
| r8192 | 100 | 160 |
Other Curve Radii
If you're trying to determine the speed limit of a double track radius (for example, r2240), use the speed limit of the associated principal radius (r2048 in this example). Parallel tracks running along the same right of way are usually rated for the same speed.
If you're trying to determine the speed limit of another radius, you can get a rough calculation by linear approximation.
Max Safe Speed (MPH) = (Radius / 102.4) + 20
Below is a graph showing the actual derailment speeds, the maximum safe speed limits, and the natural speed limits for each of the curves.

Caveats
This analysis only covers speed limits based on the tipping speed on a curve, and does not take into any other factors which may influence your decisions. Speed limits of prototypic railroads often take into account the availability of wayside and cab signaling, visual sight distance, proximity to certain industries and facilities, etc. Additionally, because this article is about Garry's Mod, the possibility that the Source Engine may simply buck your train off the tracks for no good reason must be considered, and effects like these only become more frequent as speed increases.
In general, Garry's Mod rolling stock has an artificially lower center of mass and cartoonishly large flanges (the standard has been 5" flanges since the PHX days!), which make them unusually resistant to derailments. However, in real life, some rolling stock is more vulnerable to tipping over (typically freight cars) and thus trains that pull them must sometimes go slower than the posted speed limits--sometimes, railroads may even specify two limits for passenger and freight trains!
Where Did These Numbers Come From?
The Scientific Method was used to determine the Derailment Speed values experimentally. The Maximum Safe and Natural speed limits were determined based on experiences during the test and with gmod trainbuild as a whole.
Hypothesis
Trakpak3 curves are assumed to be arcs, or fractional circles, with a constant radius. When a train exceeds the maximum speed of a curve, it risks derailment when the centripetal force exerted by the rails can no longer constrain it to that circular path, and it begins to tip over. The formula for centripetal force (commonly mislabeled centrifugal force), is as follows:
F = MV²/R, where
F = Centripetal Force, M = Mass of the object (the train), V = Tangential Velocity (speed) of the object, and R = Radius of the circular path.
Solving for V, we get V = sqrt(FR/M). It's safe to assume that the mass of the train is constant during this motion, and that the Centripetal Force, which is due to the train's weight keeping it from tilting over the outside rail, has a maximum value which is constant. When the required centripetal force exceeds what gravity can provide, the train tips over and derails. Since F and M are constant in this equation, the maximum speed is therefore proportional to the square root of the radius of curvature. This means that in order to have a derail speed twice as high, the curve radius must be four times as large and so on.
Method
A test map was constructed, consisting of circular rings of track with curve radii 2048, 3072, 4096, 6144, and 8192 (the default principal radii available in Trakpak3 RSG). Then, a test train consisting of three cars (Magtrains 50' Boxcars on Magtrains Barber S2 trucks) was accelerated around each of the circular loops and the speed, in Player Scale MPH, was monitored. The approximate speed at which the train derailed due to tipping or rolling over was recorded. Derailments due to anomalous behavior of Source Physics (for example, bumping the car upward off the rails as if striking an object) were not counted for the purposes of the test, but were recorded for completeness.
Three trials were performed:
- Using the models' stock weights (15,000 for the carbodies, 5000 per truck; about 55 Tons using Car Weight Handler 2 (CWH2))
- Using the minimum weight setting for CWH2 (20 Tons)
- Using the maximum weight setting for CWH2 (200 Tons)
Note: though mass in Source is meant to be represented in kilograms, CWH2 (designed for use with RLC PT 2's Weight System) uses a 50% weight scale.
Results
The speeds at which the trains derailed (MPH) on each curve are recorded as follows:
| - | r2048 | r3072 | r4096 | r6144 | r8192 |
|---|---|---|---|---|---|
| Trial 1 | 60 | 73 | 84 | 104 | 118 |
| Trial 2 | 60 | 73 | 83 | 104 | 115 |
| Trial 3 | 59 | 73 | 84 | 102 | 116 |
Anomalies:
- Trial 2, r8192, the train derailed at 100 MPH initially. This was not due to rollover from high speeds, but rather due to Source Physics bumping the car upwards. The test was re-performed, yielding a derailment speed of 115 MPH.
- Trial 3, r6144, the train derailed at 75 MPH initially, again due to Source Physics bumping the car upwards. The test was re-performed. Another physics bump occurred on the second run, but the train came to rest back on the rails, and the test was continued, yielding a derailment speed of 102 MPH.
Observations
- The mass of the train did not significantly affect the speed at which trains derailed. This is consistent with the hypothesis since the gravitational force keeping the train on the rails scales with the mass of the train (F = Mg), and thus the ratio F/M stays constant.
- The plot of derailment speeds versus radius approximates the shape of a square root curve. This is consistent with the hypothesis suggesting a square root relationship between maximum speed and curve radius. However, the curve was approximately linear over the range from r2048 to r8192.