OpenTTDDevBlackBook/Simulation/Train Acceleration

From OpenTTD
Jump to: navigation, search
HAL (Hardware Abstraction Layer)


Window System

Using the Window System
Colour codes that exist in OpenTTD
Adding a text box
Understanding the widget focus system


Add a setting
Add a squirrel function
Do a savegame BUMP

The Map / Scenario

Understanding the Dynamic Landscape Array
Understanding the SaveGame Handler
HOWTO - Create good Scenarios
HOWTO - Add New Town Name Generators

The actual simulation

Using Orders
Train Acceleration

Language and Strings

Format of langfiles
Using OpenTTD Strings
List of Special Strings


The Core Interface

Starting a Server
Connecting to a Server
Using the list of LAN/Internet Games

The OpenTTD TCP Protocol
The OpenTTD UDP Protocol
HOWTO - Debug desyncs

Ingame Console

The Console Window
Using Console Scripting
HOWTO - Add Functions/Commands to the Console
HOWTO - Add Variables to the Console
HOWTO - Direct Variable Access using ICONSOLE_VAR_POINTER
OpenTTD Console Commands
OpenTTD Console Variables
Development History

This page tries to summarize the algorithm used for realistic train acceleration.

Units used

[v] = mph

[P] = W

[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

i = Σ 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 + i) [N]

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

Personal tools