Shianra

Information, tools, and thoughts on tabletop games, video games, and their worlds

Calculating Speeds

Let’s dive into vehicle speeds, shall we? Now, to figure out the speed of the vehicles in OpenTTD, we should first start with some definitions. Internally, OpenTTD works with a unit called km-ish/h and the conversion factor from km-ish/h to km/h is 1.00584, whilst the conversion factor from km-ish/h to mph is 1.6. Also, a tile is, for vehicle speed purposes, 664.(216) km-ish, 668 km or 415 miles long. This is based on the following data gathered by those at the OpenTTD Wiki .

  • A tile has 16 sub-locations per x/y axis.
  • A vehicle has stores remainder of tile movement in a byte called sub-speed, thus has 256 different values.
  • The vehicle’s raw speed is added to sub-speed. The resulting number is divided by 256, the remainder is stored in sub-speed, and the vehicle is moved quotient sub-locations forward. For trains and aircraft, the raw speed is in km-ish/h, for road vehicles and ships, it is in 0.5 km-ish/h. For trains and aircraft, this step is done twice per tick, whereas ships and road vehicles do it once per tick.
  • A day contains 74 ticks, and takes 24 hours.

Are you still with me? Ok, cool. So, now let’s assume a vehicle going 1 km-ish/hour.

(1 × 16 × 256) / (74 × 2) × 24 = 664.(216)

The net result is that 100 km/h covers ~3.6 tiles/day.

Road Vehicles

OpenTTD: Balogh Goods Truck

Road vehicles accelerate at 37 km-ish/h/day and can go around corners at half their max speed. They will accelerate an additional 74 km-ish/h per day downhill, but when going uphill, road vehicles slow down 10% four times per tile. This balances out with acceleration at 34-ish km/h for all road vehicles. However, this does not apply when using the improved road vehicle acceleration model.

Ships

OpenTTD: Cs-Inc. Oil Tanker

Ships will accelerate at 37 km-ish/h per day and a “stopped” ship will resume its last speed instantly… Um, yeah, it’s a little bit like magic.

Aircraft

OpenTTD: Airbus A330

In regards to aircraft, by default they fly at a quarter of their listed speed, but this can be changed in the advanced settings. Aircraft acceleration varies per aircraft, between 144 km-ish/h per day and 400 km-ish/h per day. However, broken down planes fly at 320 km-ish/h, and the airport taxi speed is 150 km-ish/h.

Trains

OpenTTD: Ginzu A4

Here we will be dealing with an optional method of train acceleration – realistic train acceleration, a patch that can be activated in the advanced settings like shown below. The realistic acceleration for trains setting turns on a simple physics-based acceleration model. Having this patch activated means that depending on the weight of the train, the power of the engine, and the gradient of the slope that the train is going up or down, the acceleration will be changed in a slightly more realistic manner than the default methods.

OpenTTD: Realistic train acceleration

For building railway tracks, this has a number consequences which, in my opinion, make it a much more interesting experience. Firstly, train acceleration and maximum speed are affected by engine power, maximum tractive effort, i.e. all engines and powered wagons combined, current speed, air drag, total train mass, and wagons/engines on slopes. Additionally, tilting trains gain an additional bonus of 20% on the maximum speed, but small slopes don’t affect the speed by much and trains are not affected going up or down hills if they are powerful enough. Moreover, a heavy train with a weak engine might not reach the engine’s maximum speed because of all the friction but having multi-engine trains help in this regard. Also, depots and stations have speed limits, limiting trains to entering and exiting a depot at 61km/h, and speed limits are multiplied by a factor of 1.5 for monorails and 2 for maglevs.

When it comes to taking corners, really sharp corners are punished a lot as 90° curves have a speed limit of 61 km/h, whilst two successive 45° curves in the same direction get limited to 88 km/h. For softer curves, the speed limit is calculated from the number of direction changes along the length of the train, among others. In the tables below, curvature simply means the average number of wagons of the train between turns, although, very sharp turns such as curvatures 0 and 1 are not averaged out in longer trains. This can be used to determine the maximum speed in either kilometres or miles that a train may take around such a curve, like the two examples we looked at moments ago.

Curvature Max speed (km/h) Max speed (mi/h)
Railroad Monorail Maglev Railroad Monorail Maglev
0 (90° turn) 61 91 121 37 56 75
1 (2×45° turn) 88 132 176 54 82 109
2 111 166 221 68 103 137
3 132 198 264 82 123 164
4 151 226 301 93 140 187
5 168 252 336 104 156 208
6 183 274 365 113 170 226
7 196 294 392 121 182 243
8 207 310 413 128 192 256
9 216 324 432 134 201 268
10 223 334 445 138 207 276
11 228 342 456 141 212 283
12+ 231 346 461 143 214 286

And that’s it in regards to vehicle speeds. There isn’t a need to worry about these too much since at the end of the day, all it means is that sending trains up steep hills and around impossible corners will slow them down, just like they realistically should. Although, in the case of the 90° curve, it is possible to turn off the trains ability to take this degree of curve in the advanced settings, like shown below, to make it more realistic, which I would highly recommend.

OpenTTD: 90° turns

There’s also an option in there which allows us to prevent trains from magically flipping around to go back in the same direction within a station, like shown below, which would be physically impossible given the circumstances. This would mean that the traditional terminus stations no longer work, but adds another interesting element for us to deal with when designing tracks.

OpenTTD: Reversing at stations