OpenTTDDevBlackBook/Network/Desync debugging

From OpenTTD
Jump to: navigation, search
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

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)

Other Reference

Map array (landscape grid)
Train acceleration


OpenTTD GitHub docs contain a guide to desyncs.

How to gather desync data

In order to fix a desync, one needs playback data. Only server admins can gather those and their help is needed as they need to enabled desync debugging on their servers. Without these desync debugging data one has nearly no chance to find and fix these bugs. This is how you can gather these necessary data and help us pin-point and ultimately fix the problem:

  • Make sure you have enough free disk space on your server. You'll need place for a savegame every two minutes without cleaning, possibly over hours.
  • Via rcon set: debug_level desync=3
  • save the game to 'desync_start.sav' (or some other name you remember)
  • load the game you just saved from the savegame file you just created. This makes sure there's a well-defined starting point.
  • let people play until you see a desync happening
  • When the desync happened:
    • gather the data and make them available for download: save/desync_start.sav, save/autosave/dmp_cmds*.sav, save/autosave/commands-out.log.
    • Open an issue in our bug tracker and link us there to the available desync data. Check back on the issue or enable notifications, we might have further questions or ask you to possibly try a fix.
    • You then can also disable desync debugging again (rcon debug_level desync=0)

Anything less will likely not fix the desync issue nor help finding it. Thus if you are a server admin and want to see them gone: enable desync debugging on *your* server and gather the data! Don't wait for anyone else - chances are slim there will be, especially as some desyncs might need the specific combination of settings and / or NewGRFs which only you use on a server.

Personal tools