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


If you want to actively contribute to the development of OpenTTD, you will need to debug your patch. Use your favourite debugger for debugging. In addition to that, OpenTTD has some debugger options that might help you.
If you just downloaded the game and something does not work, you also might to run the game with debugging enabled.

Debug Options

Starting the game with "-d 1" will enable global debug level '1'. All debug messages with a severity of 1 will be shown. Use the following syntax in a command line window:

user@home\> openttd -d 1

In addition to that, you can only show debug messages for certain areas of the game. Currently there are 3 such items:

misc Will show messages for miscellaneous events. This includes loading of sound, video, or resorting of various items or general warning messages 1, 2
spritecache Will show the processing of sprites 1, 2 and 9
grf Will show Newgrf messages, such as their copyright info (1) and notices if some parts failed to load, were loaded incorrectly, or are not yet supported (2) 1, 2

You can combine any of these to get only their desired lvl. For example misc 1 and grf 1:

user@home\> openttd -d misc=1 grf=1

Debug messages with lvl 0 will always be shown, unless you remove these debugs. To strip the executable of any debug messages, compile with the flag:

Personal tools