Train Acceleration
OpenTTD Development Documentation
External Links

OpenTTD GitHub
Contributing to OpenTTD - guidelines
OpenTTD Doxygen

General Reference

Coding style
Compiling OpenTTD
Add a setting
Add a squirrel function
Understanding the SaveGame handler
Bumping the savegame version
Doing an OpenTTD release

Language and Strings

Manual of style
Format of langfiles
Using OpenTTD strings
List of special strings

Window System

Using the window system
Colour codes that exist in OpenTTD
Adding a text box
Understanding the widget focus system
GUI style guide


The OpenTTD TCP protocol
The OpenTTD UDP protocol
Debugging desyncs
Server Admin Port development

Ingame Console

The console window
Console commands
Console variables
Using console scripting
Adding functions/commands to the console
Adding variables to the console
Console development history

Content APIs (modding frameworks)

Graphics and similar (NewGRF)
AI framework (NoAI)
GameScript framework (NoGO)
Social Integration

Other Reference

Map array (landscape grid)
Train acceleration
Sound IDs

This page tries to summarize the algorithm used for realistic train acceleration. What follows is a description of the formulas listed at the bottom of this page.

This is incline of the train as a whole (or the sum of the inclines of each car), where 60simi is the incline of a single car i.

Units used

velocity [v] = mph

power [P] = W

mass [m] = t


F = 22P / 10v [N]

n — number of cars

μ = 35 (eq. 1e-3 ?) — coefficient of friction

A = 120 — area (units?)

d = 20+3n — drag coefficient

q = Σ 60simi — incline term, summed over cars

si — slope, -1 (going down), 0, or 1

mi — mass of the car

Fr = 4(13m / 10 + 60n + μmv / 1000 + Adv2/10000 + q) [N]

a = (F - Fr) / (m * 4) [m s-2]