OpenTTDDevBlackBook/Simulation/Train Acceleration

From OpenTTD

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

Audio
Music
Graphic

Window System

Using the Window System
Events used by the Window System
Colour codes that exist in OpenTTD

Patches

HOWTO - Add a patch option

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

Vehicles
Using Orders
Pathfinding
Ratings
Train Acceleration

Language and Strings

Using OpenTTD Strings

Multiplayer

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.

[edit] Units used

[v] = mph

[P] = W

[m] = t

[edit] Formulas

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