1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 17:49:10 +00:00

Compare commits

..

11 Commits

Author SHA1 Message Date
rubidium
109294c6c4 (svn r15913) -Release: not the April Fools' edition of OpenTTD. 2009-04-01 14:36:05 +00:00
rubidium
2fbd7ff6cc (svn r15912) [0.7] -Backport from trunk:
- Update: lots and lots of translations
- Fix: Chat completion got called twice causing tab completion to seemingly fail (r15905)
2009-04-01 14:24:54 +00:00
rubidium
1595413545 (svn r15904) [0.7] -Backport from trunk:
- Feature: Watermark crash.sav and do not generate crash information if a loaded crash.sav causes a crash so the real crash report does not get overwritten (r15893)
- Feature: Add autoclean_novehicles setting which will, when autoclean_companies is true, remove any company with no vehicles and no active client after autoclean_novehicles-months (r15848)
- Add: [NoAI] AIIndustryType::IsBuiltOnWater(), HasHeliport() and HasDock(). Just like AIIndustry (r15901)
- Add: [NoAI] AIBridge::GetBridgeID() so AIs can get the type of bridge that are already build (r15875)
- Add: [NoAI] AIRoad::GetRoadVehicleTypeForCargo() to tell whether a certain cargo needs a bus- or a truckstop (r15860)
2009-03-30 23:22:13 +00:00
rubidium
76b2e1c5ab (svn r15903) [0.7] -Backport from trunk:
- Fix: YAPF did not apply the platform length (too long/too short) penalties (r15900)
- Fix: Fixing the slopes was done a bit more often than intended making map generation with the original generator horribly slow (r15895)
- Fix: YAPF used different penalties for aqueducts than for other water tiles (r15891)
- Fix: Round the production rate up, so e.g. oilrigs always produce some passengers on lowest production level [FS#2772] (r15888)
- Fix: Libtimidity cannot handle frees of NULL (in contrast of most other frees) [FS#2770] (r15886)
- Fix: Make sure house class/ID counters do not overflow (r15831)
2009-03-30 23:15:05 +00:00
rubidium
7e1385b6eb (svn r15828) [0.7] -Prepare: for 0.7.0-RC2. 2009-03-23 00:19:22 +00:00
rubidium
4ec28e1ba7 (svn r15826) [0.7] -Backport from trunk:
- Update: language files
- Fix: Some (newer) GCCs have trouble compiling the Win32 specific part of fontcache.cpp; jumps across variable declarations [FS#2752] (r15818)
- Fix: When sorting on cost do not sort on the running cost [FS#2749] (r15778)
2009-03-23 00:12:52 +00:00
rubidium
30afba1d10 (svn r15775) [0.7] -Backport from trunk:
- Fix: Do not show the message about reporting an AI crash for the dummy AI (r15774)
- Fix: Number of active clients was not always properly updated [FS#2475] (r15773)
- Fix: Settings from the [gameopt] section (from old 0.6 config files) were overwritten with default values (r15771)
- Fix: Infinite loop when skipping sprites when a GRF is invalid (or truncated) (r15767)
- Fix: Crash when opening the content list window twice; inconsistencies when clicking download twice [FS#2744] (r15766)
2009-03-19 23:50:54 +00:00
rubidium
61e97110c9 (svn r15765) [0.7] -Backport from trunk:
- Change: [NewGRF] Expose GRF ID of engines in var action property 0x25 (r15739)
- Fix: Add Engine::GetDisplayDefaultCapacity() and use it everywhere, so CB 36 is also used everywhere (r15763)
- Fix: [Windows] Inlined UTF-8 characters (in the source code) are not handled properly on Eastern versions of Windows so escape them (r15762)
- Fix: [Windows] On some system searching a font using its English name fails. So now we search the font using the localised name and use the English name for the final 'validation' only (r15757)
2009-03-18 19:50:34 +00:00
rubidium
9e592b9986 (svn r15764) [0.7] -Backport from trunk:
- Fix: Number of houses in house variables 0x44, 0x60 and 0x61 were incorrect after 0xFF had been reached and could desync clients joining afterwards (r15755)
- Fix: Crash when clicking the small area between the savegame list and the save button in the save game window [FS#2742] (r15753)
- Fix: Do not try to (un)draw the cursor when the screen is not ready (r15752)
- Fix: The big UFO sometimes landed just outside the map. Instead of landing, just disappear (fly away) in those cases (r15750)
- Fix: Crash because submarines would sometimes start far outside of the map [FS#2739] (r15748)
- Fix: Road ownership getting lost when removing a road stop [FS#2736] (r15747)
- Fix: Update threading code for OS/2, add mutex support, fix compilation (r15746, r15745)
- Fix: When town generator failed to create requested number of towns, there were too many cities (r15744)
2009-03-18 19:47:05 +00:00
rubidium
de7a4a4006 (svn r15737) [0.7] -Prepare: for 0.7.0-RC1. 2009-03-15 22:42:48 +00:00
rubidium
53dc1a89da (svn r15734) [0.7] -Branch: the long awaited branch so we can introduce new features in trunk before 0.7.0, but not let them destabalize the pending release :) 2009-03-15 22:14:10 +00:00
1918 changed files with 294085 additions and 584110 deletions

View File

@@ -1,14 +0,0 @@
notifications:
global:
irc:
- openttd
- openttd.notice
push:
only:
- master
only-by:
- DorpsGek
commit-comment:
pull-request:
issue:

View File

@@ -1,9 +0,0 @@
root = true
[*]
insert_final_newline = true
trim_trailing_whitespace = true
[*.{c,cpp,h,hpp}]
indent_style = tab
charset = utf-8

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
custom: https://www.openttd.org/donate.html

View File

@@ -1,7 +0,0 @@
## Version of OpenTTD
## Expected result
## Actual result
## Steps to reproduce

34
.github/stale.yml vendored
View File

@@ -1,34 +0,0 @@
daysUntilClose: 7
staleLabel: stale
closeComment: false
exemptMilestones: true
exemptAssignees: true
issues:
daysUntilStale: 60
exemptLabels:
- pinned
- security
- "good first issue"
- regression
markComment: >
This issue has been automatically marked as stale because it has not had any activity in the last two months.
If you believe the issue is still relevant, please test on the latest nightly and report back.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.
pulls:
daysUntilStale: 30
exemptLabels:
- pinned
markComment: >
This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

59
.gitignore vendored
View File

@@ -1,55 +1,12 @@
Makefile*
bin/*
!bin/ai
bin/ai/*
!bin/ai/compat*.nut
!bin/ai/regression
!bin/data
bin/baseset/*
!bin/baseset/openttd.grf
!bin/baseset/opntitle.dat
!bin/baseset/orig_extra.grf
!bin/baseset/orig_*.obg
!bin/baseset/orig_*.obs
!bin/baseset/no_sound.obs
!bin/baseset/no_music.obm
!bin/baseset/orig_*.obm
!bin/game
bin/game/*
!bin/game/compat*.nut
!bin/scripts
bin/scripts/*
!bin/scripts/*.example
!bin/scripts/readme.txt
*.aps
bundle/*
bundles/*
docs/aidocs/*
docs/gamedocs/*
docs/source/*
.kdev4
.kdev4/*
*.kdev4
media/openttd.desktop
media/openttd.desktop.install
!bin/data/chars.grf
!bin/data/openttdd.grf
!bin/data/openttdw.grf
!bin/data/opntitle.grf
!bin/scenario/README
!bin/scripts*
config.*
objs/*
projects/.vs
projects/Debug
projects/Release
projects/*.ncb
projects/*.suo
projects/*.sdf
projects/*.opensdf
projects/*.vcproj.*.user
projects/*.vcxproj.user
projects/*.VC.db
projects/*.VC.opendb
src/rev.cpp
src/os/windows/ottdres.rc
/Makefile*
!/Makefile.msvc
/config.*
!/config.lib
!*.in
*.tmp

View File

@@ -1,34 +1,11 @@
syntax: glob
.svn
*.aps
bin/baseset/openttd.32.bmp
bin/lang/*
bin/openttd*
bin/*.cfg
bin/opentd*
bundle/*
bundles/*
config.cache*
config.cache.*
config.log
config.pwd
docs/aidocs/*
docs/gamedocs/*
docs/source/*
.kdev4
.kdev4/*
*.kdev4
Makefile
Makefile.am
Makefile.bundle
media/openttd.desktop
media/openttd.desktop.install
media/openttd.desktop*
objs/*
projects/.vs
projects/*.ncb
projects/*.suo
projects/*.sdf
projects/*.opensdf
projects/*.vcproj.*.user
projects/*.vcxproj.user
src/rev.cpp
src/os/windows/ottdres.rc

View File

@@ -1,141 +0,0 @@
# Compiling OpenTTD
## Required/optional libraries
The following libraries are used by OpenTTD for:
- zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
heightmaps
- liblzo2: (de)compressing of old (pre 0.3.0) savegames
- liblzma: (de)compressing of savegames (1.1.0 and later)
- libpng: making screenshots and loading heightmaps
- libfreetype: loading generic fonts and rendering them
- libfontconfig: searching for fonts, resolving font names to actual fonts
- libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and
natural sorting of strings (Linux only)
- libSDL2: hardware access (video, sound, mouse) (not required for Windows or macOS)
OpenTTD does not require any of the libraries to be present, but without
liblzma you cannot open most recent savegames and without zlib you cannot
open most older savegames or use the content downloading system.
Without libSDL/liballegro on non-Windows and non-macOS machines you have
no graphical user interface; you would be building a dedicated server.
## Windows:
You need Microsoft Visual Studio 2015 Update 3 or newer.
You can download the free Visual Studio Community Edition from Microsoft at
https://visualstudio.microsoft.com/vs/community/.
OpenTTD needs the Platform SDK, if it isn't installed already. This can be
done during installing Visual Studio, by selecting
`Visual C++ MFC for x86 and x64` (and possibly
`Visual C++ ATL for x86 and x64` depending on your version). If not, you
can get download it as [MS Windows Platform SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk).
Install the SDK by following the instructions as given.
Dependencies for OpenTTD on Windows are handled via
[vcpkg](https://github.com/Microsoft/vcpkg/). First you need to install vcpkg
by following the `Quick Start` instructions of their
[README](https://github.com/Microsoft/vcpkg/blob/master/README.md).
After this, you can install the dependencies OpenTTD needs. We advise to use
the `static` versions, and OpenTTD currently needs the following dependencies:
- liblzma
- libpng
- lzo
- zlib
To install both the x64 (64bit) and x86 (32bit) variants (though only one is necessary), you can use:
```ps
.\vcpkg install liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static
.\vcpkg install liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static
```
Open the relevant project file and it should build automatically.
- VS 2015: projects/openttd_vs140.sln
- VS 2017: projects/openttd_vs141.sln
- VS 2019: projects/openttd_vs142.sln
Set the build mode to `Release` in
`Build > Configuration manager > Active solution configuration`.
You can now compile.
If everything works well the binary should be in `objs\Win[32|64]\Release\openttd.exe`
and in `bin\openttd.exe`
The OpenTTD wiki may provide additional help with [compiling for Windows](https://wiki.openttd.org/Compiling_on_Windows_using_Microsoft_Visual_C%2B%2B_2015).
You can also build OpenTTD with MSYS2/MinGW-w64 or Cygwin/MinGW using the Makefile. The OpenTTD wiki may provide additional help with [MSYS2](https://wiki.openttd.org/Compiling_on_Windows_using_MSYS2)
## Linux, Unix, Solaris:
OpenTTD can be built with GNU '`make`'. On non-GNU systems it is called '`gmake`'.
However, for the first build one has to do a '`./configure`' first.
The OpenTTD wiki may provide additional help with:
- [compiling for Linux and *BSD](https://wiki.openttd.org/Compiling_on_%28GNU/%29Linux_and_*BSD)
- [compiling for Solaris](https://wiki.openttd.org/Compiling_on_Solaris)
## macOS:
Use '`make`' or Xcode (which will then call make for you)
This will give you a binary for your CPU type (PPC/Intel)
However, for the first build one has to do a '`./configure`' first.
To make a universal binary type '`./configure --enable-universal`'
instead of '`./configure`'.
The OpenTTD wiki may provide additional help with [compiling for macOS](https://wiki.openttd.org/Compiling_on_Mac_OS_X).
## Haiku:
Use '`make`', but do a '`./configure`' before the first build.
The OpenTTD wiki may provide additional help with [compiling for Haiku](https://wiki.openttd.org/Compiling_on_Haiku).
## OS/2:
A comprehensive GNU build environment is required to build the OS/2 version.
The OpenTTD wiki may provide additional help with [compiling for OS/2](https://wiki.openttd.org/Compiling_on_OS/2).
## Supported compilers
The following compilers are tested with and known to compile OpenTTD:
- Microsoft Visual C++ (MSVC) 2015, 2017 and 2019.
- GNU Compiler Collection (GCC) 4.8 - 9.
- Clang/LLVM 3.9 - 8
The following compilers are known not to compile OpenTTD:
In general, this is because these old versions do not (fully) support modern
C++11 language features.
- Microsoft Visual C++ (MSVC) 2013 and earlier.
- GNU Compiler Collection (GCC) 4.7 and earlier.
- Clang/LLVM 3.8 and earlier.
If any of these, or any other, compilers can compile OpenTTD, let us know.
Pull requests to support more compilers are welcome.
## Compilation of base sets
To recompile the extra graphics needed to play with the original Transport
Tycoon Deluxe graphics you need GRFCodec (which includes NFORenum) as well.
GRFCodec can be found at https://www.openttd.org/download-grfcodec.
The compilation of these extra graphics does generally not happen, unless
you remove the graphics file using '`make maintainer-clean`'.
Re-compilation of the base sets, thus also use of '`--maintainer-clean`' can
leave the repository in a modified state as different grfcodec versions can
cause binary differences in the resulting grf. Also translations might have
been added for the base sets which are not yet included in the base set
information files. Use the configure option '`--without-grfcodec`' to avoid
modification of the base set files by the build process.

View File

@@ -1,267 +0,0 @@
# Contributing to OpenTTD
Looking to contribute something to OpenTTD? **Here's how you can help.**
Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project.
In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
## Using the issue tracker
The [issue tracker](https://github.com/OpenTTD/OpenTTD/issues) is the preferred channel for [bug reports](#bug-reports), but please respect the following restrictions:
* Please **do not** use the issue tracker for help playing or using OpenTTD.
Please try [irc](https://wiki.openttd.org/IRC_channel), or the [forums](https://www.tt-forums.net/)
* Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others.
* Please **do not** post comments consisting solely of "+1" or ":thumbsup:".
Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) instead.
We reserve the right to delete comments which violate this rule.
* Please **do not** open issues or pull requests regarding add-on content in NewGRF, GameScripts, AIs, etc.
These are created by third-parties. Please try [irc](https://wiki.openttd.org/IRC_channel) or the [forums](https://www.tt-forums.net/) to discuss these.
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful, so thanks!
Guidelines for bug reports:
0. Please don't report issues with games where you changed NewGRFs.
1. Please don't report issues with modified versions of OpenTTD (patchpacks and similar).
2. **Use the GitHub issue search** --- check if the issue has already been
reported.
3. **Check if the issue has been fixed** --- try to reproduce it using the latest `nightly` build of OpenTTD, available from https://www.openttd.org
4. **Isolate the problem** --- ideally create reproduceable steps with an attached savegame and screenshots. Try to use few or no NewGRFs, AIs etc if possible.
A good bug report shouldn't leave others needing to chase you up for more information.
Please try to be as detailed as possible in your report.
* What is your environment?
* What steps will reproduce the issue?
* Which operating system(s) experience the problem?
* What would you expect to be the outcome?
All these details will help people to fix any potential bugs.
Example:
> Short and descriptive example bug report title
>
> A summary of the issue and the OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> Attached savegame
> Attached screenshots showing the issue
> Crashlogs if the bug causes a crash
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).
## Feature requests
Before opening a feature request, please take a moment to find out whether your idea fits with the [scope and goals](./CONTRIBUTING.md#project-goals) of the project.
It's up to *you* to make a strong case to convince the project's developers of the merits of this feature.
Please provide as much detail and context as possible.
This means don't request for a solution, but describe the problem you see and how/why you think it should be fixed.
For feature request we have a strict policy.
Keeping issues around with "a good idea" or "not really a bug but we should maybe fix it" turns out to have the reversed effect: nobody looks at it anymore.
Although we really appreciate feedback and ideas, we will close feature requests that we don't expect to fulfill in the next year.
Many of those ideas etc do have a place on the [forums](https://www.tt-forums.net); and if enough people like it, someone will stand up and make it.
It's usually best discuss in [irc](https://wiki.openttd.org/IRC_channel) before opening a feature request or working on a large feature in a fork.
Discussion in irc can take time, but it can be productive and avoid disappointment :)
## Pull requests
Good pull requests—patches, improvements, new features—are a fantastic help.
Pull requests should fit with the [goals of the project](./CONTRIBUTING.md#project-goals).
**Please do ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
Every pull request should have a clear scope, with no unrelated commits.
[Code style](https://wiki.openttd.org/Coding_style) must be complied with for pull requests to be accepted; this also includes [commit message format](https://wiki.openttd.org/Coding_style#Commit_message).
Adhering to the following process is the best way to get your work included in the project:
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
```bash
git clone https://github.com/<your-username>/OpenTTD.git openttd
git clone https://github.com/OpenTTD/OpenTTD-git-hooks.git openttd_hooks
cd openttd
git remote add upstream https://github.com/OpenTTD/OpenTTD.git
cd .git/hooks
ln -s ../../../openttd_hooks/hooks/* .
```
2. If you cloned a while ago, get the latest changes from upstream:
```bash
git fetch upstream
```
3. Create a new topic branch (off the main project development branch) to
contain your feature, change, or fix:
```bash
git checkout upstream/master -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://wiki.openttd.org/Commit_style#Commit_message) or your code is unlikely to be merged into the main project.
Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
5. Locally rebase the upstream development branch into your topic branch:
```bash
git fetch upstream
git rebase upstream/master
```
6. Push your topic branch up to your fork the first time:
```bash
git push --set-upstream origin <topic-branch-name>
```
And any time after that:
```bash
git push
```
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the `master` branch.
**IMPORTANT**: By submitting a pull request or patch, you agree to the [License](#license) and the [Privacy Notice](CONTRIBUTING.md#privacy-notice).
### Pull request validation
Continuous integration (CI) tools monitor pull requests, and help us identify build and code quality issues.
The results of the CI tests will show on your pull request.
By clicking on Details you can further zoom in; in case of a failure it will show you why it failed.
In case of success it will report how awesome you were.
Tip: [commit message format](https://wiki.openttd.org/Coding_style#Commit_message) is a common reason for pull requests to fail validation.
### Are there any development docs?
There is no single source for OpenTTD development docs. It's a complex project with a long history, and multiple APIs.
A good entry point is [Development](https://wiki.openttd.org/Development) on the OpenTTD wiki; this provides links to wiki documentation and other sources.
The GitHub repo also includes some non-comprehensive documentation in [/docs](./docs).
You may also want the guide to [compiling OpenTTD](./COMPILING.md).
## Project goals
### What are the goals of the official branch?
The main goals of the official branch are:
- Stay faithful to the original gameplay from Transport Tycoon Deluxe
- Improve the user interface
- Allow extending the gameplay with add-ons / mods via supported content APIs
- Provide a (relatively) stable core for both players of the official branch, and for authors of add-ons and maintainers of patchpacks
In contrast, extending or altering the gameplay of the base game is not encouraged.
The rationale behind these goals is that people have different opinions about what OpenTTD is and what it should be.
When it comes to gameplay, there are at least these groups of people:
- *Model railway (mostly singleplayer)*: build "realistic" landscapes, roleplay a world, or even replicate historical scenarios
- *Economical challenge (mostly singleplayer)*: run a business with economical challenges
- *Transport challenge (singleplayer or cooperative multiplayer)*: build efficient track layouts with high cargo throughput and tons of vehicles
- *Competitive speed run (competitive multiplayer)*: maximize some goal in some limited amount of time
When it comes to gameplay features there are at least these groups of interests:
- *Control freak:* micromanagement like conditional orders, refitting and loading etc.
- *Casual:* automatisation like cargodist, path based signalling etc.
To please everyone, the official branch tries to stay close to the original gameplay; after all, that is what everyone brought here.
The preferred method to alter and extent the gameplay is via add-ons like NewGRF and GameScripts.
For a long time, the official branch was also open to features which could be enabled/disabled, but the corner-cases that came with some configurations have rendered some parts of the code very complicated.
Today, new features have to work with all the already existing features, which is not only challenging in corner cases, but also requires spending considerable more work than just "making it work in the game mode that I play".
The preferred method to introduce new gameplay features is to extend the content APIs, supporting ever more add-on content / mods.
This moves conflict-solving away from the codebase to content authors / players.
It is more accepted for add-ons not working together than the base game not working with certain setting combinations.
In general the game should allow anything that doesn't violate basic rules, but it should warn players if they take potentially dangerous or "stupid" actions.
For example, players are not prevented from starting vehicles without orders, but will receive a warning about vehicles having too few orders.
This lack of limitation has led to players challenging themselves to create networks where all vehicles have no orders, increasing gameplay possibilities.
### I do not agree with the goals of the official branch, what can I do instead?
Fork! There is a rich history of experimental patches for OpenTTD.
Many of these will never be accepted for core, but are creative and interesting ways to modify OpenTTD.
Sometimes patches are combined into long-running patchpacks, modified OpenTTD versions which can be downloaded by anyone, or modified OpenTTD clients for dedicated multiplayer servers.
One of the reasons to keep core relatively stable is to make life easier for patch authors and patchpack maintainers where possible.
Patchpack discussions and related topics may be found in community sites such as [TT-Forums development section](https://www.tt-forums.net/viewforum.php?f=33).
## Legal stuff
### License
By contributing your code, you agree to license your contribution under the [GPL v2](https://github.com/OpenTTD/OpenTTD/blob/master/COPYING.md).
### Privacy Notice
We would like to make you aware that contributing to OpenTTD via git will permanently store the name and email address you provide as well as the actual changes and the time and date you made it inside git's version history.
This is inevitable, because it is a main feature of git.
If you are concerned about your privacy, we strongly recommend to use "Anonymous &lt;anonymous@openttd.org&gt;" as the git commit author. We might refuse anonymous contributions if malicious intent is suspected.
Please note that the contributor identity, once given, is used for copyright verification and to provide proof should a malicious commit be made.
As such, the [EU GDPR](https://www.eugdpr.org/key-changes.html) "right to be forgotten" does not apply, as this is an overriding legitimate interest.
Please also note that your commit is public and as such will potentially be processed by many third-parties.
Git's distributed nature makes it impossible to track where exactly your commit, and thus your personal data, will be stored and be processed.
If you would not like to accept this risk, please do either commit anonymously or refrain from contributing to the OpenTTD project.
### Attribution of this Contributing Guide
This contributing guide is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported License](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE) terms for Bootstrap documentation.
The GDPR notice is adapted from [rsyslog](https://github.com/rsyslog/rsyslog/blob/master/CONTRIBUTING.md) under the [GNU General Public License](https://github.com/rsyslog/rsyslog/blob/master/COPYING).

View File

@@ -1,19 +1,14 @@
This is the license which applies to OpenTTD with the exception of some
3rd party modules. See [./README.md](./README.md) for details
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU General Public License
==========================
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
_Version 2, June 1991_
_Copyright © 1989, 1991 Free Software Foundation, Inc.,_
_51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA_
Preamble
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
### Preamble
The licenses for most software are designed to take away your
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
@@ -23,47 +18,48 @@ using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: **(1)** copyright the software, and
**(2)** offer you this license which gives you legal permission to copy,
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
The precise terms and conditions for copying, distribution and
modification follow.
### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
**0.** This License applies to any program or other work which contains
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
@@ -80,7 +76,7 @@ is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
**1.** You may copy and distribute verbatim copies of the Program's
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
@@ -91,27 +87,29 @@ along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
**2.** You may modify your copy or copies of the Program or any portion
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
* **a)** You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
* **b)** You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
* **c)** If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
@@ -133,24 +131,26 @@ with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
**3.** You may copy and distribute the Program (or a work based on it,
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
* **a)** Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
* **b)** Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
* **c)** Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
@@ -169,7 +169,7 @@ access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
**4.** You may not copy, modify, sublicense, or distribute the Program
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
@@ -177,7 +177,7 @@ However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
**5.** You are not required to accept this License, since you have not
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
@@ -186,7 +186,7 @@ Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
**6.** Each time you redistribute the Program (or any work based on the
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
@@ -194,7 +194,7 @@ restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
**7.** If, as a consequence of a court judgment or allegation of patent
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
@@ -226,7 +226,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
**8.** If the distribution and/or use of the Program is restricted in
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
@@ -234,7 +234,7 @@ those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
**9.** The Free Software Foundation may publish revised and/or new versions
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
@@ -247,7 +247,7 @@ Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
**10.** If you wish to incorporate parts of the Program into other free
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
@@ -255,9 +255,9 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
### NO WARRANTY
NO WARRANTY
**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
@@ -267,7 +267,7 @@ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
@@ -277,15 +277,15 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
@@ -317,20 +317,20 @@ when it starts in an interactive mode:
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w` and `show c` should show the appropriate
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w` and `show c`; they could even be
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may

187
Doxyfile
View File

@@ -1,21 +1,9 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = OpenTTD
PROJECT_NUMBER =
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = docs/source/
CREATE_SUBDIRS = YES
ALLOW_UNICODE_NAMES = NO
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
@@ -37,42 +25,23 @@ STRIP_FROM_PATH = ./
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 2
ALIASES =
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
TOC_INCLUDE_HEADINGS = 0
AUTOLINK_SUPPORT = YES
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
GROUP_NESTED_COMPOUNDS = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = YES
EXTRACT_PACKAGE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = YES
EXTRACT_ANON_NSPACES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
@@ -80,17 +49,11 @@ HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
@@ -98,69 +61,58 @@ GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./src/
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.h \
*.hpp
*.hpp \
table/*.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */3rdparty \
*/script/api
EXCLUDE_SYMBOLS =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = ./docs/
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
@@ -168,58 +120,19 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = NO
HTML_DYNAMIC_MENUS = YES
HTML_DYNAMIC_SECTIONS = NO
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
GENERATE_HTMLHELP = NO
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = YES
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = YES
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/
MATHJAX_EXTENSIONS =
MATHJAX_CODEFILE =
SEARCHENGINE = NO
SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
@@ -229,18 +142,12 @@ COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_FILES =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
@@ -248,33 +155,27 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
@@ -289,66 +190,42 @@ EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = WITH_ZLIB \
WITH_LZO \
WITH_LIBLZMA \
WITH_SDL \
WITH_PNG \
WITH_FONTCONFIG \
WITH_FREETYPE \
WITH_ICU_I18N \
WITH_ICU_LX \
UNICODE \
_UNICODE \
_GNU_SOURCE \
FINAL=
EXPAND_AS_DEFINED =
PREDEFINED =
EXPAND_AS_DEFINED = DEF_COMMAND
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = objs/openttd.tag
GENERATE_TAGFILE = openttd.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
UML_LIMIT_NUM_FIELDS = 10
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_CFG_FILE =
PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View File

@@ -1,41 +1,34 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
#
# Creation of bundles
#
# The revision is needed for the bundle name and creating an OSX application bundle.
ifdef REVISION
REV := $(REVISION)
else
# Detect the revision
VERSIONS := $(shell AWK="$(AWK)" "$(ROOT_DIR)/findversion.sh")
VERSION := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
endif
# Make sure we have something in VERSION
ifeq ($(VERSION),)
VERSION := norev000
# Make sure we have something in REV
ifeq ($(REV),)
REV := norev000
endif
ifndef BUNDLE_NAME
BUNDLE_NAME = openttd-custom-$(VERSION)-$(OS)
BUNDLE_NAME = openttd-custom-$(REV)-$(OS)
endif
# An OSX application bundle needs the data files, lang files and openttd executable in a different location.
ifdef OSXAPP
AI_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/ai
GAME_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/game
BASESET_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/baseset
LANG_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/lang
TTD_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/MacOS
DATA_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/data
LANG_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/lang
TTD_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/MacOS
else
AI_DIR = $(BUNDLE_DIR)/ai
GAME_DIR = $(BUNDLE_DIR)/game
BASESET_DIR = $(BUNDLE_DIR)/baseset
LANG_DIR = $(BUNDLE_DIR)/lang
TTD_DIR = $(BUNDLE_DIR)
DATA_DIR = $(BUNDLE_DIR)/data
LANG_DIR = $(BUNDLE_DIR)/lang
TTD_DIR = $(BUNDLE_DIR)
endif
bundle: all
@@ -46,33 +39,27 @@ bundle: all
$(Q)mkdir -p "$(BUNDLE_DIR)/media"
$(Q)mkdir -p "$(BUNDLE_DIR)/scripts"
$(Q)mkdir -p "$(TTD_DIR)"
$(Q)mkdir -p "$(AI_DIR)"
$(Q)mkdir -p "$(GAME_DIR)"
$(Q)mkdir -p "$(BASESET_DIR)"
$(Q)mkdir -p "$(DATA_DIR)"
$(Q)mkdir -p "$(LANG_DIR)"
ifdef OSXAPP
$(Q)mkdir -p "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources"
$(Q)echo "APPL????" > "$(BUNDLE_DIR)/$(OSXAPP)/Contents/PkgInfo"
$(Q)cp "$(ROOT_DIR)/os/macosx/openttd.icns" "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/openttd.icns"
$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh "$(BUNDLE_DIR)/$(OSXAPP)" "$(VERSION)"
$(Q)cp "$(ROOT_DIR)/os/macosx/splash.png" "$(BASESET_DIR)"
endif
ifeq ($(OS),UNIX)
$(Q)cp "$(ROOT_DIR)/media/openttd.32.bmp" "$(BASESET_DIR)/"
$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh "$(BUNDLE_DIR)/$(OSXAPP)" "$(REV)"
$(Q)cp "$(ROOT_DIR)/docs/OSX_install_instructions.txt" "$(BUNDLE_DIR)/docs/"
$(Q)cp "$(ROOT_DIR)/os/macosx/splash.png" "$(DATA_DIR)"
endif
$(Q)cp "$(BIN_DIR)/$(TTD)" "$(TTD_DIR)/"
$(Q)cp "$(BIN_DIR)/ai/"compat_*.nut "$(AI_DIR)/"
$(Q)cp "$(BIN_DIR)/game/"compat_*.nut "$(GAME_DIR)/"
$(Q)cp "$(BIN_DIR)/baseset/"*.grf "$(BASESET_DIR)/"
$(Q)cp "$(BIN_DIR)/baseset/"*.obg "$(BASESET_DIR)/"
$(Q)cp "$(BIN_DIR)/baseset/"*.obs "$(BASESET_DIR)/"
$(Q)cp "$(BIN_DIR)/baseset/opntitle.dat" "$(BASESET_DIR)/"
$(Q)cp "$(BIN_DIR)/baseset/"*.obm "$(BASESET_DIR)/"
$(Q)cp "$(BIN_DIR)/data/"*.grf "$(DATA_DIR)/"
$(Q)cp "$(BIN_DIR)/data/"*.obg "$(DATA_DIR)/"
$(Q)cp "$(BIN_DIR)/data/opntitle.dat" "$(DATA_DIR)/"
$(Q)cp "$(BIN_DIR)/lang/"*.lng "$(LANG_DIR)/"
$(Q)cp "$(ROOT_DIR)/README.md" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/COPYING.md" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/readme.txt" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/COPYING" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/known-bugs.txt" "$(BUNDLE_DIR)/"
$(Q)cp "$(ROOT_DIR)/docs/multiplayer.md" "$(BUNDLE_DIR)/docs/"
$(Q)cp "$(ROOT_DIR)/docs/obg_format.txt" "$(BUNDLE_DIR)/docs/"
$(Q)cp "$(ROOT_DIR)/docs/multiplayer.txt" "$(BUNDLE_DIR)/docs/"
$(Q)cp "$(ROOT_DIR)/docs/32bpp.txt" "$(BUNDLE_DIR)/docs/"
$(Q)cp "$(ROOT_DIR)/changelog.txt" "$(BUNDLE_DIR)/"
ifdef MAN_DIR
$(Q)mkdir -p "$(BUNDLE_DIR)/man/"
@@ -84,11 +71,16 @@ endif
$(Q)cp "$(BIN_DIR)/scripts/"* "$(BUNDLE_DIR)/scripts/"
ifdef MENU_DIR
$(Q)cp "$(ROOT_DIR)/media/openttd.desktop" "$(BUNDLE_DIR)/media/"
$(Q)$(AWK) -f "$(ROOT_DIR)/media/openttd.desktop.translation.awk" "$(SRC_DIR)/lang/"*.txt | LC_ALL=C $(SORT) | $(AWK) -f "$(ROOT_DIR)/media/openttd.desktop.filter.awk" >> "$(BUNDLE_DIR)/media/openttd.desktop"
$(Q)sed s/=openttd/=$(BINARY_NAME)/g "$(BUNDLE_DIR)/media/openttd.desktop" > "$(ROOT_DIR)/media/openttd.desktop.install"
$(Q)cat "$(ROOT_DIR)/media/openttd.desktop" | sed s/=openttd/=$(BINARY_NAME)/g > "$(ROOT_DIR)/media/openttd.desktop.install"
endif
ifeq ($(TTD), openttd.exe)
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/README.md" "$(BUNDLE_DIR)/COPYING.md" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt"
$(Q)unix2dos "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/readme.txt" "$(BUNDLE_DIR)/COPYING" "$(BUNDLE_DIR)/changelog.txt" "$(BUNDLE_DIR)/known-bugs.txt"
ifeq ($(OS), DOS)
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi.txt" "$(BUNDLE_DIR)/docs/"
ifndef STRIP
$(Q)cp "$(ROOT_DIR)/os/dos/cwsdpmi.exe" "$(TTD_DIR)/"
endif
endif
endif
### Packing the current bundle into several compressed file formats ###
@@ -103,11 +95,6 @@ bundle_zip: bundle
$(Q)mkdir -p "$(BUNDLES_DIR)"
$(Q)cd "$(BUNDLE_DIR)" && zip -r $(shell if test -z "$(VERBOSE)"; then echo '-q'; fi) "$(BUNDLES_DIR)/$(BUNDLE_NAME).zip" .
bundle_7z: bundle
@echo '[BUNDLE] Creating $(BUNDLE_NAME).7z'
$(Q)mkdir -p "$(BUNDLES_DIR)"
$(Q)cd "$(BUNDLE_DIR)" && 7z a "$(BUNDLES_DIR)/$(BUNDLE_NAME).7z" .
bundle_gzip: bundle
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.gz'
$(Q)mkdir -p "$(BUNDLES_DIR)/.gzip/$(BUNDLE_NAME)"
@@ -122,20 +109,6 @@ bundle_bzip2: bundle
$(Q)cd "$(BUNDLES_DIR)/.bzip2" && tar -jc$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.bz2" "$(BUNDLE_NAME)"
$(Q)rm -rf "$(BUNDLES_DIR)/.bzip2"
bundle_lzma: bundle
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.lzma'
$(Q)mkdir -p "$(BUNDLES_DIR)/.lzma/$(BUNDLE_NAME)"
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.lzma/$(BUNDLE_NAME)/"
$(Q)cd "$(BUNDLES_DIR)/.lzma" && tar --lzma -c$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.lzma" "$(BUNDLE_NAME)"
$(Q)rm -rf "$(BUNDLES_DIR)/.lzma"
bundle_xz: bundle
@echo '[BUNDLE] Creating $(BUNDLE_NAME).tar.xz'
$(Q)mkdir -p "$(BUNDLES_DIR)/.xz/$(BUNDLE_NAME)"
$(Q)cp -R "$(BUNDLE_DIR)/"* "$(BUNDLES_DIR)/.xz/$(BUNDLE_NAME)/"
$(Q)cd "$(BUNDLES_DIR)/.xz" && tar --xz -c$(shell if test -n "$(VERBOSE)"; then echo 'v'; fi)f "$(BUNDLES_DIR)/$(BUNDLE_NAME).tar.xz" "$(BUNDLE_NAME)"
$(Q)rm -rf "$(BUNDLES_DIR)/.xz"
bundle_lha: bundle
@echo '[BUNDLE] Creating $(BUNDLE_NAME).lha'
$(Q)mkdir -p "$(BUNDLES_DIR)/.lha/$(BUNDLE_NAME)"
@@ -145,17 +118,17 @@ bundle_lha: bundle
bundle_dmg: bundle
@echo '[BUNDLE] Creating $(BUNDLE_NAME).dmg'
$(Q)mkdir -p "$(BUNDLES_DIR)/OpenTTD $(VERSION)"
$(Q)cp -R "$(BUNDLE_DIR)/" "$(BUNDLES_DIR)/OpenTTD $(VERSION)"
$(Q)hdiutil create -ov -format UDZO -srcfolder "$(BUNDLES_DIR)/OpenTTD $(VERSION)" "$(BUNDLES_DIR)/$(BUNDLE_NAME).dmg"
$(Q)rm -fr "$(BUNDLES_DIR)/OpenTTD $(VERSION)"
$(Q)mkdir -p "$(BUNDLES_DIR)/OpenTTD $(REV)"
$(Q)cp -R "$(BUNDLE_DIR)/" "$(BUNDLES_DIR)/OpenTTD $(REV)"
$(Q)hdiutil create -ov -format UDZO -srcfolder "$(BUNDLES_DIR)/OpenTTD $(REV)" "$(BUNDLES_DIR)/$(BUNDLE_NAME).dmg"
$(Q)rm -fr "$(BUNDLES_DIR)/OpenTTD $(REV)"
bundle_exe: all
@echo '[BUNDLE] Creating $(BUNDLE_NAME).exe'
$(Q)mkdir -p "$(BUNDLES_DIR)"
$(Q)unix2dos "$(ROOT_DIR)/docs/"* "$(ROOT_DIR)/README.md" "$(ROOT_DIR)/COPYING.md" "$(ROOT_DIR)/changelog.txt" "$(ROOT_DIR)/known-bugs.txt"
$(Q)cd $(ROOT_DIR)/os/windows/installer && makensis.exe //DVERSION_INCLUDE=version_$(PLATFORM).txt install.nsi
$(Q)mv $(ROOT_DIR)/os/windows/installer/*$(PLATFORM).exe "$(BUNDLES_DIR)/$(BUNDLE_NAME).exe"
$(Q)unix2dos "$(ROOT_DIR)/docs/"* "$(ROOT_DIR)/readme.txt" "$(ROOT_DIR)/COPYING" "$(ROOT_DIR)/changelog.txt" "$(ROOT_DIR)/known-bugs.txt"
$(Q)cd $(ROOT_DIR)/os/win32/installer && makensis.exe //DVERSION_INCLUDE=version_$(PLATFORM).txt install.nsi
$(Q)mv $(ROOT_DIR)/os/win32/installer/*$(PLATFORM).exe "$(BUNDLES_DIR)/$(BUNDLE_NAME).exe"
ifdef OSXAPP
install:
@@ -165,33 +138,22 @@ install: bundle
@echo '[INSTALL] Installing OpenTTD'
$(Q)install -d "$(INSTALL_BINARY_DIR)"
$(Q)install -d "$(INSTALL_ICON_DIR)"
$(Q)install -d "$(INSTALL_DATA_DIR)/ai"
$(Q)install -d "$(INSTALL_DATA_DIR)/game"
$(Q)install -d "$(INSTALL_DATA_DIR)/baseset"
$(Q)install -d "$(INSTALL_DATA_DIR)/gm"
$(Q)install -d "$(INSTALL_DATA_DIR)/data"
$(Q)install -d "$(INSTALL_DATA_DIR)/lang"
$(Q)install -d "$(INSTALL_DATA_DIR)/scripts"
$(Q)install -d "$(INSTALL_DOC_DIR)"
ifeq ($(TTD), openttd.exe)
$(Q)install -m 755 "$(BUNDLE_DIR)/$(TTD)" "$(INSTALL_BINARY_DIR)/${BINARY_NAME}.exe"
else
$(Q)install -m 755 "$(BUNDLE_DIR)/$(TTD)" "$(INSTALL_BINARY_DIR)/${BINARY_NAME}"
endif
$(Q)install -m 644 "$(BUNDLE_DIR)/lang/"* "$(INSTALL_DATA_DIR)/lang"
$(Q)install -m 644 "$(BUNDLE_DIR)/ai/"* "$(INSTALL_DATA_DIR)/ai"
$(Q)install -m 644 "$(BUNDLE_DIR)/game/"* "$(INSTALL_DATA_DIR)/game"
$(Q)install -m 644 "$(BUNDLE_DIR)/baseset/"* "$(INSTALL_DATA_DIR)/baseset"
$(Q)install -m 644 "$(BUNDLE_DIR)/data/"* "$(INSTALL_DATA_DIR)/data"
$(Q)install -m 644 "$(BUNDLE_DIR)/scripts/"* "$(INSTALL_DATA_DIR)/scripts"
ifndef DO_NOT_INSTALL_DOCS
$(Q)install -d "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(BUNDLE_DIR)/README.md" "$(BUNDLE_DIR)/known-bugs.txt" "$(INSTALL_DOC_DIR)"
endif
ifndef DO_NOT_INSTALL_CHANGELOG
$(Q)install -d "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/changelog.txt" "$(INSTALL_DOC_DIR)"
endif
ifndef DO_NOT_INSTALL_LICENSE
$(Q)install -d "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/COPYING.md" "$(INSTALL_DOC_DIR)"
endif
$(Q)install -m 644 "$(BUNDLE_DIR)/docs/"* "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/"*.txt "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/COPYING" "$(INSTALL_DOC_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/media/openttd.32.xpm" "$(INSTALL_ICON_DIR)/${BINARY_NAME}.32.xpm"
ifdef ICON_THEME_DIR
$(Q)install -d "$(INSTALL_ICON_THEME_DIR)"
@@ -211,11 +173,9 @@ else
$(Q)install -m 644 "$(BUNDLE_DIR)/media/"*.png "$(INSTALL_ICON_DIR)"
endif
ifdef MAN_DIR
ifndef DO_NOT_INSTALL_MAN
$(Q)install -d "$(INSTALL_MAN_DIR)"
$(Q)install -m 644 "$(BUNDLE_DIR)/man/openttd.6.gz" "$(INSTALL_MAN_DIR)/${BINARY_NAME}.6.gz"
endif
endif
ifdef MENU_DIR
$(Q)install -d "$(INSTALL_MENU_DIR)"
$(Q)install -m 644 "$(ROOT_DIR)/media/openttd.desktop.install" "$(INSTALL_MENU_DIR)/${BINARY_NAME}.desktop"

View File

@@ -1,118 +0,0 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
#
# Building requires GRFCodec.
#
# Recent versions (including sources) can be found at:
# http://www.openttd.org/download-grfcodec
#
# The mercurial repository can be found at:
# http://hg.openttdcoop.org/grfcodec
#
ROOT_DIR = !!ROOT_DIR!!
GRF_DIR = $(ROOT_DIR)/media/extra_grf
BASESET_DIR = $(ROOT_DIR)/media/baseset
LANG_DIR = $(ROOT_DIR)/src/lang
BIN_DIR = !!BIN_DIR!!/baseset
OBJS_DIR = !!GRF_OBJS_DIR!!
OS = !!OS!!
STAGE = !!STAGE!!
# Check if we want to show what we are doing
ifdef VERBOSE
Q =
E = @true
else
Q = @
E = @echo
endif
GRFCODEC := !!GRFCODEC!!
NFORENUM := !!NFORENUM!!
CC_BUILD := !!CC_BUILD!!
MD5SUM := $(shell [ "$(OS)" = "OSX" ] && echo "md5 -r" || echo "md5sum")
# Some "should not be changed" settings.
NFO_FILES := $(GRF_DIR)/*.nfo $(GRF_DIR)/rivers/*.nfo
PNG_FILES := $(GRF_DIR)/*.png $(GRF_DIR)/rivers/*.png
# List of target files.
OBT_FILES := $(BIN_DIR)/orig_dos.obg
OBT_FILES += $(BIN_DIR)/orig_dos_de.obg
OBT_FILES += $(BIN_DIR)/orig_win.obg
OBT_FILES += $(BIN_DIR)/orig_dos.obs
OBT_FILES += $(BIN_DIR)/orig_win.obs
OBT_FILES += $(BIN_DIR)/no_sound.obs
OBT_FILES += $(BIN_DIR)/orig_dos.obm
OBT_FILES += $(BIN_DIR)/orig_win.obm
OBT_FILES += $(BIN_DIR)/no_music.obm
OBT_FILES += $(BIN_DIR)/orig_tto.obm
# Build the GRF.
all: $(OBT_FILES)
ifdef GRFCODEC
all: $(BIN_DIR)/openttd.grf $(BIN_DIR)/orig_extra.grf
endif
$(OBJS_DIR)/langfiles.tmp: $(LANG_DIR)/*.txt
$(E) '$(STAGE) Collecting baseset translations'
$(Q) cat $^ > $@
$(BIN_DIR)/%.obg: $(BASESET_DIR)/%.obg $(BIN_DIR)/orig_extra.grf $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
$(E) '$(STAGE) Updating $(notdir $@)'
$(Q) sed 's/^ORIG_EXTRA.GRF = *[0-9a-f]*$$/ORIG_EXTRA.GRF = '`$(MD5SUM) $(BIN_DIR)/orig_extra.grf | sed 's@ .*@@'`'/' $< > $@.tmp
$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $@.tmp >$@
$(Q) rm $@.tmp
$(BIN_DIR)/%.obs: $(BASESET_DIR)/%.obs $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
$(E) '$(STAGE) Updating $(notdir $@)'
$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $< >$@
$(BIN_DIR)/%.obm: $(BASESET_DIR)/%.obm $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
$(E) '$(STAGE) Updating $(notdir $@)'
$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $< >$@
# Guard against trying to run GRFCODEC/NFORENUM without either being set.
ifdef GRFCODEC
ifdef NFORENUM
# Compile extra grf
$(BIN_DIR)/openttd.grf: $(PNG_FILES) $(NFO_FILES) $(GRF_DIR)/assemble_nfo.awk
$(E) '$(STAGE) Assembling openttd.nfo'
$(Q)-mkdir -p $(OBJS_DIR)/sprites
$(Q)-cp $(PNG_FILES) $(OBJS_DIR)/sprites 2> /dev/null
$(Q) awk -f $(GRF_DIR)/assemble_nfo.awk $(GRF_DIR)/openttd.nfo > $(OBJS_DIR)/sprites/openttd.nfo
$(Q) $(NFORENUM) -s $(OBJS_DIR)/sprites/openttd.nfo
$(E) '$(STAGE) Compiling openttd.grf'
$(Q) $(GRFCODEC) -n -s -e -p1 $(OBJS_DIR)/openttd.grf
$(Q)cp $(OBJS_DIR)/openttd.grf $(BIN_DIR)/openttd.grf
# The copy operation of PNG_FILES is duplicated from the target 'openttd.grf', thus those targets may not run in parallel.
$(BIN_DIR)/orig_extra.grf: $(PNG_FILES) $(NFO_FILES) $(GRF_DIR)/assemble_nfo.awk | $(BIN_DIR)/openttd.grf
$(E) '$(STAGE) Assembling orig_extra.nfo'
$(Q)-mkdir -p $(OBJS_DIR)/sprites
$(Q)-cp $(PNG_FILES) $(OBJS_DIR)/sprites 2> /dev/null
$(Q) awk -f $(GRF_DIR)/assemble_nfo.awk $(GRF_DIR)/orig_extra.nfo > $(OBJS_DIR)/sprites/orig_extra.nfo
$(Q) $(NFORENUM) -s $(OBJS_DIR)/sprites/orig_extra.nfo
$(E) '$(STAGE) Compiling orig_extra.grf'
$(Q) $(GRFCODEC) -n -s -e -p1 $(OBJS_DIR)/orig_extra.grf
$(Q)cp $(OBJS_DIR)/orig_extra.grf $(BIN_DIR)/orig_extra.grf
endif
endif
# Clean up temporary files.
clean:
$(Q)rm -f *.bak *.grf $(OBT_FILES)
# Clean up temporary files
mrproper: clean
$(Q)rm -fr sprites
.PHONY: all mrproper depend clean

View File

@@ -1,10 +1,3 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
# Check if we want to show what we are doing
ifdef VERBOSE
Q =
@@ -14,46 +7,46 @@ endif
include Makefile.am
CONFIG_CACHE_PWD = !!CONFIG_CACHE_PWD!!
SOURCE_LIST = !!SOURCE_LIST!!
CONFIG_CACHE_SOURCE_LIST = !!CONFIG_CACHE_SOURCE_LIST!!
BIN_DIR = !!BIN_DIR!!
ICON_THEME_DIR = !!ICON_THEME_DIR!!
MAN_DIR = !!MAN_DIR!!
MENU_DIR = !!MENU_DIR!!
SRC_DIR = !!SRC_DIR!!
ROOT_DIR = !!ROOT_DIR!!
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
INSTALL_DIR = !!INSTALL_DIR!!
INSTALL_BINARY_DIR = "$(INSTALL_DIR)/"!!BINARY_DIR!!
INSTALL_MAN_DIR = "$(INSTALL_DIR)/$(MAN_DIR)"
INSTALL_MENU_DIR = "$(INSTALL_DIR)/$(MENU_DIR)"
INSTALL_ICON_DIR = "$(INSTALL_DIR)/"!!ICON_DIR!!
INSTALL_ICON_THEME_DIR = "$(INSTALL_DIR)/$(ICON_THEME_DIR)"
INSTALL_DATA_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
INSTALL_DOC_DIR = "$(INSTALL_DIR)/"!!DOC_DIR!!
SOURCE_LIST = !!SOURCE_LIST!!
CONFIG_CACHE_PWD = !!CONFIG_CACHE_PWD!!
CONFIGURE_FILES = !!CONFIGURE_FILES!!
LIPO = !!LIPO!!
BIN_DIR = !!BIN_DIR!!
ICON_THEME_DIR = !!ICON_THEME_DIR!!
MAN_DIR = !!MAN_DIR!!
MENU_DIR = !!MENU_DIR!!
SRC_DIR = !!SRC_DIR!!
ROOT_DIR = !!ROOT_DIR!!
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
INSTALL_DIR = !!INSTALL_DIR!!
INSTALL_BINARY_DIR = "$(INSTALL_DIR)/"!!BINARY_DIR!!
INSTALL_MAN_DIR = "$(INSTALL_DIR)/$(MAN_DIR)"
INSTALL_MENU_DIR = "$(INSTALL_DIR)/$(MENU_DIR)"
INSTALL_ICON_DIR = "$(INSTALL_DIR)/"!!ICON_DIR!!
INSTALL_ICON_THEME_DIR = "$(INSTALL_DIR)/$(ICON_THEME_DIR)"
INSTALL_DATA_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
INSTALL_DOC_DIR = "$(INSTALL_DIR)/"!!DOC_DIR!!
BINARY_NAME = !!BINARY_NAME!!
STRIP = !!STRIP!!
TTD = !!TTD!!
TTDS = $(SRC_DIRS:%=%/$(TTD))
OS = !!OS!!
OSXAPP = !!OSXAPP!!
LIPO = !!LIPO!!
AWK = !!AWK!!
SORT = !!SORT!!
DISTCC = !!DISTCC!!
STRIP = !!STRIP!!
TTD = !!TTD!!
TTDS = $(SRC_DIRS:%=%/$(TTD))
OS = !!OS!!
OSXAPP = !!OSXAPP!!
REVISION = !!REVISION!!
AWK = !!AWK!!
DISTCC = !!DISTCC!!
RES := $(shell if [ ! -f $(CONFIG_CACHE_PWD) ] || [ "`pwd`" != "`cat $(CONFIG_CACHE_PWD)`" ]; then echo "`pwd`" > $(CONFIG_CACHE_PWD); fi )
RES := $(shell if [ ! -f $(CONFIG_CACHE_SOURCE_LIST) ] || [ -n "`cmp $(CONFIG_CACHE_SOURCE_LIST) $(SOURCE_LIST) 2>/dev/null`" ]; then cp $(SOURCE_LIST) $(CONFIG_CACHE_SOURCE_LIST); fi )
all: config.pwd config.cache
ifdef DISTCC
@if [ -z "`echo '$(MFLAGS)' | grep '\-j'`" ]; then echo; echo "WARNING: you enabled distcc support, but you don't seem to be using the -jN parameter"; echo; fi
@if [ -z "`echo '$(MFLAGS)' | grep '\-j'`" ]; then echo; echo "WARNING: you enabled distcc support, but you don't seem to be using the -jN paramter"; echo; fi
endif
@for dir in $(DIRS); do \
$(MAKE) -C $$dir all || exit 1; \
$(MAKE) -C $$dir all; \
done
ifdef LIPO
# Lipo is an OSX thing. If it is defined, it means we are building for universal,
@@ -100,7 +93,7 @@ ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
@echo " Going to reconfigure with last known settings..."
@echo "----------------"
# Make sure we don't lock config.cache
@$(shell cat config.cache | sed 's@\\ @\\\\ @g') || exit 1
@$(shell cat config.cache | sed 's~\\ ~\\\\ ~g') || exit 1
@echo "----------------"
@echo "Reconfig done. Please re-execute make."
@echo "----------------"
@@ -125,34 +118,14 @@ lang:
mrproper:
@for dir in $(DIRS); do \
$(MAKE) -C $$dir mrproper; \
done
# Don't be tempted to merge these two for loops. Doing that breaks make
# --dry-run, since make has this "feature" that it always runs commands
# containing $(MAKE), even when --dry-run is passed. The objective is of
# course to also get a dry-run of submakes, but make is not smart enough
# to see that a for loop runs both a submake and an actual command.
@for dir in $(DIRS); do \
rm -f $$dir/Makefile; \
done
$(Q)rm -rf objs
$(Q)rm -f Makefile Makefile.am Makefile.bundle
$(Q)rm -f media/openttd.desktop media/openttd.desktop.install
$(Q)rm -f media/openttd.desktop
$(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.pwd config.log $(CONFIG_CACHE_PWD)
# directories for bundle generation
$(Q)rm -rf $(BUNDLE_DIR)
$(Q)rm -rf $(BUNDLES_DIR)
# output of profiling
$(Q)rm -f $(BIN_DIR)/gmon.out
# output of generating 'API' documentation
$(Q)rm -rf $(ROOT_DIR)/docs/source
$(Q)rm -rf $(ROOT_DIR)/docs/aidocs
$(Q)rm -rf $(ROOT_DIR)/docs/gamedocs
# directories created by OpenTTD on regression testing
$(Q)rm -rf $(BIN_DIR)/ai/regression/content_download $(BIN_DIR)/ai/regression/save $(BIN_DIR)/ai/regression/scenario
distclean: mrproper
maintainer-clean: distclean
$(Q)rm -f $(BIN_DIR)/baseset/openttd.grf $(BIN_DIR)/baseset/orig_extra.grf $(BIN_DIR)/baseset/*.obg $(BIN_DIR)/baseset/*.obs $(BIN_DIR)/baseset/*.obm
depend:
@for dir in $(SRC_DIRS); do \
@@ -170,7 +143,6 @@ run-prof: all
regression: all
$(Q)cd !!BIN_DIR!! && sh ai/regression/run.sh
test: regression
%.o:
@for dir in $(SRC_DIRS); do \
@@ -182,6 +154,4 @@ test: regression
$(MAKE) -C $$dir $@; \
done
.PHONY: test distclean mrproper clean
include Makefile.bundle

View File

@@ -1,29 +1,26 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
STRGEN = !!STRGEN!!
SRC_DIR = !!SRC_DIR!!
LANG_DIR = !!LANG_DIR!!
BIN_DIR = !!BIN_DIR!!
LANGS_SRC = $(shell ls $(LANG_DIR)/*.txt)
LANGS = $(LANGS_SRC:$(LANG_DIR)/%.txt=%.lng)
CXX_BUILD = !!CXX_BUILD!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
CXXFLAGS_BUILD= !!CXXFLAGS_BUILD!!
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
STRGEN_FLAGS = !!STRGEN_FLAGS!!
STAGE = !!STAGE!!
LANG_SUPPRESS = !!LANG_SUPPRESS!!
LANG_OBJS_DIR = !!LANG_OBJS_DIR!!
STRGEN = !!STRGEN!!
ENDIAN_CHECK = !!ENDIAN_CHECK!!
SRC_DIR = !!SRC_DIR!!
LANG_DIR = !!LANG_DIR!!
BIN_DIR = !!BIN_DIR!!
LANGS_SRC = $(shell ls $(LANG_DIR)/*.txt)
LANGS = $(LANGS_SRC:$(LANG_DIR)/%.txt=%.lng)
CXX_BUILD = !!CXX_BUILD!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
STRGEN_FLAGS = !!STRGEN_FLAGS!!
STAGE = !!STAGE!!
LANG_SUPPRESS= !!LANG_SUPPRESS!!
LANG_OBJS_DIR= !!LANG_OBJS_DIR!!
ifeq ($(LANG_SUPPRESS), yes)
LANG_ERRORS = >/dev/null 2>&1
endif
# Make sure endian_host.h is reasable as if it was in the src/ dir
CFLAGS_BUILD += -I $(LANG_OBJS_DIR)
ENDIAN_TARGETS := endian_host.h endian_target.h $(ENDIAN_CHECK)
# Check if we want to show what we are doing
ifdef VERBOSE
Q =
@@ -37,33 +34,25 @@ RES := $(shell mkdir -p $(BIN_DIR)/lang )
all: table/strings.h $(LANGS)
strgen_base.o: $(SRC_DIR)/strgen/strgen_base.cpp $(SRC_DIR)/strgen/strgen.h $(SRC_DIR)/table/control_codes.h $(SRC_DIR)/table/strgen_tables.h $(SRC_DIR)/safeguards.h
strgen.o: $(SRC_DIR)/strgen/strgen.cpp endian_host.h $(SRC_DIR)/table/control_codes.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
strgen.o: $(SRC_DIR)/strgen/strgen.cpp $(SRC_DIR)/strgen/strgen.h $(SRC_DIR)/table/control_codes.h $(SRC_DIR)/table/strgen_tables.h $(SRC_DIR)/safeguards.h
string.o: $(SRC_DIR)/string.cpp endian_host.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
string.o: $(SRC_DIR)/string.cpp $(SRC_DIR)/safeguards.h
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp endian_host.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp $(SRC_DIR)/safeguards.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
getoptdata.o: $(SRC_DIR)/misc/getoptdata.cpp $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/safeguards.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/misc/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) -DSTRGEN -c -o $@ $<
lang/english.txt: $(LANG_DIR)/english.txt
$(Q)mkdir -p lang
$(Q)cp $(LANG_DIR)/english.txt lang/english.txt
$(STRGEN): alloc_func.o string.o strgen_base.o strgen.o getoptdata.o
$(STRGEN): alloc_func.o string.o strgen.o
$(E) '$(STAGE) Compiling and Linking $@'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) $^ -o $@
$(Q)$(CXX_BUILD) $^ -o $@
table/strings.h: lang/english.txt $(STRGEN)
$(E) '$(STAGE) Generating $@'
@@ -74,14 +63,23 @@ $(LANGS): %.lng: $(LANG_DIR)/%.txt $(STRGEN) lang/english.txt
$(E) '$(STAGE) Compiling language $(*F)'
$(Q)./$(STRGEN) $(STRGEN_FLAGS) -s $(LANG_DIR) -d $(LANG_OBJS_DIR) $< $(LANG_ERRORS) && cp $@ $(BIN_DIR)/lang || true # Do not fail all languages when one fails
# The targets to compile the endian-code
endian_host.h: $(ENDIAN_CHECK)
$(E) '$(STAGE) Testing endianness for host'
$(Q)./$(ENDIAN_CHECK) > $@
$(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
$(E) '$(STAGE) Compiling and Linking $@'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $< -o $@
depend:
clean:
$(E) '$(STAGE) Cleaning up language files'
$(Q)rm -f strgen_base.o strgen.o string.o alloc_func.o getoptdata.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.*
$(Q)rm -f strgen.o string.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.* $(ENDIAN_TARGETS)
mrproper: clean
$(Q)rm -rf $(BIN_DIR)/lang
%.lng:
@echo '$(STAGE) No such language: $(@:%.lng=%)'

View File

@@ -1,10 +1,3 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
#
# Makefile for creating bundles of MSVC's binaries in the same way as we make
# the zip bundles for ALL other OSes.
@@ -20,28 +13,16 @@ else
Q = @
endif
AWK = "awk"
ROOT_DIR := $(shell pwd)
BIN_DIR = "$(ROOT_DIR)/bin"
SRC_DIR = "$(ROOT_DIR)/src"
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
AWK = "awk"
ROOT_DIR := $(shell pwd)
BIN_DIR = "$(ROOT_DIR)/bin"
SRC_DIR = "$(ROOT_DIR)/src"
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
TTD = openttd.exe
PDB = openttd.pdb
MODE = Release
TARGET := $(shell echo $(PLATFORM) | sed "s@win64@x64@;s@win32@Win32@")
TTD = "openttd.exe"
TARGET := $(shell echo $(PLATFORM) | sed "s~win64~x64~;s~win32~Win32~")
all:
$(Q)cp objs/$(TARGET)/$(MODE)/$(TTD) $(BIN_DIR)/$(TTD)
$(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD)
include Makefile.bundle.in
bundle_pdb:
@echo '[BUNDLE] Creating $(BUNDLE_NAME).pdb.xz'
$(Q)mkdir -p "$(BUNDLES_DIR)"
$(Q)cp objs/$(TARGET)/Release/$(PDB) $(BUNDLES_DIR)/$(BUNDLE_NAME).pdb
$(Q)xz -9 $(BUNDLES_DIR)/$(BUNDLE_NAME).pdb
regression: all
$(Q)cp bin/$(TTD) bin/openttd
$(Q)cd bin && sh ai/regression/run.sh

View File

@@ -1,65 +0,0 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
SETTINGSGEN = !!SETTINGSGEN!!
SRC_DIR = !!SRC_DIR!!
CXX_BUILD = !!CXX_BUILD!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
CXXFLAGS_BUILD = !!CXXFLAGS_BUILD!!
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
STAGE = !!STAGE!!
SETTING_OBJS_DIR = !!SETTING_OBJS_DIR!!
# Check if we want to show what we are doing
ifdef VERBOSE
Q =
E = @true
else
Q = @
E = @echo
endif
all: table/settings.h
settingsgen.o: $(SRC_DIR)/settingsgen/settingsgen.cpp $(SRC_DIR)/string_func.h $(SRC_DIR)/strings_type.h $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/ini_type.h $(SRC_DIR)/core/smallvec_type.hpp $(SRC_DIR)/safeguards.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp $(SRC_DIR)/safeguards.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
getoptdata.o: $(SRC_DIR)/misc/getoptdata.cpp $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/safeguards.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/misc/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
string.o: $(SRC_DIR)/string.cpp $(SRC_DIR)/safeguards.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
ini_load.o: $(SRC_DIR)/ini_load.cpp $(SRC_DIR)/core/alloc_func.hpp $(SRC_DIR)/core/mem_func.hpp $(SRC_DIR)/ini_type.h $(SRC_DIR)/string_func.h $(SRC_DIR)/safeguards.h
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
$(SETTINGSGEN): alloc_func.o string.o ini_load.o settingsgen.o getoptdata.o
$(E) '$(STAGE) Compiling and Linking $@'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) $^ -o $@
table/settings.h: $(SETTINGSGEN) $(SRC_DIR)/table/settings.h.preamble $(SRC_DIR)/table/settings.h.postamble $(SRC_DIR)/table/*.ini
$(E) '$(STAGE) Generating $@'
@mkdir -p table
$(Q)./$(SETTINGSGEN) -o table/settings.h -b $(SRC_DIR)/table/settings.h.preamble -a $(SRC_DIR)/table/settings.h.postamble $(SRC_DIR)/table/*.ini
depend:
clean:
$(E) '$(STAGE) Cleaning up settings files'
$(Q)rm -f settingsgen.o alloc_func.o getoptdata.o string.o ini_load.o $(SETTINGSGEN) table/settings.h
mrproper: clean
.PHONY: all mrproper depend clean

View File

@@ -1,43 +1,37 @@
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
CC_HOST = !!CC_HOST!!
CXX_HOST = !!CXX_HOST!!
CC_BUILD = !!CC_BUILD!!
CXX_BUILD = !!CXX_BUILD!!
WINDRES = !!WINDRES!!
STRIP = !!STRIP!!
CFLAGS = !!CFLAGS!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
CXXFLAGS = !!CXXFLAGS!!
CXXFLAGS_BUILD = !!CXXFLAGS_BUILD!!
LIBS = !!LIBS!!
LDFLAGS = !!LDFLAGS!!
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
ROOT_DIR = !!ROOT_DIR!!
BIN_DIR = !!BIN_DIR!!
LANG_DIR = !!LANG_DIR!!
SRC_OBJS_DIR = !!SRC_OBJS_DIR!!
LANG_OBJS_DIR = !!LANG_OBJS_DIR!!
SETTING_OBJS_DIR= !!SETTING_OBJS_DIR!!
SRC_DIR = !!SRC_DIR!!
SCRIPT_SRC_DIR = !!SCRIPT_SRC_DIR!!
MEDIA_DIR = !!MEDIA_DIR!!
TTD = !!TTD!!
STRGEN = !!STRGEN!!
DEPEND = !!DEPEND!!
OS = !!OS!!
STAGE = !!STAGE!!
MAKEDEPEND = !!MAKEDEPEND!!
CFLAGS_MAKEDEP = !!CFLAGS_MAKEDEP!!
SORT = !!SORT!!
AWK = !!AWK!!
CC_HOST = !!CC_HOST!!
CXX_HOST = !!CXX_HOST!!
CC_BUILD = !!CC_BUILD!!
CXX_BUILD = !!CXX_BUILD!!
WINDRES = !!WINDRES!!
STRIP = !!STRIP!!
CC_CFLAGS = !!CC_CFLAGS!!
CFLAGS = !!CFLAGS!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
LIBS = !!LIBS!!
LDFLAGS = !!LDFLAGS!!
ROOT_DIR = !!ROOT_DIR!!
BIN_DIR = !!BIN_DIR!!
LANG_DIR = !!LANG_DIR!!
SRC_OBJS_DIR = !!SRC_OBJS_DIR!!
LANG_OBJS_DIR= !!LANG_OBJS_DIR!!
SRC_DIR = !!SRC_DIR!!
SCRIPT_SRC_DIR=!!SCRIPT_SRC_DIR!!
MEDIA_DIR = !!MEDIA_DIR!!
TTD = !!TTD!!
STRGEN = !!STRGEN!!
ENDIAN_CHECK = !!ENDIAN_CHECK!!
ENDIAN_FORCE = !!ENDIAN_FORCE!!
OS = !!OS!!
STAGE = !!STAGE!!
MAKEDEPEND = !!MAKEDEPEND!!
CFLAGS_MAKEDEP= !!CFLAGS_MAKEDEP!!
SORT = !!SORT!!
REVISION = !!REVISION!!
AWK = !!AWK!!
GCC295 = !!GCC295!!
CONFIG_CACHE_COMPILER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_COMPILER!!
CONFIG_CACHE_LINKER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_LINKER!!
CONFIG_CACHE_ENDIAN = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_ENDIAN!!
CONFIG_CACHE_SOURCE = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_SOURCE!!
CONFIG_CACHE_VERSION = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_VERSION!!
@@ -49,15 +43,29 @@ OBJS := $(OBJS_C) $(OBJS_CPP) $(OBJS_MM) $(OBJS_RC)
SRCS := !!SRCS!!
# All C-files depend on those 3 files
FILE_DEP := $(CONFIG_CACHE_COMPILER)
FILE_DEP := $(CONFIG_CACHE_COMPILER) endian_target.h
# Create all dirs and subdirs
RES := $(shell mkdir -p $(BIN_DIR) $(sort $(dir $(OBJS))))
CFLAGS += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SETTING_OBJS_DIR)
CFLAGS_MAKEDEP += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SETTING_OBJS_DIR)
ifdef SCRIPT_SRC_DIR
CFLAGS_MAKEDEP += -I $(SCRIPT_SRC_DIR)
endif
# Make sure endian_target.h is reasable as if it was in the src/ dir
CFLAGS += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR)
CFLAGS_MAKEDEP += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR) -I $(SCRIPT_SRC_DIR)
ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
# This 'sed' basicly just removes 'const' from the line if it is a 2+D array
# For more information, please check:
# http://maillist.openttd.org/pipermail/devs/2007-April/000284.html
# http://maillist.openttd.org/pipermail/devs/2007-February/000248.html
GCC295_FIX=sed -r 's~^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$~\1\2 \4\6\8\9~g'
# This 'sed' removes the 3rd '4' in the # lines of the -E output of
# gcc 2.95.3 and lower, as it should indicate that it is a C-linkage, but the
# compiler can't handle that information (just don't ask). So we remove it
# and then it compiles happily and without bitching :)
# Furthermore gcc 2.95 has some trouble with protected and private when
# accessing the protected/private stuff of the enclosing class (or the
# super class of the enclosing class).
GCC295_FIX_2=sed -e 's~\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$~\1~g;s~private:~public:~g;s~protected:~public:~g'
# Check if we want to show what we are doing
ifdef VERBOSE
@@ -87,29 +95,33 @@ $(LANG_OBJS_DIR)/table/strings.h: $(LANG_DIR)/english.txt $(LANG_OBJS_DIR)/$(STR
VERSIONS := $(shell AWK="$(AWK)" "$(ROOT_DIR)/findversion.sh")
MODIFIED := $(shell echo "$(VERSIONS)" | cut -f 3 -d' ')
ifdef REVISION
# Use specified revision (which should be of the form "r000").
REV := $(REVISION)
REV_NR := $(shell echo $(REVISION) | sed "s~[^0-9]~~g")
else
# Use autodetected revisions
VERSION := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
ISODATE := $(shell echo "$(VERSIONS)" | cut -f 2 -d' ')
GITHASH := $(shell echo "$(VERSIONS)" | cut -f 4 -d' ')
ISTAG := $(shell echo "$(VERSIONS)" | cut -f 5 -d' ')
ISSTABLETAG := $(shell echo "$(VERSIONS)" | cut -f 6 -d' ')
# Make sure we have something in VERSION and ISODATE
ifeq ($(VERSION),)
VERSION := norev000
REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
REV_NR := $(shell echo "$(VERSIONS)" | cut -f 2 -d' ')
endif
ifeq ($(ISODATE),)
ISODATE := 00000000
# Make sure we have something in REV and REV_NR
ifeq ($(REV),)
REV := norev000
endif
ifeq ($(REV_NR),)
REV_NR := 0
endif
# This helps to recompile if flags change
RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CFLAGS) $(CXXFLAGS)" ]; then echo "$(CFLAGS) $(CXXFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CC_CFLAGS) $(CFLAGS)" ]; then echo "$(CC_CFLAGS) $(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_LINKER) 2>/dev/null`" != "$(LDFLAGS) $(LIBS)" ]; then echo "$(LDFLAGS) $(LIBS)" > $(CONFIG_CACHE_LINKER); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORCE)" ]; then echo "$(ENDIAN_FORCE)" > $(CONFIG_CACHE_ENDIAN); fi )
# If there is a change in the source-file-list, make sure we recheck the deps
RES := $(shell if [ "`cat $(CONFIG_CACHE_SOURCE) 2>/dev/null`" != "$(SRCS)" ]; then echo "$(SRCS)" > $(CONFIG_CACHE_SOURCE); fi )
# If there is a change in the revision, make sure we recompile rev.cpp
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(VERSION) $(MODIFIED)" ]; then echo "$(VERSION) $(MODIFIED)" > $(CONFIG_CACHE_VERSION); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(REV) $(MODIFIED)" ]; then echo "$(REV) $(MODIFIED)" > $(CONFIG_CACHE_VERSION); fi )
ifndef MAKEDEPEND
# The slow, but always correct, dep-check
@@ -117,7 +129,7 @@ DEP_MASK := %.d
DEPS := $(OBJS:%.o=%.d)
# Only include the deps if we are compiling everything
ifeq ($(filter %.o clean mrproper, $(MAKECMDGOALS)),)
ifeq ($(filter $(ENDIAN_TARGETS) %.o clean mrproper, $(MAKECMDGOALS)),)
-include $(DEPS)
else
# In case we want to compile a single target, include the .d file for it
@@ -131,18 +143,18 @@ endif
$(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.c=%.c)'
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
$(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
$(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
$(OBJS_MM:%.o=%.d): %.d: $(SRC_DIR)/%.mm $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
$(OBJS_RC:%.o=%.d): %.d: $(SRC_DIR)/%.rc $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.rc=%.rc)'
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
$(Q)touch $@
else
@@ -151,49 +163,36 @@ DEP_MASK :=
DEPS := Makefile.dep
# Only include the deps if we are not cleaning
ifeq ($(filter depend clean mrproper, $(MAKECMDGOALS)),)
ifeq ($(filter $(ENDIAN_TARGETS) depend clean mrproper, $(MAKECMDGOALS)),)
-include Makefile.dep
endif
ifeq ("$(SRC_OBJS_DIR)/$(DEPEND)","$(MAKEDEPEND)")
DEP := $(MAKEDEPEND)
$(SRC_OBJS_DIR)/$(DEPEND): $(SRC_DIR)/depend/depend.cpp
$(E) '$(STAGE) Compiling and linking $(DEPEND)'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) -o $@ $<
endif
# Macro for invoking a command on groups of 100 words at a time
# (analogous to xargs(1)). The macro invokes itself recursively
# until the list of words is depleted.
#
# Usage: $(call xargs,COMMAND,LIST)
#
# COMMAND should be a shell command to which the words will be
# appended as arguments in groups of 100.
define xargs
$(1) $(wordlist 1,100,$(2))
$(if $(word 101,$(2)),$(call xargs,$(1),$(wordlist 101,$(words $(2)),$(2))))
endef
# Make sure that only 'make depend' ALWAYS triggers a recheck
ifeq ($(filter depend, $(MAKECMDGOALS)),)
Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(CONFIG_CACHE_SOURCE) $(DEP)
Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(CONFIG_CACHE_SOURCE)
else
Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(DEP) FORCE
Makefile.dep: FORCE
endif
$(E) '$(STAGE) DEP CHECK (all files)'
$(Q)rm -f Makefile.dep.tmp
$(Q)touch Makefile.dep.tmp
# Calculate the deps via makedepend
$(call xargs,$(Q)$(MAKEDEPEND) -f$(SRC_OBJS_DIR)/Makefile.dep.tmp -o.o -Y -v -a -- $(CFLAGS_MAKEDEP) -- 2>/dev/null,$(SRCS:%=$(SRC_DIR)/%))
$(Q)$(MAKEDEPEND) -f$(SRC_OBJS_DIR)/Makefile.dep.tmp -o.o -Y -v -- $(CFLAGS_MAKEDEP) -- $(SRCS:%=$(SRC_DIR)/%) 2>/dev/null
# Convert x:/... paths to /x/... for mingw
ifeq ($(OS), MINGW)
@cat Makefile.dep.tmp | sed 's~\([a-zA-Z]\):\/~\/\1\/~g' > Makefile.dep.tmp.mingw
@cp Makefile.dep.tmp.mingw Makefile.dep.tmp
@rm -f Makefile.dep.tmp.mingw
endif
# Remove all comments and includes that don't start with $(SRC_DIR)
# Remove $(SRC_DIR) from object-file-name
@$(AWK) ' \
/^# DO NOT/ { print $$0 ; next} \
/^#/ {next} \
/: / { \
/:/ { \
left = NF - 1; \
for (n = 2; n <= NF; n++) { \
if (match($$n, "^$(ROOT_DIR)") == 0) { \
@@ -212,7 +211,7 @@ endif
{ \
print $$0 \
} \
' < Makefile.dep.tmp | sed 's@ *@ @g;s@ $$@@' | LC_ALL=C $(SORT) > Makefile.dep
' < Makefile.dep.tmp | sed 's~ *~ ~g;s~ $$~~' | $(SORT) > Makefile.dep
$(Q)rm -f Makefile.dep.tmp Makefile.dep.tmp.bak
@@ -229,55 +228,62 @@ endif
$(OBJS_C): %.o: $(SRC_DIR)/%.c $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.c=%.c)'
$(Q)$(CC_HOST) $(CFLAGS) -c -o $@ $<
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -c -o $@ $<
$(filter-out %sse2.o, $(filter-out %ssse3.o, $(filter-out %sse4.o, $(OBJS_CPP)))): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(OBJS_CPP): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
$(filter %sse2.o, $(OBJS_CPP)): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -msse2 -o $@ $<
$(filter %ssse3.o, $(OBJS_CPP)): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -mssse3 -o $@ $<
$(filter %sse4.o, $(OBJS_CPP)): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -msse4.1 -o $@ $<
ifeq ($(GCC295), 1)
$(Q)$(CXX_HOST) -E $(CFLAGS) $< | $(GCC295_FIX) | $(GCC295_FIX_2) | $(CXX_HOST) $(CFLAGS) -c -o $@ -x c++ -
else
$(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $<
endif
$(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.mm=%.mm)'
$(Q)$(CXX_HOST) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
$(Q)$(CC_HOST) $(CFLAGS) -c -o $@ $<
$(OBJS_RC): %.o: $(SRC_DIR)/%.rc $(FILE_DEP)
$(E) '$(STAGE) Compiling resource $(<:$(SRC_DIR)/%.rc=%.rc)'
$(Q)$(WINDRES) -o $@ $<
$(Q)$(WINDRES) -o $@ -I $(MEDIA_DIR) $<
$(BIN_DIR)/$(TTD): $(TTD)
$(Q)cp $(TTD) $(BIN_DIR)/$(TTD)
ifeq ($(OS), UNIX)
$(Q)cp $(MEDIA_DIR)/openttd.32.bmp $(BIN_DIR)/baseset/
endif
ifeq ($(OS), OSX)
$(Q)cp $(ROOT_DIR)/os/macosx/splash.png $(BIN_DIR)/baseset/
endif
$(Q)cp $< $@
$(TTD): $(OBJS) $(CONFIG_CACHE_LINKER)
$(E) '$(STAGE) Linking $@'
$(Q)+$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
ifeq ($(OS), PSP)
# Because of a bug in the PSP GCC tools, linking via CXX results
# in total chaos and more problems then you can handle. So we need
# CC to link OpenTTD for PSP
$(Q)$(CC_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
else
$(Q)$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
endif
ifdef STRIP
$(Q)$(STRIP) $@
ifeq ($(OS), DOS)
$(E) '$(STAGE) Adding CWSDPMI stub to $@'
$(Q)$(ROOT_DIR)/os/dos/make_dos_binary_selfcontained.sh $(SRC_OBJS_DIR)/$@
endif
endif
# The targets to compile the endian-code
endian_target.h: $(ENDIAN_CHECK) $(CONFIG_CACHE_ENDIAN)
$(E) '$(STAGE) Testing endianness for target'
$(Q)./$(ENDIAN_CHECK) $(ENDIAN_FORCE) > $@
$(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
$(E) '$(STAGE) Compiling and Linking $@'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $< -o $@
# Revision files
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/rev.cpp.in
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g" > $(SRC_DIR)/rev.cpp
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s~@@REVISION@@~$(REV_NR)~g;s~@@VERSION@@~$(REV)~g;s~@@MODIFIED@@~$(MODIFIED)~g;s~@@DATE@@~`date +%d.%m.%y`~g" > $(SRC_DIR)/rev.cpp
$(SRC_DIR)/os/windows/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/os/windows/ottdres.rc.in
$(Q)cat $(SRC_DIR)/os/windows/ottdres.rc.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g" > $(SRC_DIR)/os/windows/ottdres.rc
$(SRC_DIR)/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/ottdres.rc.in
$(Q)cat $(SRC_DIR)/ottdres.rc.in | sed "s~@@REVISION@@~$(REV_NR)~g;s~@@VERSION@@~$(REV)~g;s~@@DATE@@~`date +%d.%m.%y`~g" > $(SRC_DIR)/ottdres.rc
FORCE:
@@ -285,10 +291,10 @@ depend: $(DEPS)
clean:
$(E) '$(STAGE) Cleaning up object files'
$(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(DEPEND) $(TTD:%=$(BIN_DIR)/%) $(BIN_DIR)/baseset/openttd.32.bmp $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_SOURCE)
$(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(TTD:%=$(BIN_DIR)/%) $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_ENDIAN) $(CONFIG_CACHE_SOURCE) $(ENDIAN_TARGETS)
mrproper: clean
$(Q)rm -f $(SRC_DIR)/rev.cpp $(SRC_DIR)/os/windows/ottdres.rc
$(Q)rm -f $(SRC_DIR)/rev.cpp $(SRC_DIR)/ottdres.rc
%.o:
@echo '$(STAGE) No such source-file: $(@:%.o=%).[c|cpp|mm|rc]'

705
README.md
View File

@@ -1,705 +0,0 @@
# OpenTTD
## Table of contents
- 1.0) [About](#10-about)
- 1.1) [Compiling OpenTTD](#11-compiling-openttd)
- 1.2) [Contributing to OpenTTD](#12-contributing-to-openttd)
- 2.0) [Contacting](#20-contacting)
- 2.1) [Reporting bugs](#21-reporting-bugs)
- 2.2) [Reporting desyncs](#22-reporting-desyncs)
- 3.0) [Supported platforms](#30-supported-platforms)
- 4.0) [Installing and running OpenTTD](#40-installing-and-running-openttd)
- 4.1) [(Required) 3rd party files](#41-required-3rd-party-files)
- 4.2) [OpenTTD directories](#42-openttd-directories)
- 4.3) [Portable installations (portable media)](#43-portable-installations-portable-media)
- 4.4) [Files in tar (archives)](#44-files-in-tar-archives)
- 5.0) [OpenTTD features](#50-openttd-features)
- 5.1) [Logging of potentially dangerous actions](#51-logging-of-potentially-dangerous-actions)
- 5.2) [Frame rate and performance metrics](#52-frame-rate-and-performance-metrics)
- 6.0) [Configuration file](#60-configuration-file)
- 7.0) [Translating](#70-translating)
- 7.1) [Translation](#71-translation)
- 7.2) [Previewing](#72-previewing)
- 8.0) [Troubleshooting](#80-troubleshooting)
- 9.0) [Licensing](#90-licensing)
- X.X) [Credits](#xx-credits)
## 1.0) About
OpenTTD is a transport simulation game based upon the popular game Transport
Tycoon Deluxe, written by Chris Sawyer. It attempts to mimic the original
game as closely as possible while extending it with new features.
OpenTTD is licensed under the GNU General Public License version 2.0,
but includes some 3rd party software under different licenses. See the
section "Licensing" below for details.
## 1.1) Compiling OpenTTD
Instructions for compiling OpenTTD can be found in [./COMPILING.md](COMPILING.md)
## 1.2) Contributing to OpenTTD
We welcome contributors to OpenTTD. More information for contributors can be found in [./CONTRIBUTING.md](CONTRIBUTING.md)
## 2.0) Contacting
The easiest way to contact the OpenTTD team is by submitting bug reports or
posting comments in our forums. You can also chat with us on IRC (#openttd
on irc.oftc.net).
The OpenTTD homepage is https://www.openttd.org.
You can also find the OpenTTD forums at
[https://www.tt-forums.net](https://www.tt-forums.net/viewforum.php?f=55).
### 2.1) Reporting bugs
First of all, check whether the bug is not already known. Do this by looking
through the file called 'known-bugs.txt' which is distributed with OpenTTD
like this readme.
For tracking our bugs we are using GitHub's issue tracker. You can find
the tracker at https://github.com/OpenTTD/OpenTTD/issues. Before actually
reporting take a look through the already reported bugs there to see if
the bug is already known. The 'known-bugs.txt' file might be a bit outdated
at the moment you are reading it as only bugs known before the release
are documented there. Also look through the recently closed bugs.
When you are sure it is not already reported you should:
- Make sure you are running a recent version, i.e. run the latest stable or
nightly based on where you found the bug.
- Make sure you are not running a non-official binary, like a patch pack.
When you are playing with a patch pack you should report any bugs to the
forum thread related to that patch pack.
- Make it reproducible for the developers. In other words, create a savegame
in which you can reproduce the issue once loaded. It is very useful to give
us the crash.dmp, crash.sav, crash.log and crash screenshot which are
created on crashes.
- Check whether the bug is already reported on our bug tracker. This includes
searching for recently closed bug reports as the bug might already be fixed.
After you have done all that you can report the bug. Please include the
following information in your bug report:
- OpenTTD version (PLEASE test the latest Git revision/nightly build)
- Bug details, including instructions how to reproduce it
- Platform (Windows, Linux, FreeBSD, …) and compiler (including version) if
you compiled OpenTTD yourself.
- The processor architecture of your OS (32-bit Windows, 64-bit Windows,
Linux on an ARM, Mac OS X on a PowerPC, etc.)
- Attach a saved game **and** a screenshot if possible
- If this bug only occurred recently please note the last version without
the bug and the first version including the bug. That way we can fix it
quicker by looking at the changes made.
- Attach crash.dmp, crash.log and crash.sav. These files are usually created
next to your openttd.cfg. The crash handler will tell you the location.
### 2.2) Reporting desyncs
As desyncs are hard to make reproducible OpenTTD has the ability to log all
actions done by clients so we can replay the whole game in an effort to make
desyncs better reproducible. You need to turn this ability on. When turned
on an automatic savegame will be made once the map has been constructed in
the 'save/autosave' directory, see OpenTTD directories to know where to find
this directory. Furthermore the log file 'commands-out.log' will be created
and all actions will be written to there.
To enable the desync debugging you need to set the debug level for 'desync'
to at least 1. You do this by starting OpenTTD with '`-d desync=<level>`' as
parameter or by typing '`debug_level desync=<level>`' in OpenTTD's internal
console.
The desync debug levels are:
- 0: nothing.
- 1: dumping of commands to 'commands-out.log'.
- 2: same as 1 plus checking vehicle caches and dumping that too.
- 3: same as 2 plus monthly saves in autosave.
- 4 and higher: same as 3
Restarting OpenTTD will overwrite 'commands-out.log'. OpenTTD will not remove
the savegames (dmp_cmds_*.sav) made by the desync debugging system, so you
have to occasionally remove them yourself!
The naming format of the desync savegames is as follows:
dmp_cmds_XXXXXXXX_YYYYYYYY.sav. The XXXXXXXX is the hexadecimal representation
of the generation seed of the game and YYYYYYYY is the hexadecimal
representation of the date of the game. This sorts the savegames by game and
then by date making it easier to find the right savegames.
When a desync has occurred with the desync debugging turned on you should file
a bug report with the following files attached:
- commands-out.log as it contains all the commands that were done
- the last saved savegame (search for the last line beginning with
'save: dmp_cmds_' in commands-out.log). We use this savegame to check
whether we can quickly reproduce the desync. Otherwise we will need …
- the first saved savegame (search for the first line beginning with 'save'
where the first part, up to the last underscore '_', is the same). We need
this savegame to be able to reproduce the bug when the last savegame is not
old enough. If you loaded a scenario or savegame you need to attach that.
- optionally you can attach the savegames from around 50%, 75%, 85%, 90% and
95% of the game's progression. We can use these savegames to speed up the
reproduction of the desync, but we should be able to reproduce these
savegames based on the first savegame and commands-out.log.
- in case you use any NewGRFs you should attach the ones you used unless
we can easily find them ourselves via bananas or when they are in the
#openttdcoop pack.
Do NOT remove the dmp_cmds savegames of a desync you have reported until the
desync has been fixed; if you, by accident, send us the wrong savegames we
will not be able to reproduce the desync and thus will be unable to fix it.
## 3.0) Supported platforms
OpenTTD has been ported to several platforms and operating systems. It should
not be very difficult to port it to a new platform. The currently working
platforms are:
- FreeBSD (SDL)
- Haiku (SDL)
- Linux (SDL or Allegro)
- macOS (universal) (Cocoa video and sound drivers)
- OpenBSD (SDL)
- OS/2 (SDL)
- Windows (Win32 GDI (faster) or SDL or Allegro)
## 4.0) Installing and running OpenTTD
Installing OpenTTD is fairly straightforward. Either you have downloaded an
archive which you have to extract to a directory where you want OpenTTD to
be installed, or you have downloaded an installer, which will automatically
extract OpenTTD in the given directory.
OpenTTD looks in multiple locations to find the required data files (described
in section 4.2). Installing any 3rd party files into a 'shared' location has
the advantage that you only need to do this step once, rather than copying the
data files into all OpenTTD versions you have.
Savegames, screenshots, etc are saved relative to the config file (openttd.cfg)
currently being used. This means that if you use a config file in one of the
shared directories, savegames will reside in the save/ directory next to the
openttd.cfg file there.
If you want savegames and screenshots in the directory where the OpenTTD binary
resides, simply have your config file in that location. But if you remove this
config file, savegames will still be in this directory (see notes in
section 4.2 'OpenTTD directories')
OpenTTD comes without AIs, so if you want to play with AIs you have to download
them. The easiest way is via the 'Check Online Content' button in the main menu.
You can select some AIs that you think are compatible with your playing style.
Another way is manually downloading the AIs from the forum although then you
need to make sure that you install all the required AI libraries too; they get
automatically selected (and downloaded) if you get the AIs via the 'Check
Online Content'. If you do not have an AI but have configured OpenTTD to start
an AI a message will be shown that the 'dummy' AI has been started.
### 4.1) (Required) 3rd party files
Before you run OpenTTD, you need to put the game's data files into a baseset/
directory which can be located in various places addressed in the following
section.
For OpenTTD you need to acquire some third party data files. For this you have
the choice of using the original Transport Tycoon Deluxe data files or a set
of free data files.
Do NOT copy files included with OpenTTD into 'shared' directories (explained in
the following sections) as sooner or later you will run into graphical glitches
when using other versions of the game.
#### 4.1.1) Free graphics and sound files
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at:
- https://www.openttd.org/download-opengfx for OpenGFX
- https://www.openttd.org/download-opensfx for OpenSFX
- https://www.openttd.org/download-openmsx for OpenMSX
Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
#### 4.1.2) Original Transport Tycoon Deluxe graphics and sound files
If you want to play with the original Transport Tycoon Deluxe data files you
have to copy the data files from the CD-ROM into the baseset/ directory. It
does not matter whether you copy them from the DOS or Windows version of
Transport Tycoon Deluxe. The Windows install can optionally copy these files.
You need to copy the following files:
- sample.cat
- trg1r.grf or TRG1.GRF
- trgcr.grf or TRGC.GRF
- trghr.grf or TRGH.GRF
- trgir.grf or TRGI.GRF
- trgtr.grf or TRGT.GRF
#### 4.1.3) Original Transport Tycoon Deluxe music
If you want the Transport Tycoon Deluxe music, copy the appropriate files from
the original game into the baseset folder.
- TTD for Windows: All files in the gm/ folder (gm_tt00.gm up to gm_tt21.gm)
- TTD for DOS: The GM.CAT file
- Transport Tycoon Original: The GM.CAT file, but rename it to GM-TTO.CAT
#### 4.1.4) AIs
If you want AIs use the in-game content downloader. If for some reason that is
not possible or you want to use an AI that has not been uploaded to the content
download system download the tar file and place it in the ai/ directory. If the
AI needs libraries you will have to download those too and put them in the
ai/library/ directory. All AIs and AI Libraries that have been uploaded to
the content download system can be found at https://noai.openttd.org/downloads.
The AIs and libraries can be found their in the form of .tar.gz packages.
OpenTTD can read inside tar files but it does not extract .tar.gz files by itself.
To figure out which libraries you need for an AI you have to start the AI and
wait for an error message to pop up. The error message will tell you
'could not find library "lib-name"'. Download that library and try again.
#### 4.1.5) Game scripts
If you want an extra challenge in OpenTTD you can download so-called game
scripts via the in-game content downloader. These game scripts have varying
functionality, though they can generally influence town growth, subsidies, add
goals to reach or provide a different ranking system.
If you download a game script manually you have to follow the same rules as for
AIs, except that game scripts are placed in the game/ directory instead of the
ai/ directory.
### 4.2) OpenTTD directories
OpenTTD uses its own directory to store its required 3rd party base set files
(see section 4.1 'Required 3rd party files') and non-compulsory extension and
configuration files. See below for their proper place within this OpenTTD main
data directory.
The main OpenTTD directories can be found in various locations, depending on
your operating system:
1. The current working directory (from where you started OpenTTD)
For non-Windows operating systems OpenTTD will not scan for files in this
directory if it is your personal directory, i.e. '~/', or when it is the
root directory, i.e. '/'.
2. Your personal directory
- Windows:
- `C:\My Documents\OpenTTD` (95, 98, ME)
- `C:\Documents and Settings\<username>\My Documents\OpenTTD` (2000, XP)
- `C:\Users\<username>\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- macOS: `~/Documents/OpenTTD`
- Linux: `$XDG_DATA_HOME/openttd` which is usually `~/.local/share/openttd`
when built with XDG base directory support, otherwise `~/.openttd`
3. The shared directory
- Windows:
- `C:\Documents and Settings\All Users\Shared Documents\OpenTTD` (2000, XP)
- `C:\Users\Public\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- macOS: `/Library/Application Support/OpenTTD`
- Linux: not available
4. The binary directory (where the OpenTTD executable is)
- Windows: `C:\Program Files\OpenTTD`
- Linux: `/usr/games`
5. The installation directory (Linux only)
- Linux: `/usr/share/games/openttd`
6. The application bundle (macOS only)
It includes the OpenTTD files (grf+lng) and it will work as long as they
are not touched
Different types of data or extensions go into different subdirectories of the
chosen main OpenTTD directory:
| data type | directory | additional info |
| ------------------- | ----------------- | --------------------------- |
| Config File | (no subdirectory) | |
| Screenshots | screenshot | |
| Base Graphics | baseset | (or a subdirectory thereof) |
| Sound Sets | baseset | (or a subdirectory thereof) |
| NewGRFs | newgrf | (or a subdirectory thereof) |
| 32bpp Sets | newgrf | (or a subdirectory thereof) |
| Music Sets | baseset | (or a subdirectory thereof) |
| AIs | ai | (or a subdirectory thereof) |
| AI Libraries | ai/library | (or a subdirectory thereof) |
| Game Scripts (GS) | game | (or a subdirectory thereof) |
| GS Libraries | game/library | (or a subdirectory thereof) |
| Savegames | save | |
| Automatic Savegames | save/autosave | |
| Scenarios | scenario | |
The (automatically created) directory content_download is for OpenTTD's internal
use and no files should be added to it or its subdirectories manually.
#### Notes:
- Linux in the previous list means .deb, but most paths should be similar for
others.
- The previous search order is also used for NewGRFs and openttd.cfg.
- If openttd.cfg is not found, then it will be created using the 2, 4, 1, 3,
5 order. When built with XDG base directory support, openttd.cfg will be
created in $XDG_CONFIG_HOME/openttd which is usually ~/.config/openttd.
- Savegames will be relative to the config file only if there is no save/
directory in paths with higher priority than the config file path, but
autosaves and screenshots will always be relative to the config file.
Unless the configuration file is in $XDG_CONFIG_HOME/openttd, then all
other files will be saved under $XDG_DATA_HOME/openttd.
#### The preferred setup:
Place 3rd party files in shared directory (or in personal directory if you do
not have write access on shared directory) and have your openttd.cfg config
file in personal directory (where the game will then also place savegames and
screenshots).
### 4.3) Portable installations (portable media)
You can install OpenTTD on external media so you can take it with you, i.e.
using a USB key, or a USB HDD, etc.
Create a directory where you shall store the game in (i.e. OpenTTD/).
Copy the binary (OpenTTD.exe, OpenTTD.app, openttd, etc), baseset/ and your
openttd.cfg to this directory.
You can copy binaries for any operating system into this directory, which will
allow you to play the game on nearly any computer you can attach the external
media to.
As always - additional grf files are stored in the newgrf/ dir (for details,
again, see section 4.1).
### 4.4) Files in tar (archives)
OpenTTD can read files that are in an uncompressed tar (archive), which
makes it easy to bundle files belonging to the same script, NewGRF or base
set. Music sets are the only exception as they cannot be stored in a tar
file due to being played by external applications.
OpenTTD sees each tar archive as the 'root' of its search path. This means that
having a file with the same path in two different tar files means that one
cannot be opened, after all only one file will be found first. As such it is
advisable to put an uniquely named folder in the root of the tar and put all the
content in that folder. For example, all downloaded content has a path that
concatenates the name of the content and the version, which makes the path
unique. For custom tar files it is advised to do this as well.
The normal files are also referred to by their relative path from the search
directory, this means that also normal files could hide files in a tar as
long as the relative path from the search path of the normal file is the
same as the path in the tar file. Again it is advised to have an unique path
to the normal file so they do not collide with the files from other tar
files.
## 5.0) OpenTTD features
OpenTTD has a lot of features going beyond the original Transport Tycoon Deluxe
emulation. Unfortunately, there is currently no comprehensive list of features,
but there is a basic features list on the web, and some optional features can be
controlled through the Advanced Settings dialog. We also implement some
features known from [TTDPatch](https://www.ttdpatch.net).
Several important non-standard controls:
- Ctrl modifies many commands and makes them more powerful. For example Ctrl
clicking on signals with the build signal tool changes their behaviour,
holding Ctrl while the track build tool is activated changes it to the track
removal tool, and so on. See https://wiki.openttd.org/Hidden_features
for a non-comprehensive list or look at the tooltips.
- Ingame console. More information at https://wiki.openttd.org/Console
- Hovering over a GUI element shows tooltips. This can be changed to right click
via the advanced settings.
### 5.1) Logging of potentially dangerous actions
OpenTTD is a complex program, and together with NewGRF, it may show a buggy
behaviour. But not only bugs in code can cause problems. There are several
ways to affect game state possibly resulting in program crash or multiplayer
desyncs.
Easier way would be to forbid all these unsafe actions, but that would affect
game usability for many players. We certainly do not want that.
However, we receive bug reports because of this. To reduce time spent with
solving these problems, these potentially unsafe actions are logged in
the savegame (including crash.sav). Log is stored in crash logs, too.
Information logged:
- Adding / removing / changing order of NewGRFs
- Changing NewGRF parameters, loading compatible NewGRF
- Changing game mode (scenario editor <-> normal game)
- Loading game saved in a different OpenTTD / TTDPatch / Transport Tycoon Deluxe /
original Transport Tycoon version
- Running a modified OpenTTD build
- Changing settings affecting NewGRF behaviour (non-network-safe settings)
- Triggering NewGRF bugs
No personal information is stored.
You can show the game log by typing 'gamelog' in the console or by running
OpenTTD in debug mode.
### 5.2) Frame rate and performance metrics
The Help menu in-game has a function to open the Frame rate window. This
window shows various real-time performance statistics, measuring what parts
of the game require the most processing power currently.
A summary of the statistics can also be retrieved from the console with the
`fps` command. This is especially useful on dedicated servers, where the
administrator might want to determine what's limiting performance in a slow
game.
The frame rate is given as two figures, the simulation rate and the graphics
frame rate. Usually these are identical, as the screen is rendered exactly
once per simulated tick, but in the future there might be support for graphics
and simulation running at different rates. When the game is paused, the
simulation rate drops to zero.
In addition to the simulation rate, a game speed factor is also calculated.
This is based on the target simulation speed, which is 30 milliseconds per
game tick. At that speed, the expected frame rate is 33.33 frames/second, and
the game speed factor is how close to that target the actual rate is. When
the game is in fast forward mode, the game speed factor shows how much
speed up is achieved.
The lower part of the window shows timing statistics for individual parts of
the game. The times shown are short-term and long-term averages of how long
it takes to process one tick of game time, all figures are in milliseconds.
Clicking a line in the lower part of the window opens a graph window, giving
detailed readings on each tick simulated by the game.
The following is an explanation of the different statistics:
- *Game loop* - Total processing time used per simulated "tick" in the game.
This includes all pathfinding, world updates, and economy handling.
- *Cargo handling* - Time spent loading/unloading cargo at stations, and
industries and towns sending/retrieving cargo from stations.
- *Train ticks*, *Road vehicle ticks*, *Ship ticks*, *Aircraft ticks* -
Time spent on pathfinding and other processing for each player vehicle type.
- *World ticks* - Time spent on other world/landscape processing. This
includes towns growing, building animations, updates of farmland and trees,
and station rating updates.
- *GS/AI total*, *Game script*, and *AI players* - Time spent running logic
for game scripts and AI players. The total may show as less than the current
sum of the individual scripts, this is because AI players at lower
difficulty settings do not run every game tick, and hence contribute less
to the average across all ticks. Keep in mind that the "Current" figure is
also an average, just only over short term.
- *Link graph delay* - Time overruns of the cargo distribution link graph
update thread. Usually the link graph is updated in a background thread,
but these updates need to synchronise with the main game loop occasionally,
if the time spent on link graph updates is longer than the time taken to
otherwise simulate the game while it was updating, these delays are counted
in this figure.
- *Graphics rendering* - Total time spent rendering all graphics, including
both GUI and world viewports. This typically spikes when panning the view
around, and when more things are happening on screen at once.
- *World viewport rendering* - Isolated time spent rendering just world
viewports. If this figure is significantly lower than the total graphics
rendering time, most time is spent rendering GUI than rendering world.
- *Video output* - Speed of copying the rendered graphics to the display
adapter. Usually this should be very fast (in the range of 0-3 ms), large
values for this can indicate a graphics driver problem.
- *Sound mixing* - Speed of mixing active audio samples together. Usually
this should be very fast (in the range of 0-3 ms), if it is slow, consider
switching to the NoSound set.
If the frame rate window is shaded, the title bar will instead show just the
current simulation rate and the game speed factor.
## 6.0) Configuration file
The configuration file for OpenTTD (openttd.cfg) is in a simple Windows-like
.INI format. It is mostly undocumented. Almost all settings can be changed
ingame by using the 'Advanced Settings' window.
When you cannot find openttd.cfg you should look in the directories as
described in section 4.2. If you do not have an openttd.cfg OpenTTD will
create one after closing.
## 7.0) Translating
See https://www.openttd.org/development for up-to-date information.
The use of the online Translator service, located at
https://translator.openttd.org, is highly encouraged. For getting an account
simply follow the guidelines in the FAQ of the translator website.
If for some reason the website is down for a longer period of time, the
information below might be of help.
Please contact the translations manager (https://www.openttd.org/contact)
before beginning the translation process! This avoids double work, as
someone else may have already started translating to the same language.
### 7.1) Translation
So, now that you have notified the development team about your intention to
translate (You did, right? Of course you did.) you can pick up english.txt
(found in the Git repository under /src/lang) and translate.
You must change the first two lines of the file appropriately:
##name English-Name-Of-Language
##ownname Native-Name-Of-Language
Note: Do not alter the following parts of the file:
- String identifiers (the first word on each line)
- Parts of the strings which are in curly braces (such as {STRING})
- Lines beginning with ## (such as ##id), other than the first two lines
of the file
### 7.2) Previewing
In order to view the translation in the game, you need to compile your language
file with the strgen utility. As this utility is tailored to a specific OpenTTD
version, you need to compile it yourself. Just take the normal OpenTTD sources
and build that. During the build process the strgen utility will be made.
strgen is a command-line utility. It takes the language filename as parameter.
Example:
strgen lang/german.txt
This results in compiling german.txt and produces another file named german.lng.
Any missing strings are replaced with the English strings. Note that it looks
for english.txt in the lang subdirectory, which is where your language file
should also be.
That is all! You should now be able to select the language in the game options.
## 8.0) Troubleshooting
To see all startup options available to you, start OpenTTD with the
'`./openttd -h`' option. This might help you tweak some of the settings.
If the game is acting strange and you feel adventurous you can try the
'`-d [[<name>=]<level>]`' flag, where the higher levels will give you more
debugging output. The 'name' variable can help you to display only some type of
debugging messages. This is mostly undocumented so best is to look in the
source code file debug.c for the various debugging types. For more information
look at https://wiki.openttd.org/Command_line.
The most frequent problem is missing data files. Please install OpenGFX and
possibly OpenSFX and OpenMSX. See section 4.1.1 for more information.
Under certain circumstance, especially on Ubuntu OpenTTD can be extremely slow
and/or freeze. See known-bugs.txt for more information and how to solve this
problem on your computer.
Under Windows 98 and lower it is impossible to use a dedicated server; it will
fail to start. Perhaps this is for the better because those OSes are not known
for their stability.
With the added support for font-based text selecting a non-latin language can
result in lots of question marks ('?') being shown on screen. Please open your
configuration file (openttd.cfg - see Section 4.2 for where to find it)
and add a suitable font for the small, medium and / or large font, e.g.:
small_font = "Tahoma"
medium_font = "Tahoma"
large_font = "Tahoma"
You should use a font name like 'Tahoma' or a path to the desired font.
Any NewGRF file used in a game is stored inside the savegame and will refuse to
load if you do not have that NewGRF file available. A list of missing files can
be viewed in the NewGRF window accessible from the file load dialogue window.
You can try to obtain the missing files from that NewGRF dialogue or if they
are not available online you can search manually through our
[forum's graphics development section](https://www.tt-forums.net/viewforum.php?f=66)
or [GRFCrawler](https://grfcrawler.tt-forums.net). Put the NewGRF files in
OpenTTD's newgrf folder (see section 4.2 'OpenTTD directories') and rescan the
list of available NewGRFs. Once you have all missing files, you are set to go.
## 9.0) Licensing
OpenTTD is licensed under the GNU General Public License version 2.0. For
the complete license text, see the file 'COPYING.md'. This license applies
to all files in this distribution, except as noted below.
The squirrel implementation in src/3rdparty/squirrel is licensed under
the Zlib license. See src/3rdparty/squirrel/COPYRIGHT for the complete
license text.
The md5 implementation in src/3rdparty/md5 is licensed under the Zlib
license. See the comments in the source files in src/3rdparty/md5 for
the complete license text.
The implementations of Posix getaddrinfo and getnameinfo for OS/2 in
src/3rdparty/os2 are distributed partly under the GNU Lesser General Public
License 2.1, and partly under the (3-clause) BSD license. The exact licensing
terms can be found in src/3rdparty/os2/getaddrinfo.c resp.
src/3rdparty/os2/getnameinfo.c.
CONTRIBUTING.md is adapted from
[Bootstrap](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
under the [Creative Commons Attribution 3.0 Unported
License](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE)
terms for Bootstrap documentation.
## X.X) Credits
### The OpenTTD team (in alphabetical order):
- Grzegorz Duczyński (adf88) - General coding (since 1.7.2)
- Albert Hofkamp (Alberth) - GUI expert (since 0.7)
- Matthijs Kooijman (blathijs) - Pathfinder-guru, Debian port (since 0.3)
- Ulf Hermann (fonsinchen) - Cargo Distribution (since 1.3)
- Christoph Elsenhans (frosch) - General coding (since 0.6)
- Loïc Guilloux (glx) - Windows Expert (since 0.4.5)
- Charles Pigott (LordAro) - General / Correctness police (since 1.9)
- Michael Lutz (michi_cc) - Path based signals (since 0.7)
- Niels Martin Hansen (nielsm) - Music system, general coding (since 1.9)
- Owen Rudge (orudge) - Forum host, OS/2 port (since 0.1)
- Peter Nelson (peter1138) - Spiritual descendant from newGRF gods (since 0.4.5)
- Ingo von Borstel (planetmaker) - General coding, Support (since 1.1)
- Remko Bijker (Rubidium) - Lead coder and way more (since 0.4.5)
- José Soler (Terkhen) - General coding (since 1.0)
- Leif Linse (Zuu) - AI/Game Script (since 1.2)
### Inactive Developers:
- Jean-François Claeys (Belugas) - GUI, newindustries and more (0.4.5 - 1.0)
- Bjarni Corfitzen (Bjarni) - macOS port, coder and vehicles (0.3 - 0.7)
- Victor Fischer (Celestar) - Programming everywhere you need him to (0.3 - 0.6)
- Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;) (0.4.5 - 0.6)
- Jonathan Coome (Maedhros) - High priest of the NewGRF Temple (0.5 - 0.6)
- Attila Bán (MiHaMiX) - WebTranslator 1 and 2 (0.3 - 0.5)
- Zdeněk Sojka (SmatZ) - Bug finder and fixer (0.6 - 1.3)
- Christoph Mallon (Tron) - Programmer, code correctness police (0.3 - 0.5)
- Patric Stout (TrueBrain) - NoProgrammer (0.3 - 1.2), sys op (active)
- Thijs Marinussen (Yexo) - AI Framework, General (0.6 - 1.3)
### Retired Developers:
- Tamás Faragó (Darkvater) - Ex-Lead coder (0.3 - 0.5)
- Dominik Scherer (dominik81) - Lead programmer, GUI expert (0.3 - 0.3)
- Emil Djupfeld (egladil) - macOS port (0.4 - 0.6)
- Simon Sasburg (HackyKid) - Bug fixer (0.4 - 0.4.5)
- Ludvig Strigeus (ludde) - Original author of OpenTTD, main coder (0.1 - 0.3)
- Cian Duffy (MYOB) - BeOS port / manual writing (0.1 - 0.3)
- Petr Baudiš (pasky) - Many patches, newgrf support, etc. (0.3 - 0.3)
- Benedikt Brüggemeier (skidd13) - Bug fixer and code reworker (0.6 - 0.7)
- Serge Paquet (vurlix) - 2nd contributor after ludde (0.1 - 0.3)
### Thanks to:
- Josef Drexler - For his great work on TTDPatch.
- Marcin Grzegorczyk - For his TTDPatch work and documentation of Transport Tycoon Deluxe internals and track foundations
- Stefan Meißner (sign_de) - For his work on the console
- Mike Ragsdale - OpenTTD installer
- Christian Rosentreter (tokai) - MorphOS / AmigaOS port
- Richard Kempton (RichK67) - Additional airports, initial TGP implementation
- Alberto Demichelis - Squirrel scripting language
- L. Peter Deutsch - MD5 implementation
- Michael Blunck - For revolutionizing TTD with awesome graphics
- George - Canal graphics
- Andrew Parkhouse (andythenorth) - River graphics
- David Dallaston (Pikka) - Tram tracks
- All Translators - For their support to make OpenTTD a truly international game
- Bug Reporters - Thanks for all bug reports
- Chris Sawyer - For an amazing game!

View File

@@ -1,74 +0,0 @@
trigger:
- master
- release/*
pr:
- master
- release/*
jobs:
- job: windows
displayName: 'Windows'
pool:
vmImage: 'VS2017-Win2016'
strategy:
matrix:
Win32:
BuildPlatform: 'Win32'
Win64:
BuildPlatform: 'x64'
steps:
- template: azure-pipelines/templates/ci-git-rebase.yml
- template: azure-pipelines/templates/windows-dependencies.yml
- template: azure-pipelines/templates/ci-opengfx.yml
- template: azure-pipelines/templates/windows-build.yml
parameters:
BuildPlatform: $(BuildPlatform)
BuildConfiguration: Debug
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
cd projects
call regression.bat
displayName: 'Test'
- job: linux
displayName: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
commit-checker:
Tag: 'commit-checker'
linux-amd64-clang-3.9:
Tag: 'linux-amd64-clang-3.9'
linux-amd64-gcc-6:
Tag: 'linux-amd64-gcc-6'
linux-i386-gcc-6:
Tag: 'linux-i386-gcc-6'
steps:
- template: azure-pipelines/templates/ci-git-rebase.yml
# The dockers already have the dependencies installed
# The dockers already have OpenGFX installed
- template: azure-pipelines/templates/linux-build.yml
parameters:
Image: compile-farm-ci
Tag: $(Tag)
- job: macos
displayName: 'MacOS'
pool:
vmImage: 'macOS-10.13'
variables:
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- template: azure-pipelines/templates/ci-git-rebase.yml
- template: azure-pipelines/templates/osx-dependencies.yml
- template: azure-pipelines/templates/ci-opengfx.yml
- template: azure-pipelines/templates/osx-build.yml
- script: 'make regression'
displayName: 'Test'

View File

@@ -1,10 +0,0 @@
trigger:
branches:
include:
- refs/tags/*
pr: none
jobs:
- template: azure-pipelines/templates/release.yml
parameters:
IsStableRelease: true

View File

@@ -1,7 +0,0 @@
trigger: none
pr: none
jobs:
- template: azure-pipelines/templates/release.yml
parameters:
IsStableRelease: false

View File

@@ -1,16 +0,0 @@
#!/bin/sh
tag=$(git describe --tags 2>/dev/null)
# If we are a tag, show the part of the changelog till (but excluding) the last stable
if [ -n "$tag" ]; then
grep='^[0-9]\.[0-9]\.[0-9][^-]'
next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9].[0-9].[0-9]/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
exit 0
fi
# In all other cases, show the git log of the last 7 days
revdate=$(git log -1 --pretty=format:"%ci")
last_week=$(date -u -d "$revdate -7days" +"%Y-%m-%d %H:%M")
git log --after="${last_week}" --pretty=fuller

View File

@@ -1,60 +0,0 @@
#!/bin/sh
set -ex
if [ -z "$1" ]; then
echo "Usage: $0 <folder-with-bundles>"
exit 1
fi
FOLDER=$1
if [ ! -e .version ] || [ ! -e .release_date ]; then
echo "This script should be executed in the root of an extracted source tarball"
exit 1
fi
# Find the name based on the version
if [ -e .is_stable ]; then
isTesting=$(cat .version | grep "RC\|beta" || true)
if [ -z "${isTesting}" ]; then
NAME="stable"
else
NAME="testing"
fi
else
NAME=$(cat .version | cut -d- -f2 | cut -d- -f-2)
fi
# Convert the date to a YAML date
DATE=$(cat .release_date | tr ' ' T | sed 's/TUTC/:00-00:00/')
VERSION=$(cat .version)
BASE="openttd-${VERSION}"
echo "name: ${NAME}" >> manifest.yaml
echo "date: ${DATE}" >> manifest.yaml
echo "base: ${BASE}-" >> manifest.yaml
echo "files:" >> manifest.yaml
error=""
for i in $(ls ${FOLDER} | grep -v ".txt$\|.md$\|sum$" | sort); do
if [ -n "$(echo $i | grep pdb.xz)" ]; then continue; fi
if [ -n "$(echo $i | grep dbg.deb)" ]; then continue; fi
if [ ! -e ${FOLDER}/$i.md5sum ] || [ ! -e ${FOLDER}/$i.sha1sum ] || [ ! -e ${FOLDER}/$i.sha256sum ]; then
echo "ERROR: missing checksum file for ${i}" 1>&2
error="y"
continue
fi
echo "- id: $i" >> manifest.yaml
echo " size: $(stat -c"%s" ${FOLDER}/$i)" >> manifest.yaml
echo " md5sum: $(cat ${FOLDER}/$i.md5sum | cut -d\ -f1)" >> manifest.yaml
echo " sha1sum: $(cat ${FOLDER}/$i.sha1sum | cut -d\ -f1)" >> manifest.yaml
echo " sha256sum: $(cat ${FOLDER}/$i.sha256sum | cut -d\ -f1)" >> manifest.yaml
done
if [ -n "${error}" ]; then
echo "ERROR: exiting due to earlier errors" 1>&2
exit 1
fi

View File

@@ -1,10 +0,0 @@
steps:
# Rebase to target branch for every PR. This means users don't have to
# rebase every time target branch changes. As long as the PR applies cleanly, we
# will validate it.
- bash: |
git config user.email 'info@openttd.org'
git config user.name 'OpenTTD CI'
git rebase origin/${SYSTEM_PULLREQUEST_TARGETBRANCH}
displayName: 'Rebase to target branch'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

View File

@@ -1,8 +0,0 @@
steps:
- bash: |
set -ex
cd bin/baseset
curl -L https://binaries.openttd.org/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip > opengfx-0.5.2-all.zip
unzip opengfx-0.5.2-all.zip
rm -f opengfx-0.5.2-all.zip
displayName: 'Install OpenGFX'

View File

@@ -1,36 +0,0 @@
parameters:
Image: ''
Tag: ''
ContainerCommand: ''
steps:
# 'envVars' in the 'Docker@1' task is a bit funky. When you want to use a
# variable, you have to quote it. But the quote is also sent directly to
# Docker and ends up in the variable, which you don't want. To work around
# this, we set the correct variable first (which becomes an env-variable), and
# pass that env-variable through to Docker. We cannot use the normal
# 'variables' entry, as we are a template. So that results in this bit of
# Bash code. Not because it is pretty, but it is the only way we found that
# works.
- bash: |
echo "##vso[task.setvariable variable=TARGET_BRANCH]${SYSTEM_PULLREQUEST_TARGETBRANCH}"
echo "Target branch is ${SYSTEM_PULLREQUEST_TARGETBRANCH}"
displayName: "Set target branch"
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- task: Docker@1
${{ if eq(parameters.Image, 'compile-farm') }}:
displayName: 'Build'
${{ if eq(parameters.Image, 'compile-farm-ci') }}:
displayName: 'Build and test'
# Run the commit-checker only if it is a Pull Request
condition: and(succeeded(), or(not(contains(variables['Agent.JobName'], 'commit-checker')), eq(variables['Build.Reason'], 'PullRequest')))
inputs:
command: 'Run an image'
imageName: openttd/${{ parameters.Image }}:${{ parameters.Tag }}
volumes: '$(Build.SourcesDirectory):$(Build.SourcesDirectory)'
workingDirectory: '$(Build.SourcesDirectory)'
containerCommand: ${{ parameters.ContainerCommand }}
runInBackground: false
envVars: |
TARGET_BRANCH

View File

@@ -1,5 +0,0 @@
steps:
# Because we run the compile in a docker (under root), we are not owner
# of the 'bundles' folder. Fix that by executing a chown on it.
- bash: sudo chown -R $(id -u):$(id -g) bundles
displayName: 'Claim bundles folder back'

View File

@@ -1,5 +0,0 @@
steps:
- script: './configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --enable-static'
displayName: 'Configure'
- script: 'make -j2'
displayName: 'Build'

View File

@@ -1,12 +0,0 @@
steps:
- script: |
set -ex
HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng freetype
# Remove the dynamic libraries of these libraries, to ensure we use
# the static versions. That is important, as it is unlikely any
# end-user has these brew libraries installed.
rm /usr/local/Cellar/lzo/*/lib/*.dylib
rm /usr/local/Cellar/xz/*/lib/*.dylib
rm /usr/local/Cellar/libpng/*/lib/*.dylib
rm /usr/local/Cellar/freetype/*/lib/*.dylib
displayName: 'Install dependencies'

View File

@@ -1,19 +0,0 @@
parameters:
CalculateChecksums: true
steps:
- ${{ if eq(parameters.CalculateChecksums, true) }}:
- bash: |
set -ex
cd bundles
for i in $(ls); do
openssl dgst -r -md5 -hex $i > $i.md5sum
openssl dgst -r -sha1 -hex $i > $i.sha1sum
openssl dgst -r -sha256 -hex $i > $i.sha256sum
done
displayName: 'Calculate checksums'
- task: PublishBuildArtifacts@1
displayName: 'Publish bundles'
inputs:
PathtoPublish: bundles/
ArtifactName: bundles

View File

@@ -1,20 +0,0 @@
# Fetch the source tarball as prepared by an earlier job. In there is the
# version predefined. This ensures we are all going to compile the same
# source with the same version.
steps:
- checkout: none
- task: DownloadBuildArtifacts@0
displayName: 'Download source'
inputs:
downloadType: specific
itemPattern: 'bundles/openttd-*-source.tar.xz'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- bash: tar --xz -xf ../a/bundles/openttd-*-source.tar.xz --strip-components=1
displayName: 'Extracting source'
- bash: |
set -e
VERSION=$(cat .version)
echo "${VERSION}"
echo "##vso[build.updatebuildnumber]${VERSION}"
displayName: 'Change BuildNumber to version'

View File

@@ -1,20 +0,0 @@
parameters:
IsStableRelease: false
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download all bundles'
inputs:
downloadType: specific
itemPattern: 'bundles/*'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters.IsStableRelease, true) }}:
- script: |
touch .is_stable
displayName: 'Mark as stable release'
- script: |
set -ex
./azure-pipelines/manifest.sh ../a/bundles/
mkdir -p bundles
mv manifest.yaml bundles/
displayName: 'Create manifest.yaml'

View File

@@ -1,35 +0,0 @@
# Set the revisions, and remove the VCS files.
# This ensures everything else picks up on the predefined versions, and not
# that because of some build process the version all of a sudden changes.
steps:
- script: |
set -ex
if [ -n "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}" ]; then
# We are triggered from a GitHub Pull Request
git checkout -B pr${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}
elif [ "${BUILD_SOURCEBRANCHNAME}" = "merge" ] || [ "${BUILD_SOURCEBRANCHNAME}" = "head" ]; then
# We are manually triggered based on a GitHub Pull Request
PULLREQUESTNUMBER=$(echo ${BUILD_SOURCEBRANCH} | cut -d/ -f3)
git checkout -B pr${PULLREQUESTNUMBER}
else
git checkout -B ${BUILD_SOURCEBRANCHNAME}
fi
./findversion.sh > .ottdrev
./azure-pipelines/changelog.sh > .changelog
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
cat .ottdrev | cut -f 1 -d$'\t' > .version
echo "Release Date: $(cat .release_date)"
echo "Revision: $(cat .ottdrev)"
echo "Version: $(cat .version)"
displayName: 'Create version files'
- script: |
set -e
VERSION=$(cat .version)
echo "${VERSION}"
echo "##vso[build.updatebuildnumber]${VERSION}"
displayName: 'Change BuildNumber to version'
- script: find . -iname .hg -or -iname .git -or -iname .svn | xargs rm -rf
displayName: 'Remove VCS information'

View File

@@ -1,184 +0,0 @@
parameters:
# If this is false, not all targets are triggered. For example:
# The NSIS installer for Windows and the creation of debs only work for
# releases. Not for any other type of binary. So they are skilled if this
# is set to false.
IsStableRelease: false
jobs:
- job: source
displayName: 'Source'
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: release-prepare-source.yml
- script: |
set -ex
# Rename the folder to openttd-NNN-source
mkdir openttd-$(Build.BuildNumber)
find . -maxdepth 1 -not -name . -not -name openttd-$(Build.BuildNumber) -exec mv {} openttd-$(Build.BuildNumber)/ \;
# Copy back release_date, as it is needed for the template 'release-bundles'
cp openttd-$(Build.BuildNumber)/.release_date .release_date
mkdir bundles
tar --xz -cf bundles/openttd-$(Build.BuildNumber)-source.tar.xz openttd-$(Build.BuildNumber)
zip -9 -r -q bundles/openttd-$(Build.BuildNumber)-source.zip openttd-$(Build.BuildNumber)
displayName: 'Create bundle'
- template: release-bundles.yml
- job: meta
displayName: 'Metadata'
pool:
vmImage: 'ubuntu-16.04'
dependsOn: source
steps:
- template: release-fetch-source.yml
- script: |
set -ex
mkdir -p bundles
cp .changelog bundles/changelog.txt
cp .release_date bundles/released.txt
cp README.md bundles/README.md
displayName: 'Copy meta files'
- template: release-bundles.yml
parameters:
CalculateChecksums: false
- job: docs
displayName: 'Docs'
pool:
vmImage: 'ubuntu-16.04'
dependsOn: source
steps:
- template: release-fetch-source.yml
- template: linux-build.yml
parameters:
Image: compile-farm
ContainerCommand: '$(Build.BuildNumber)'
Tag: docs
- template: linux-claim-bundles.yml
- template: release-bundles.yml
- job: windows
displayName: 'Windows'
pool:
vmImage: 'VS2017-Win2016'
dependsOn: source
strategy:
matrix:
Win32:
BuildPlatform: 'Win32'
BundlePlatform: 'win32'
Win64:
BuildPlatform: 'x64'
BundlePlatform: 'win64'
steps:
- template: release-fetch-source.yml
- template: windows-dependencies.yml
- template: windows-dependency-zip.yml
- ${{ if eq(parameters.IsStableRelease, true) }}:
- template: windows-dependency-nsis.yml
- template: windows-build.yml
parameters:
BuildPlatform: $(BuildPlatform)
BuildConfiguration: Release
- bash: |
set -ex
make -f Makefile.msvc bundle_pdb bundle_zip PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform)
displayName: 'Create bundles'
- ${{ if eq(parameters.IsStableRelease, true) }}:
- bash: |
set -ex
# NSIS will be part of the Hosted image in the next update. Till then, we set the PATH ourself
export PATH="${PATH}:/c/Program Files (x86)/NSIS"
make -f Makefile.msvc bundle_exe PLATFORM=$(BundlePlatform) BUNDLE_NAME=openttd-$(Build.BuildNumber)-windows-$(BundlePlatform)
displayName: 'Create installer bundle'
- template: release-bundles.yml
- ${{ if eq(parameters.IsStableRelease, true) }}:
- job: linux_stable
displayName: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
dependsOn: source
strategy:
matrix:
linux-ubuntu-xenial-i386-gcc:
Tag: 'linux-ubuntu-xenial-i386-gcc'
linux-ubuntu-xenial-amd64-gcc:
Tag: 'linux-ubuntu-xenial-amd64-gcc'
linux-ubuntu-bionic-i386-gcc:
Tag: 'linux-ubuntu-bionic-i386-gcc'
linux-ubuntu-bionic-amd64-gcc:
Tag: 'linux-ubuntu-bionic-amd64-gcc'
linux-debian-stretch-i386-gcc:
Tag: 'linux-debian-stretch-i386-gcc'
linux-debian-stretch-amd64-gcc:
Tag: 'linux-debian-stretch-amd64-gcc'
linux-debian-buster-i386-gcc:
Tag: 'linux-debian-buster-i386-gcc'
linux-debian-buster-amd64-gcc:
Tag: 'linux-debian-buster-amd64-gcc'
steps:
- template: release-fetch-source.yml
- template: linux-build.yml
parameters:
Image: compile-farm
ContainerCommand: '$(Build.BuildNumber)'
Tag: $(Tag)
- template: linux-claim-bundles.yml
- template: release-bundles.yml
- job: macos
displayName: 'MacOS'
pool:
vmImage: 'macOS-10.13'
dependsOn: source
variables:
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- template: release-fetch-source.yml
- template: osx-dependencies.yml
- template: osx-build.yml
- script: 'make bundle_zip bundle_dmg BUNDLE_NAME=openttd-$(Build.BuildNumber)-macosx'
displayName: 'Create bundles'
- template: release-bundles.yml
- job: manifest
displayName: 'Manifest'
pool:
vmImage: 'ubuntu-16.04'
dependsOn:
- source
- docs
- windows
- ${{ if eq(parameters.IsStableRelease, true) }}:
- linux_stable
- macos
# "Skipped" is not a status, and is not succeeded. So it seems to be
# considered failed. So we trigger if all the earlier jobs are done (which
# might be succeeded, failed, or skipped), and run this job. This is not
# optimal, but given the rules, it is the only way to get this to work (as
# some jobs might be skipped).
condition: succeededOrFailed()
steps:
- template: release-fetch-source.yml
- template: release-manifest.yml
${{ if eq(parameters.IsStableRelease, true) }}:
parameters:
IsStableRelease: true
- template: release-bundles.yml
parameters:
CalculateChecksums: false

View File

@@ -1,11 +0,0 @@
parameters:
BuildPlatform: ''
steps:
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: 'projects/openttd_vs141.sln'
platform: ${{ parameters.BuildPlatform }}
configuration: ${{ parameters.BuildConfiguration }}
maximumCpuCount: true

View File

@@ -1,14 +0,0 @@
steps:
- bash: |
set -ex
curl -L https://github.com/OpenTTD/CompileFarm/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip
unzip windows-dependencies.zip
rm -f windows-dependencies.zip
mv windows-dependencies/installed /c/vcpkg/
rm -rf windows-dependencies
displayName: 'Install dependencies'
workingDirectory: $(Build.ArtifactStagingDirectory)
- script: c:\vcpkg\vcpkg.exe integrate install
displayName: 'Integrate vcpkg'

View File

@@ -1,26 +0,0 @@
parameters:
condition: true
steps:
- bash: |
set -ex
mkdir nsis-plugin; cd nsis-plugin
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/Nsis7z.zip > Nsis7z.zip
unzip Nsis7z.zip
cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/"
cd ..; rm -rf nsis-plugin
mkdir nsis-plugin; cd nsis-plugin
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisGetVersion.zip > NsisGetVersion.zip
unzip NsisGetVersion.zip
cp -R Plugins/* "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/"
cd ..; rm -rf nsis-plugin
mkdir nsis-plugin; cd nsis-plugin
curl -L https://devs.openttd.org/~truebrain/nsis-plugins/NsisFindProc.zip > NsisFindProc.zip
unzip NsisFindProc.zip
cp -R *.dll "/c/Program Files (x86)/NSIS/Plugins/x86-ansi/"
cd ..; rm -rf nsis-plugin
displayName: 'Install NSIS with the 7z, GetVersion, and FindProc plugins'
condition: and(succeeded(), ${{ parameters.condition }})

View File

@@ -1,5 +0,0 @@
steps:
- bash: |
set -ex
choco install zip
displayName: 'Install zip'

View File

@@ -1,383 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("0.7 API compatibility in effect:");
AILog.Info(" - AITown::GetLastMonthProduction's behaviour has slightly changed.");
AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies.");
AILog.Info(" - AISubsidy::GetSource returns STATION_INVALID for awarded subsidies.");
AISign.GetMaxSignID <- function()
{
local list = AISignList();
local max_id = 0;
foreach (id, d in list) {
if (id > max_id) max_id = id;
}
return max_id;
}
AITile.GetHeight <- function(tile)
{
if (!AIMap.IsValidTile(tile)) return -1;
return AITile.GetCornerHeight(tile, AITile.CORNER_N);
}
AIOrder.ChangeOrder <- function(vehicle_id, order_position, order_flags)
{
return AIOrder.SetOrderFlags(vehicle_id, order_position, order_flags);
}
AIWaypoint.WAYPOINT_INVALID <- 0xFFFF;
AISubsidy.SourceIsTown <- function(subsidy_id)
{
if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
return AISubsidy.GetSourceType(subsidy_id) == AISubsidy.SPT_TOWN;
}
AISubsidy.GetSource <- function(subsidy_id)
{
if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
if (AISubsidy.IsAwarded(subsidy_id)) {
return AIBaseStation.STATION_INVALID;
}
return AISubsidy.GetSourceIndex(subsidy_id);
}
AISubsidy.DestinationIsTown <- function(subsidy_id)
{
if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
return AISubsidy.GetDestinationType(subsidy_id) == AISubsidy.SPT_TOWN;
}
AISubsidy.GetDestination <- function(subsidy_id)
{
if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
if (AISubsidy.IsAwarded(subsidy_id)) {
return AIBaseStation.STATION_INVALID;
}
return AISubsidy.GetDestinationIndex(subsidy_id);
}
AITown.GetMaxProduction <- function(town_id, cargo_id)
{
return AITown.GetLastMonthProduction(town_id, cargo_id);
}
AIRail.RemoveRailWaypoint <- function(tile)
{
return AIRail.RemoveRailWaypointTileRect(tile, tile, true);
}
AIRail.RemoveRailStationTileRect <- function(tile, tile2)
{
return AIRail.RemoveRailStationTileRectangle(tile, tile2, false);
}
AIVehicle.SkipToVehicleOrder <- function(vehicle_id, order_position)
{
return AIOrder.SkipToOrder(vehicle_id, order_position);
}
AIEngine.IsValidEngine <- function(engine_id)
{
return AIEngine.IsBuildable(engine_id);
}
AIEngine._GetName <- AIEngine.GetName;
AIEngine.GetName <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return null;
return AIEngine._GetName(engine_id);
}
AIEngine._GetCargoType <- AIEngine.GetCargoType;
AIEngine.GetCargoType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return 255;
return AIEngine._GetCargoType(engine_id);
}
AIEngine._CanRefitCargo <- AIEngine.CanRefitCargo;
AIEngine.CanRefitCargo <- function(engine_id, cargo_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine._CanRefitCargo(engine_id, cargo_id);
}
AIEngine._CanPullCargo <- AIEngine.CanPullCargo;
AIEngine.CanPullCargo <- function(engine_id, cargo_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine._CanPullCargo(engine_id, cargo_id);
}
AIEngine._GetCapacity <- AIEngine.GetCapacity;
AIEngine.GetCapacity <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetCapacity(engine_id);
}
AIEngine._GetReliability <- AIEngine.GetReliability;
AIEngine.GetReliability <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetReliability(engine_id);
}
AIEngine._GetMaxSpeed <- AIEngine.GetMaxSpeed;
AIEngine.GetMaxSpeed <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetMaxSpeed(engine_id);
}
AIEngine._GetPrice <- AIEngine.GetPrice;
AIEngine.GetPrice <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetPrice(engine_id);
}
AIEngine._GetMaxAge <- AIEngine.GetMaxAge;
AIEngine.GetMaxAge <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetMaxAge(engine_id);
}
AIEngine._GetRunningCost <- AIEngine.GetRunningCost;
AIEngine.GetRunningCost <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetRunningCost(engine_id);
}
AIEngine._GetPower <- AIEngine.GetPower;
AIEngine.GetPower <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetPower(engine_id);
}
AIEngine._GetWeight <- AIEngine.GetWeight;
AIEngine.GetWeight <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetWeight(engine_id);
}
AIEngine._GetMaxTractiveEffort <- AIEngine.GetMaxTractiveEffort;
AIEngine.GetMaxTractiveEffort <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetMaxTractiveEffort(engine_id);
}
AIEngine._GetDesignDate <- AIEngine.GetDesignDate;
AIEngine.GetDesignDate <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetDesignDate(engine_id);
}
AIEngine._GetVehicleType <- AIEngine.GetVehicleType;
AIEngine.GetVehicleType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return AIVehicle.VT_INVALID;
return AIEngine._GetVehicleType(engine_id);
}
AIEngine._IsWagon <- AIEngine.IsWagon;
AIEngine.IsWagon <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine._IsWagon(engine_id);
}
AIEngine._CanRunOnRail <- AIEngine.CanRunOnRail;
AIEngine.CanRunOnRail <- function(engine_id, track_rail_type)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine._CanRunOnRail(engine_id, track_rail_type);
}
AIEngine._HasPowerOnRail <- AIEngine.HasPowerOnRail;
AIEngine.HasPowerOnRail <- function(engine_id, track_rail_type)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine._HasPowerOnRail(engine_id, track_rail_type);
}
AIEngine._GetRoadType <- AIEngine.GetRoadType;
AIEngine.GetRoadType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return AIRoad.ROADTYPE_INVALID;
return AIEngine._GetRoadType(engine_id);
}
AIEngine._GetRailType <- AIEngine.GetRailType;
AIEngine.GetRailType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return AIRail.RAILTYPE_INVALID;
return AIEngine._GetRailType(engine_id);
}
AIEngine._IsArticulated <- AIEngine.IsArticulated;
AIEngine.IsArticulated <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return false;
return AIEngine._IsArticulated(engine_id);
}
AIEngine._GetPlaneType <- AIEngine.GetPlaneType;
AIEngine.GetPlaneType <- function(engine_id)
{
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetPlaneType(engine_id);
}
_AIWaypointList <- AIWaypointList;
class AIWaypointList extends _AIWaypointList {
constructor()
{
::_AIWaypointList.constructor(AIWaypoint.WAYPOINT_RAIL);
}
}
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
}
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
}
AIBridgeList.HasNext <-
AIBridgeList_Length.HasNext <-
AICargoList.HasNext <-
AICargoList_IndustryAccepting.HasNext <-
AICargoList_IndustryProducing.HasNext <-
AIDepotList.HasNext <-
AIEngineList.HasNext <-
AIGroupList.HasNext <-
AIIndustryList.HasNext <-
AIIndustryList_CargoAccepting.HasNext <-
AIIndustryList_CargoProducing.HasNext <-
AIIndustryTypeList.HasNext <-
AIList.HasNext <-
AIRailTypeList.HasNext <-
AISignList.HasNext <-
AIStationList.HasNext <-
AIStationList_Vehicle.HasNext <-
AISubsidyList.HasNext <-
AITileList.HasNext <-
AITileList_IndustryAccepting.HasNext <-
AITileList_IndustryProducing.HasNext <-
AITileList_StationType.HasNext <-
AITownList.HasNext <-
AIVehicleList.HasNext <-
AIVehicleList_DefaultGroup.HasNext <-
AIVehicleList_Group.HasNext <-
AIVehicleList_SharedOrders.HasNext <-
AIVehicleList_Station.HasNext <-
AIWaypointList.HasNext <-
AIWaypointList_Vehicle.HasNext <-
function()
{
return !this.IsEnd();
}
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
{
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
}
AIAbstractList <- AIList;
AIList.ChangeItem <- AIList.SetValue;
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
AICompany.GetCompanyValue <- function(company)
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,135 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.0 API compatibility in effect.");
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
}
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
{
if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
}
AIBridgeList.HasNext <-
AIBridgeList_Length.HasNext <-
AICargoList.HasNext <-
AICargoList_IndustryAccepting.HasNext <-
AICargoList_IndustryProducing.HasNext <-
AIDepotList.HasNext <-
AIEngineList.HasNext <-
AIGroupList.HasNext <-
AIIndustryList.HasNext <-
AIIndustryList_CargoAccepting.HasNext <-
AIIndustryList_CargoProducing.HasNext <-
AIIndustryTypeList.HasNext <-
AIList.HasNext <-
AIRailTypeList.HasNext <-
AISignList.HasNext <-
AIStationList.HasNext <-
AIStationList_Vehicle.HasNext <-
AISubsidyList.HasNext <-
AITileList.HasNext <-
AITileList_IndustryAccepting.HasNext <-
AITileList_IndustryProducing.HasNext <-
AITileList_StationType.HasNext <-
AITownList.HasNext <-
AIVehicleList.HasNext <-
AIVehicleList_DefaultGroup.HasNext <-
AIVehicleList_Depot.HasNext <-
AIVehicleList_Group.HasNext <-
AIVehicleList_SharedOrders.HasNext <-
AIVehicleList_Station.HasNext <-
AIWaypointList.HasNext <-
AIWaypointList_Vehicle.HasNext <-
function()
{
return !this.IsEnd();
}
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
{
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
}
AIAbstractList <- AIList;
AIList.ChangeItem <- AIList.SetValue;
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
AICompany.GetCompanyValue <- function(company)
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER;
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,72 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.1 API compatibility in effect.");
AICompany.GetCompanyValue <- function(company)
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER;
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
AIEvent.AI_ET_TOWN_FOUNDED <- AIEvent.ET_TOWN_FOUNDED;
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,8 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.2 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.3 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.4 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.5 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.6 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.7 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.8 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
AIBridge._GetName <- AIBridge.GetName;
AIBridge.GetName <- function(bridge_id)
{
return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
}
/* 1.9 adds parent_group_id to CreateGroup function */
AIGroup._CreateGroup <- AIGroup.CreateGroup;
AIGroup.CreateGroup <- function(vehicle_type)
{
return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
}

View File

@@ -1,10 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
AILog.Info("1.9 API compatibility in effect.");

View File

@@ -2,12 +2,12 @@
# $Id$
if ! [ -f ai/regression/completeness.sh ]; then
if ! [ -f ai/regression/regression.nut ]; then
echo "Make sure you are in the root of OpenTTD before starting this script."
exit 1
fi
cat ai/regression/tst_*/main.nut | tr ';' '\n' | awk '
cat ai/regression/regression.nut | tr ';' '\n' | awk '
/^function/ {
for (local in locals) {
delete locals[local]
@@ -46,9 +46,9 @@ cat ai/regression/tst_*/main.nut | tr ';' '\n' | awk '
}
}
}
# We want to remove everything before the FIRST occurrence of AI.
# If we do not remove any other occurrences of AI from the string
# we will remove everything before the LAST occurrence of AI, so
# We want to remove everything before the FIRST occurence of AI.
# If we do not remove any other occurences of AI from the string
# we will remove everything before the LAST occurence of AI, so
# do some little magic to make it work the way we want.
sub("AI", "AXXXXY")
gsub("AI", "AXXXXX")
@@ -61,7 +61,7 @@ cat ai/regression/tst_*/main.nut | tr ';' '\n' | awk '
}
' | sed 's/ //g' | sort | uniq > tmp.in_regression
grep 'DefSQ.*Method' ../src/script/api/ai/*.hpp.sq | grep -v 'AIError::' | grep -v 'AIAbstractList::Valuate' | grep -v '::GetClassName' | sed 's/^[^,]*, &//g;s/,[^,]*//g' | sort > tmp.in_api
grep 'DefSQ.*Method' ../src/ai/api/*.hpp.sq | grep -v 'AIError::' | grep -v 'AIAbstractList::Valuate' | grep -v '::GetClassName' | sed 's/^[^,]*, &//g;s/,[^,]*//g' | sort > tmp.in_api
diff -u tmp.in_regression tmp.in_api | grep -v '^+++' | grep '^+' | sed 's/^+//'

View File

@@ -15,6 +15,3 @@ regression =
[vehicle]
road_side = right
plane_speed = 2
[construction]
max_bridge_length = 100

View File

@@ -4,9 +4,8 @@ class Regression extends AIInfo {
function GetAuthor() { return "OpenTTD NoAI Developers Team"; }
function GetName() { return "Regression"; }
function GetShortName() { return "REGR"; }
function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; }
function GetDescription() { return "This runs regression-tests on all commands. On the same map the result should always be the same."; }
function GetVersion() { return 1; }
function GetAPIVersion() { return "1.10"; }
function GetDate() { return "2007-03-18"; }
function CreateInstance() { return "Regression"; }
}

View File

@@ -2,11 +2,14 @@
# $Id$
if ! [ -f ai/regression/run.sh ]; then
if ! [ -f ai/regression/regression.nut ]; then
echo "Make sure you are in the root of OpenTTD before starting this script."
exit 1
fi
cp ai/regression/regression.nut ai/regression/main.nut
cp ai/regression/regression_info.nut ai/regression/info.nut
if [ -f scripts/game_start.scr ]; then
mv scripts/game_start.scr scripts/game_start.scr.regression
fi
@@ -19,53 +22,30 @@ fi
if [ "$1" = "-g" ]; then
gdb="gdb --ex run --args "
fi
if [ -d "ai/regression/tst_$1" ]; then
tests="ai/regression/tst_$1"
elif [ -d "ai/regression/tst_$2" ]; then
tests="ai/regression/tst_$2"
if [ -n "$gdb" ]; then
$gdb ./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav
else
tests=ai/regression/tst_*
./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav -d ai=2 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)", "0x00000000", $0); gsub("^dbg: \\[ai\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' > tmp.regression
fi
ret=0
for tst in $tests; do
echo -n "Running $tst... "
# Make sure that only one info.nut is present for each test run. Otherwise openttd gets confused.
cp ai/regression/regression_info.nut $tst/info.nut
sav=$tst/test.sav
if ! [ -f $sav ]; then
sav=ai/regression/empty.sav
fi
if [ -n "$gdb" ]; then
$gdb ./openttd -x -c ai/regression/regression.cfg $params -g $sav
if [ -z "$gdb" ]; then
res="`diff -ub ai/regression/regression.txt tmp.regression`"
if [ -z "$res" ]; then
echo "Regression test passed!"
else
./openttd -x -c ai/regression/regression.cfg $params -g $sav -d script=2 -d misc=9 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[script\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' | grep -v '^dbg: \[.*\]' > $tst/tmp.regression
echo "Regression test failed! Difference:"
echo "$res"
fi
echo ""
echo "Regression test done"
fi
if [ -z "$gdb" ]; then
res="`diff -ub $tst/result.txt $tst/tmp.regression`"
if [ -z "$res" ]; then
echo "passed!"
else
echo "failed! Difference:"
echo "$res"
ret=1
fi
fi
rm $tst/info.nut
if [ "$1" != "-k" ]; then
rm -f $tst/tmp.regression
fi
done
rm -f ai/regression/main.nut ai/regression/info.nut
if [ -f scripts/game_start.scr.regression ]; then
mv scripts/game_start.scr.regression scripts/game_start.scr
fi
exit $ret
if [ "$1" != "-k" ]; then
rm -f tmp.regression
fi

View File

@@ -1,154 +0,0 @@
Option Explicit
' $Id$
'
' This file is part of OpenTTD.
' OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
' OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
' See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Function GetTestList()
Dim retests, i, tests, dir
Set retests = New RegExp
Set GetTestList = CreateObject("Scripting.Dictionary")
retests.Pattern = "ai/regression/tst_*"
retests.Global = True
For i = 0 To WScript.Arguments.Count - 1
Dim test
test = "ai/regression/tst_" & WScript.Arguments.Item(i)
If FSO.FolderExists(test) Then
retests.Pattern = test
Exit For
End If
Next
For Each dir In FSO.GetFolder("ai/regression/").SubFolders
Dim name
name = "ai/regression/" & dir.Name
If retests.Test(name) Then
GetTestList.Add name, name
End If
Next
End Function
Function GetParams()
GetParams = "-snull -mnull -vnull:ticks=30000"
If WScript.Arguments.Count = 0 Then Exit Function
If WScript.Arguments.Item(0) <> "-r" Then Exit Function
GetParams = ""
End Function
Sub FilterFile(filename)
Dim lines, filter, file
Set file = FSO.OpenTextFile(filename, 1)
If Not file.AtEndOfStream Then
lines = file.ReadAll
End If
file.Close
Set filter = New RegExp
filter.Global = True
filter.Multiline = True
filter.Pattern = "0x(\(nil\)|0+)(x0)?"
lines = filter.Replace(lines, "0x00000000")
filter.Pattern = "^dbg: \[script\]"
lines = filter.Replace(lines, "")
filter.Pattern = "^ "
lines = filter.Replace(lines, "ERROR: ")
filter.Pattern = "ERROR: \[1\] \[P\] "
lines = filter.Replace(lines, "")
filter.Pattern = "^dbg: .*\r\n"
lines = filter.Replace(lines, "")
Set file = FSO.OpenTextFile(filename, 2)
file.Write lines
file.Close
End Sub
Function CompareFiles(filename1, filename2)
Dim file, lines1, lines2
Set file = FSO.OpenTextFile(filename1, 1)
If Not file.AtEndOfStream Then
lines1 = file.ReadAll
End IF
file.Close
Set file = FSO.OpenTextFile(filename2, 1)
If Not file.AtEndOfStream Then
lines2 = file.ReadAll
End IF
file.Close
CompareFiles = (lines1 = lines2)
End Function
Function RunTest(test, params, ret)
Dim WshShell, oExec, sav, command
Set WshShell = CreateObject("WScript.Shell")
' Make sure that only one info.nut is present for each test run. Otherwise openttd gets confused.
FSO.CopyFile "ai/regression/regression_info.nut", test & "/info.nut"
sav = test & "/test.sav"
If Not FSO.FileExists(sav) Then
sav = "ai/regression/empty.sav"
End If
command = ".\openttd -x -c ai/regression/regression.cfg " & params & " -g " & sav & " -d script=2 -d misc=9"
' 2>&1 must be after >tmp.regression, else stderr is not redirected to the file
WshShell.Run "cmd /c " & command & " >"& test & "/tmp.regression 2>&1", 0, True
FilterFile test & "/tmp.regression"
If CompareFiles(test & "/result.txt", test & "/tmp.regression") Then
RunTest = "passed!"
Else
RunTest = "failed!"
ret = 1
End If
FSO.DeleteFile test & "/info.nut"
If WScript.Arguments.Count > 0 Then
If WScript.Arguments.Item(0) = "-k" Then
Exit Function
End If
End If
FSO.DeleteFile test & "/tmp.regression"
End Function
On Error Resume Next
WScript.StdOut.WriteLine ""
If Err.Number <> 0 Then
WScript.Echo "This script must be started with cscript."
WScript.Quit 1
End If
On Error Goto 0
If Not FSO.FileExists("ai/regression/run.vbs") Then
WScript.Echo "Make sure you are in the root of OpenTTD before starting this script."
WScript.Quit 1
End If
If FSO.FileExists("scripts/game_start.scr") Then
FSO.MoveFile "scripts/game_start.scr", "scripts/game_start.scr.regression"
End If
Dim params, test, ret
params = GetParams()
ret = 0
For Each test in GetTestList()
WScript.StdOut.Write "Running " & test & "... "
WScript.StdOut.WriteLine RunTest(test, params, ret)
Next
If FSO.FileExists("scripts/game_start.scr.regression") Then
FSO.MoveFile "scripts/game_start.scr.regression", "scripts/game_start.scr"
End If
WScript.Quit ret

View File

@@ -1,216 +0,0 @@
/* $Id$ */
class Regression extends AIController {
function Start();
};
function Regression::StationList()
{
local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
print("");
print("--StationList--");
print(" Count(): " + list.Count());
list.Valuate(AIStation.GetLocation);
print(" Location ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 0);
print(" CargoWaiting(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 1);
print(" CargoWaiting(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_Cargo()
{
print("");
print("--StationList_Cargo--");
for (local mode = AIStationList_Cargo.CM_WAITING; mode <= AIStationList_Cargo.CM_PLANNED; ++mode) {
print(" " + mode);
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA ; ++selector) {
print(" " + selector);
local list = AIStationList_Cargo(mode, selector, 6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
}
};
function Regression::StationList_CargoPlanned()
{
print("");
print("--StationList_CargoPlanned--");
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
print(" " + selector);
local list = AIStationList_CargoPlanned(selector, 6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
};
function Regression::StationList_CargoPlannedByFrom()
{
print("");
print("--StationList_CargoPlannedByFrom--");
local list = AIStationList_CargoPlannedByFrom(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoPlannedByVia()
{
print("");
print("--StationList_CargoPlannedByVia--");
local list = AIStationList_CargoPlannedByVia(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoPlannedViaByFrom()
{
print("");
print("--StationList_CargoPlannedViaByFrom--");
local list = AIStationList_CargoPlannedViaByFrom(6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoPlannedFromByVia()
{
print("");
print("--StationList_CargoPlannedFromByVia--");
local list = AIStationList_CargoPlannedFromByVia(6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaiting()
{
print("");
print("--StationList_CargoWaiting--");
for (local selector = AIStationList_Cargo.CS_BY_FROM; selector <= AIStationList_Cargo.CS_FROM_BY_VIA; ++selector) {
print(" " + selector);
local list = AIStationList_CargoWaiting(selector, 6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
};
function Regression::StationList_CargoWaitingByFrom()
{
print("");
print("--StationList_CargoWaitingByFrom--");
local list = AIStationList_CargoWaitingByFrom(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaitingByVia()
{
print("");
print("--StationList_CargoWaitingByVia--");
local list = AIStationList_CargoWaitingByVia(2, 0);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaitingViaByFrom()
{
print("");
print("--StationList_CargoWaitingViaByFrom--");
local list = AIStationList_CargoWaitingViaByFrom(6, 0, 7);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_CargoWaitingFromByVia()
{
print("");
print("--StationList_CargoWaitingFromByVia--");
local list = AIStationList_CargoWaitingFromByVia(2, 0, 2);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
};
function Regression::StationList_Vehicle()
{
local list = AIStationList_Vehicle(12);
print("");
print("--StationList_Vehicle--");
print(" Count(): " + list.Count());
list.Valuate(AIStation.GetLocation);
print(" Location ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 0);
print(" CargoWaiting(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoWaiting, 1);
print(" CargoWaiting(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetCargoRating, 1);
print(" CargoRating(1) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetDistanceManhattanToTile, 30000);
print(" DistanceManhattanToTile(30000) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.GetDistanceSquareToTile, 30000);
print(" DistanceSquareToTile(30000) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
list.Valuate(AIStation.IsWithinTownInfluence, 0);
print(" IsWithinTownInfluence(0) ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
}
}
function Regression::Start()
{
StationList();
StationList_Cargo();
StationList_CargoPlanned();
StationList_CargoPlannedByFrom();
StationList_CargoPlannedByVia();
StationList_CargoPlannedViaByFrom();
StationList_CargoPlannedFromByVia();
StationList_CargoWaiting();
StationList_CargoWaitingByFrom();
StationList_CargoWaitingByVia();
StationList_CargoWaitingViaByFrom();
StationList_CargoWaitingFromByVia();
StationList_Vehicle();
}

View File

@@ -1,127 +0,0 @@
--StationList--
Count(): 5
Location ListDump:
6 => 42341
2 => 41831
7 => 41825
5 => 33421
4 => 33411
CargoWaiting(0) ListDump:
7 => 6
6 => 6
2 => 3
5 => 0
4 => 0
CargoWaiting(1) ListDump:
7 => 0
6 => 0
5 => 0
4 => 0
2 => 0
--StationList_Cargo--
0
0
6 => 6
1
6 => 2
2
2 => 4
7 => 2
3
1
0
7 => 18
6 => 16
2 => 7
1
6 => 8
2 => 3
2
2 => 16
6 => 14
7 => 11
3
6 => 10
2 => 8
--StationList_CargoPlanned--
0
7 => 18
6 => 16
2 => 7
1
6 => 8
2 => 3
2
2 => 16
6 => 14
7 => 11
3
6 => 10
2 => 8
--StationList_CargoPlannedByFrom--
7 => 8
6 => 8
2 => 7
--StationList_CargoPlannedByVia--
2 => 16
6 => 7
--StationList_CargoPlannedViaByFrom--
6 => 8
2 => 3
--StationList_CargoPlannedFromByVia--
6 => 10
2 => 8
--StationList_CargoWaiting--
0
6 => 6
1
6 => 2
2
2 => 4
7 => 2
3
--StationList_CargoWaitingByFrom--
2 => 3
--StationList_CargoWaitingByVia--
6 => 3
--StationList_CargoWaitingViaByFrom--
6 => 2
--StationList_CargoWaitingFromByVia--
6 => 3
--StationList_Vehicle--
Count(): 2
Location ListDump:
5 => 33421
4 => 33411
CargoWaiting(0) ListDump:
5 => 0
4 => 0
CargoWaiting(1) ListDump:
5 => 0
4 => 0
CargoRating(1) ListDump:
5 => -1
4 => -1
DistanceManhattanToTile(30000) ListDump:
5 => 106
4 => 96
DistanceSquareToTile(30000) ListDump:
5 => 8818
4 => 7058
IsWithinTownInfluence(0) ListDump:
5 => 0
4 => 0
ERROR: The script died unexpectedly.

Binary file not shown.

Binary file not shown.

BIN
bin/data/openttdw.grf Normal file

Binary file not shown.

BIN
bin/data/opntitle.dat Normal file

Binary file not shown.

31
bin/data/orig_dos.obg Normal file
View File

@@ -0,0 +1,31 @@
; $Id$
;
; This represents the original graphics as on the non-German Transport
; Tycoon Deluxe DOS CD.
;
[metadata]
name = original_dos
shortname = TTDD
version = 1
description = Original Transport Tycoon Deluxe DOS edition graphics
palette = DOS
[files]
base = TRG1.GRF
logos = TRGI.GRF
arctic = TRGC.GRF
tropical = TRGH.GRF
toyland = TRGT.GRF
extra = OPENTTDD.GRF
[md5s]
TRG1.GRF = 9311676280e5b14077a8ee41c1b42192
TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = e30e8a398ae86c03dc534a8ac7dfb3b6
OPENTTDD.GRF = c886c7d5b38a93f2cb1cdc0d33472eb8
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
OPENTTDD.GRF = This file was part of your installation.

31
bin/data/orig_dos_de.obg Normal file
View File

@@ -0,0 +1,31 @@
; $Id$
;
; This represents the original graphics as on the German Transport
; Tycoon Deluxe DOS CD. It contains one broken sprite.
;
[metadata]
name = original_dos_de
shortname = TTDD
version = 0
description = Original Transport Tycoon Deluxe DOS (German) edition graphics
palette = DOS
[files]
base = TRG1.GRF
logos = TRGI.GRF
arctic = TRGC.GRF
tropical = TRGH.GRF
toyland = TRGT.GRF
extra = OPENTTDD.GRF
[md5s]
TRG1.GRF = 9311676280e5b14077a8ee41c1b42192
TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = fcde1d7e8a74197d72a62695884b909e
OPENTTDD.GRF = c886c7d5b38a93f2cb1cdc0d33472eb8
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
OPENTTDD.GRF = This file was part of your installation.

31
bin/data/orig_win.obg Normal file
View File

@@ -0,0 +1,31 @@
; $Id$
;
; This represents the original graphics as on the Transport
; Tycoon Deluxe for Windows.
;
[metadata]
name = original_windows
shortname = TTDW
version = 0
description = Original Transport Tycoon Deluxe Windows edition graphics
palette = Windows
[files]
base = TRG1R.GRF
logos = TRGIR.GRF
arctic = TRGCR.GRF
tropical = TRGHR.GRF
toyland = TRGTR.GRF
extra = OPENTTDW.GRF
[md5s]
TRG1R.GRF = b04ce593d8c5016e07473a743d7d3358
TRGIR.GRF = 0c2484ff6be49fc63a83be6ab5c38f32
TRGCR.GRF = 3668f410c761a050b5e7095a2b14879b
TRGHR.GRF = 06bf2b7a31766f048baac2ebe43457b1
TRGTR.GRF = de53650517fe661ceaa3138c6edb0eb8
OPENTTDW.GRF = b6689105405fa3ea34cb8a5543633d29
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
OPENTTDW.GRF = This file was part of your installation.

View File

@@ -1,8 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/

View File

@@ -1,32 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.2 API compatibility in effect.");
GSTown._SetGrowthRate <- GSTown.SetGrowthRate;
GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
{
/* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown._SetGrowthRate(town_id, days_between_town_growth);
}
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}

View File

@@ -1,32 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.3 API compatibility in effect.");
GSTown._SetGrowthRate <- GSTown.SetGrowthRate;
GSTown.SetGrowthRate <- function(town_id, days_between_town_growth)
{
/* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */
if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL;
return GSTown._SetGrowthRate(town_id, days_between_town_growth);
}
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}

View File

@@ -1,24 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.4 API compatibility in effect.");
/* 1.5 adds a game element reference to the news. */
GSNews._Create <- GSNews.Create;
GSNews.Create <- function(type, text, company)
{
return GSNews._Create(type, text, company, GSNews.NR_NONE, 0);
}
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}

View File

@@ -1,17 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.5 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}

View File

@@ -1,17 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.6 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}

View File

@@ -1,17 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.7 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}

View File

@@ -1,17 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.8 API compatibility in effect.");
/* 1.9 adds a vehicle type parameter. */
GSBridge._GetName <- GSBridge.GetName;
GSBridge.GetName <- function(bridge_id)
{
return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL);
}

View File

@@ -1,10 +0,0 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
GSLog.Info("1.9 API compatibility in effect.");

File diff suppressed because it is too large Load Diff

2540
config.lib

File diff suppressed because it is too large Load Diff

82
configure vendored
View File

@@ -1,20 +1,5 @@
#!/bin/sh
# $Id$
# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
check_path_characters() {
if [ -n "`echo $ROOT_DIR | grep '[^-_A-Za-z0-9\/\\\.:]'`" ]; then
echo "WARNING: The path contains a non-alphanumeric character that might cause"
echo " failures in subsequent build stages. Any failures with the build"
echo " will most likely be caused by this."
fi
}
CONFIGURE_EXECUTABLE="$_"
# On *nix systems those two are equal when ./configure is done
if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
@@ -29,16 +14,9 @@ if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
fi
# Find out where configure is (in what dir)
ROOT_DIR="`dirname $0`"
# For MSYS/MinGW we want to know the FULL path. This as that path is generated
# once you call an outside binary. Having the same path for the rest is needed
# for dependency checking.
# pwd -W returns said FULL path, but doesn't exist on others so fall back.
ROOT_DIR="`cd $ROOT_DIR && (pwd -W 2>/dev/null || pwd 2>/dev/null)`"
ROOT_DIR="`cd $ROOT_DIR && pwd`"
check_path_characters
# Same here as for the ROOT_DIR above
PWD="`pwd -W 2>/dev/null || pwd 2>/dev/null`"
PWD="`pwd`"
PREFIX="$PWD/bin"
. $ROOT_DIR/config.lib
@@ -47,8 +25,6 @@ PREFIX="$PWD/bin"
OBJS_DIR="$PWD/objs"
BASE_SRC_OBJS_DIR="$OBJS_DIR"
LANG_OBJS_DIR="$OBJS_DIR/lang"
GRF_OBJS_DIR="$OBJS_DIR/extra_grf"
SETTING_OBJS_DIR="$OBJS_DIR/setting"
BIN_DIR="$PREFIX"
SRC_DIR="$ROOT_DIR/src"
LANG_DIR="$SRC_DIR/lang"
@@ -61,11 +37,10 @@ if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
exit 1
fi
# Make sure we don't lock config.cache
cat config.cache | sed 's@\\ @\\\\ @g' > cache.tmp
cat config.cache | sed 's~\\ ~\\\\ ~g' > cache.tmp
sh cache.tmp
RET=$?
rm -f cache.tmp
exit $RET
exit $?
fi
set_default
@@ -75,17 +50,16 @@ save_params
make_cflags_and_ldflags
EXE=""
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "OS2" ] || [ "$os" = "DOS" ] || [ "$os" = "WINCE" ]; then
EXE=".exe"
fi
TTD="openttd$EXE"
STRGEN="strgen$EXE"
DEPEND="depend$EXE"
SETTINGSGEN="settings_gen$EXE"
ENDIAN_CHECK="endian_check$EXE"
if [ -z "$sort" ]; then
PIPE_SORT="sed s@a@a@"
PIPE_SORT="sed s~a~a~"
else
PIPE_SORT="$sort"
fi
@@ -96,7 +70,7 @@ if [ ! -f "$LANG_DIR/english.txt" ]; then
fi
# Read the source.list and process it
AWKCOMMAND='
SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk '
{ }
/^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; }
/^( *)#else/ { if (deep == skip) { skip -= 1; } else if (deep - 1 == skip) { skip += 1; } next; }
@@ -110,22 +84,22 @@ AWKCOMMAND='
if ($0 == "ALLEGRO" && "'$allegro_config'" == "") { next; }
if ($0 == "SDL" && "'$sdl_config'" == "") { next; }
if ($0 == "SDL2" && "'$sdl2_config'" == "") { next; }
if ($0 == "PNG" && "'$png_config'" == "") { next; }
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }
if ($0 == "HAIKU" && "'$os'" != "HAIKU") { next; }
if ($0 == "DOS" && "'$os'" != "DOS") { next; }
if ($0 == "BEOS" && "'$os'" != "BEOS") { next; }
if ($0 == "WIN32" && "'$os'" != "MINGW" &&
"'$os'" != "CYGWIN" && "'$os'" != "MSVC") { next; }
"'$os'" != "CYGWIN" && "'$os'" != "MSVC" ) { next; }
if ($0 == "MORPHOS" && "'$os'" != "MORPHOS") { next; }
if ($0 == "WINCE" && "'$os'" != "WINCE") { next; }
if ($0 == "MSVC" && "'$os'" != "MSVC") { next; }
if ($0 == "DIRECTMUSIC" && "'$with_direct_music'" == "0") { next; }
if ($0 == "FLUIDSYNTH" && "'$fluidsynth'" == "" ) { next; }
if ($0 == "USE_XAUDIO2" && "'$with_xaudio2'" == "0") { next; }
if ($0 == "USE_THREADS" && "'$with_threads'" == "0") { next; }
if ($0 == "USE_SSE" && "'$with_sse'" != "1") { next; }
if ($0 == "LIBTIMIDITY" && "'$libtimidity'" == "" ) { next; }
if ($0 == "HAVE_THREAD" && "'$with_threads'" == "0") { next; }
skip += 1;
@@ -141,31 +115,23 @@ AWKCOMMAND='
print $0;
}
}
'
' | $PIPE_SORT`"
# Read the source.list and process it
# Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations
SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk \"$AWKCOMMAND\" | LC_ALL=C $PIPE_SORT`"
OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.c$/ { gsub(\".c$\", \".o\", $0); print $0; }'`"
OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.cpp$/ { gsub(\".cpp$\", \".o\", $0); print $0; }'`"
OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.mm$/ { gsub(\".mm$\", \".o\", $0); print $0; }'`"
OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.rc$/ { gsub(\".rc$\", \".o\", $0); print $0; }'`"
SRCS="` echo \"$SRCS\" | $awk ' { ORS = \" \" } { print $0; }'`"
OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.c$/ { gsub(".c$", ".o", $0); print $0; }'`"
OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = " " } /\.cpp$/ { gsub(".cpp$", ".o", $0); print $0; }'`"
OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.mm$/ { gsub(".mm$", ".o", $0); print $0; }'`"
OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.rc$/ { gsub(".rc$", ".o", $0); print $0; }'`"
SRCS="` echo \"$SRCS\" | $awk ' { ORS = " " } { print $0; }'`"
# In makefiles, we always use -u for sort
if [ -z "$sort" ]; then
sort="sed s@a@a@"
sort="sed s~a~a~"
else
sort="$sort -u"
fi
CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in $ROOT_DIR/Makefile.grf.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in $ROOT_DIR/Makefile.bundle.in $ROOT_DIR/Makefile.setting.in"
CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in $ROOT_DIR/Makefile.bundle.in"
generate_main
generate_lang
generate_settings
generate_grf
generate_src
check_path_characters

36
docs/32bpp.txt Normal file
View File

@@ -0,0 +1,36 @@
32bpp and OpenTTD
=================
OpenTTD has 32bpp support. This means: OpenTTD still is 8bpp, but it has the
posibility to override the graphics with 32bpp. This means that it isn't a
replacement of grf or newgrf, but simply an addition. If you want to use 32bpp
graphics of a newgrf, you do need the newgrf itself too (with 8bpp graphics).
The Format
----------
32bpp images are stored in PNG. They should go in:
data/sprites/<grfname>/<SpriteID>.png
For example, a grfname would be 'openttd' (without .grf, lowercase), and the
SpriteID 3, to override the 3rd sprite in openttd.grf with a 32bpp version.
The format of this PNG can be almost anything, but we advise to use RGBA
format. Alpha-channel is fully supported.
As the core of OpenTTD is 8bpp, and because you of course want company colours
in your images, you will need to add a mask for every sprite that needs colour
remapping. The name is simular as above, only you have to put a 'm' behind the
SpriteID. This image should be a 8bpp palette image, where the palette is the
OpenTTD palette. Upon load of the PNG, the mask is loaded too, and overrides
the RGB (not the Alpha) of the original PNG image, and replacing it with a
8bpp color remapped and converted to 32bpp.
An other thing that OpenTTD needs in your png, is 2 tEXt chunks: x_offs and
y_offs. This to define the x- and y-offset, of course. Use the tool we supply
to add this information. Sadly enough most graphical editors trashes those
chunks upon save, so you have to readd it every time you save your image.
Your images should be the same as the grf, in size.

View File

@@ -0,0 +1,60 @@
STRGEN USAGE
------------
This guide is only interesting for people who want to alter something
themselves without access to WT2 (translator2.openttd.org). Please note that
your compiled language file will only be compatible with the OpenTTD version
you have downloaded english.txt, the master language file, for. While this is
not always true, namely when changes in the code have not touched language
files, your safest bet is to assume this 'limitation'.
As a first step you need to compile strgen. This is as easy as typing
'make strgen'. You can download the precompile strgen from:
http://www.openttd.org/download-strgen
strgen takes as argument a txt file and translates it to a lng file, allowing
it to be used inside OpenTTD. strgen needs the master language file
english.txt to work. Below are some examples of strgen usage.
EXAMPLES
--------
Example 1:
if you are in the root of your working copy (svn code), you should type
strgen/strgen -s lang lang/english.txt
to compile englist.txt into english.lng. It will be placed in the lang dir
Example 2:
you only have the strgen executable (no working copy) and you want to compile
a txt file in the same directory. You should type
./strgen english.txt
and you will get and english.lng in the same dir
Example 3:
you have strgen somewhere, english.txt in /usr/openttd/lang and you want the
resulting language file to go to /tmp. Use
./strgen -s /usr/openttd/lang -d /tmp english.txt
You can interchange english.txt to whichever language you want to generate a
.lng file for.
STRGEN COMMAND SWITCHES
-----------------------
-v | --version
strgen will tell what svn revision it was last modified
-t | --todo
strgen will add <TODO> to any untranslated/missing strings and use the english
strings while compiling the language file
-w | --warning
strgen will print any missing strings or wrongly translated (bad format)
to standard error output(stderr)
-h | --help | -?
Print out a summarized help message explaining these switches
-s | --source_dir
strgen will search for the master file english.txt in the directory specified
by this switch instead of the current directory
-d | --dest_dir
strgen will put <language>.lng in the directory specified by this switch; if
no dest_dir is given, output is the same as source_dir

100
docs/Manual.txt Normal file
View File

@@ -0,0 +1,100 @@
Welcome to the manual for OpenTTD. The latest release version at the time of writing is 0.3.2.
1 Obtaining OpenTTD.
You can obtain built binaries of OpenTTD for the 4 supported platforms - Win32, Linux,-x86, BeOS 5 and MacOS-X from the projects Sourceforge page, at http://sourceforge.net/projects/openttd . For the non-Win32 builds you will need libSDL.so, libpng.so and zlib.so compiled for your platform. Some builds will include these.
If you use another platform, such as FreeBSD, which has POSIX file i/o and an SDL port, you should be able to build OpenTTD from its source. This is available in the proejcts Subversion repository at svn://svn.openttd.com . The module name is "trunk".
1.1 Building OpenTTD.
Once you have obtained a recent copy of the source, you must build it. Windows build instructions will be provided later.
On UNIX platforms (including OS-X and BeOS), ensure you have a recent GCC (2.9 or above, or 3 and above).You will also need SDL development headers and libraries (libSDL 1.2 or higher). For PNG screenshot support and zlib compressed games, you will need libpng 1.0.12 or higher and zlib 1.2 or higher.
Most UNIX platforms:
First run ./configure, them use make or gmake to compile OpenTTD. You can configure the different compile options via ./configure.
BeOS:
On BeOS, run ./configure and then use jam. There are a variaty of options you can pass to your build tool, these are reported by ./configure.
1.2 Installing OpenTTD.
On Windows, insert your "Transport Tycoon Deluxe for Windows 95" disk. You can use a DOS version, but your graphics will be purple. NB: Even if your version of Transport Tycoon Deluxe ran on Windows 95, it may still be the DOS version. Then run the OpenTTD installer.
On UNIX platforms; decompress your OpenTTD archive, or otherwise run the installer. You should be left with an OpenTTD directory on your system. In this directory, make a subdirectory called 'data', and into this place the sample.cat file and all the .grf files from the install CD of 'Transport Tycoon Deluxe for Windows 95".
(Alternatively you can use the TTD GRF files from the DOS version: TRG1.GRF, TRGC.GRF, TRGH.GRF, TRGI.GRF, TRGT.GRF. A few minor graphical glitches with the DOS graphics remain. E.g. the autorail button in the rail toolbar doesn't look as nice as with the Windows graphics.)
If you want MIDI music, copy the 'gm' folder from the original game directory/CD to the OpenTTD folder.
1.3 Running OpenTTD.
On Windows, you can use a third-party launcher such as OTTD-Launcher to run OpenTTD directly from Explorer. Otherwise, navigate via the command prompt to the correct location and launch ttd.exe.
On Linux, navigate at the shell to the correct location and run ttd.
On BeOS and Mac OS-X, just double click the ttd binary in the Tracker/Finder. You can also start from the shell.
1.4 Configuring OpenTTD
OpenTTD's launch menu contains three configuration menus - Difficulty Settings, Configure Patches and Game Settings. Most of these menus can be configured from within a running game as well.
Difficulty Settings lets you configure settings that affect the difficulty of playing the game. These include when your (computer-controlled) competitors can start building, how many of them there are, and how intelligent they are. You can also control how much the subsidy mutliplier is for subsidised routes, and how stable/volitile the in-game economy is. You can also set how you want the terrain to be configured in a random game.
Game Settings lets you set regional settings - currency, language, town names, etc. It also lets you select the resolution to run the game at, as well as the screenshot format to use.
Configure Patches lets you select which patches to use in the game. This allows you to set the game play to either original Transport Tycoon Deluxe compatible mode or a mode more like playing under TTD-Patch. Patches include building on slopes, longer bridges, longer trains, pre-signals, and TTD-Patch compatible handling of non-stop orders.
2.1 Gameplay
This section of the manual is written with the assumption that you already know the gameplay basics of Transport Tycoon Deluxe, on either DOS or Windows. As you must have the Windows Transport Tycoon Deluxe CD to play OpenTTD, you should either have a paper manual or the complete manual in PDF format on the disk. This section will only cover the gameplay differences from Transport Tycoon Deluxe.
2.2 Station Construction
In OpenTTD, you can build rail stations up to seven squares long and with up to seven platforms. You can also have stations spreading across far larger distances, allowing a large rail station to be connected to a large airport, for instance.
However, there is an even more noticable difference in rail station construction. You may now add platforms and lenght to a station after it has been built, and you may also add platforms of a different type. Users of TTDPatch will be used to this behaviour. But beyond what TTDPatch has, you can make stations of uneven lenght/width, and even ones with perpendicular tracks. You can also delete single tiles or tracks from a station, by holding down Shift before pressing the station construction button.
2.3 Checkpoint Stations
Checkpoint stations (the small blue item in the rail construction window) are small 1x1 stations. They must be built on top of pre-existing track. They do not accept or produce carge of any kind. They exist solely for use as route points. They become useful when dealing with large networks where trains may attempt to route themselves along undesirable or impossible routes. As an alternative to checkpoint stations, you can also direct trains to visit depots along the way. This has the advantage of also servicing the train and hence the train will rarely to never need to depart from its route to be serviced.
2.4 Freeform Rail Laying.
Along side the other rail laying buttons, you will see a button that looks somewhat like a crossing. This is the freeform rail laying tool., and it allows you to drag rail in any direction to lay it. This has a number of advantages, one of the main ones being that it can seriously speed up the laying of diagonal tracks.
2.5 Vehicle Queuing (with Quantum Effects)
This useful addition to OpenTTD means that road vehicles will queue outside a road station to wait for a space rather than attempt to enter it immediately. As anyone who has operated a large road network with busy stations will know, road vehicles quickly pile up inside stations. This will prevent that. The Quantum Effects are down to a bug in the game that means that mutliple vehicles will often only take up one space in the queue. However, this is almost too useful to fix, and should still be there in later versions. This can be enabled/disabled.
2.6 Building On Slopes
This allows you to build roads, rails, stations and depots on slopes. It also allows the construction of trasmitters and lighthouses on slopes in the scenario editor. There are some minor differences between OpenTTD's and TTD-Patch's handling of building on slopes, the main one being that bridges must still have solid land at their endings.
2.7 Long Bridges
OpenTTD allows you to constuct bridges up to 127 squares - half the size of the current map. This means that the crossing of large estuaries, such at the Bristol Channel in the original "West Country 90210" scenario can be acheived with one bridge instead of many bridges with staging points.
2.8 Long trains
OpenTTD allows trains of around 60 cars length, hence allowing you to use 7 square stations to their capacity and beyond.
2.9 Speed Display
This addition to OpenTTD allows you to see the current speed of any vehicle in their status window. Just open the status window of a vehicle and you can see the speed at that given moment. This allows you to see wheter better bridges, flatter/straighter track or more powerful engines could be used to increase the speed of a vehicle
2.10 More Trains, More Ships, More Everything!
Virtually any settings - train numbers, start date, what vehicles your competitors can use, etc - can be set in OpenTTD. Just use the Configure Patches menu on the main screen.
2.11 Network Play
See multiplayer.txt for more info.
2.12 Rail Recycling.
This button, at the end of the train construction window, lets you 'recycle' track to a new type. It also works on bridges, tunnels, stations and depots.
2.13 Canal Building
This button, at the end of the water construction window, lets you build canals and shiplifts across the landscape. These act just like normal water.

View File

@@ -0,0 +1,23 @@
To install OpenTTD, you should drag the game to any location you want and in that folder, you should create a folder called "data". It should contain:
sample.cat
trg1r.grf
trgcr.grf
trghr.grf
trgir.grf
trgtr.grf
(Alternatively you can use the TTD GRF files from the DOS version: TRG1.GRF, TRGC.GRF, TRGH.GRF, TRGI.GRF, TRGT.GRF. A few minor graphical glitches with the DOS graphics remain. E.g. the autorail button in the rail toolbar doesn't look as nice as with the Windows graphics.)
You should also use the data folder to add any custom grf files if you like
if you want music, you can add a GM folder and add all .gm files from TTD inside it
If you want to use the scenarios, you can copy the scenario folder as well. If you already have one, just copy the content so you don't overwrite old ones that have been removed.
In the end, you should have a folder containing:
OpenTTD (the actual game)
data (containing the grf files)
GM (optional for music)
scenario (optional pregenerated maps)
The game adds some items by itself when it runs, like a save folder and a setting file

139
docs/Readme_OS2.txt Normal file
View File

@@ -0,0 +1,139 @@
OpenTTD: OS/2 version
=====================
OpenTTD has been ported to work on OS/2 4.x or later (including
eComStation). The game should work as well as it does on Windows
or other platforms: the main issues you may encounter are graphics
card problems, but that is really the fault of SDL.
=========================
USING OPENTTD FOR OS/2
=========================
LIBRARIES REQUIRED FOR END USERS
--------------------------------
SDL.DLL (SDL 1.2.7) and FSLib.dll are required to use this program:
these can be downloaded from the Files section at
http://sourceforge.net/projects/openttd/ - see "os2-useful-v1.1.zip".
Version 20051222 of SDL or later is required. This can be found at
http://sdl.netlabs.org/.
Please note that earlier SDL releases will probably NOT work with
OpenTTD. If you experience problems with OpenTTD, please check
your SDL and FSLib.dll versions (both must match).
Note that to actually play the game, I have found in my own
experience that a version of the Scitech Display Drivers or its later
incarnation (see www.scitech.com) are necessary for it to work. If
you have trouble with your native drivers, try the Scitech drivers
and see if they help the problem.
KNOWN ISSUES
------------
- If an error occurs during loading, the OS/2 error message window
is not always displayed.
A NOTE ABOUT MUSIC
------------------
OpenTTD includes a music driver which uses the MCI MIDI system. Unfortunately,
due to the lack of proper MIDI hardware myself, I have been unable to test it,
but during testing, I found that when MIDI was enabled, I got no sound
effects. I therefore decided to DISABLE music by default.
To enable music, start OpenTTD with the command line:
openttd -m os2
If I hear enough responses that both music and sound work together (it might
just be my system), I'll have the defaults changed.
Please note also that the GCC version does not currently support the MCI MIDI
system.
A NOTE ABOUT DEDICATED MULTIPLAYER SERVERS
------------------------------------------
To start a dedicated multiplayer server, you should run the dedicated.cmd
file. This enables OpenTTD to open up a VIO console window to display
its output and gather any necessary input. Running "openttd -D"
directly will result in the console not being displayed. You may
still pass any other parameters ('-D' is already passed) to
dedicated.cmd.
You can find the dedicated.cmd file in the os/os2 directory.
=========================
BUILDING THE OS/2 VERSION
=========================
Compiler
--------
Innotek GCC, an OS/2 port of the popular GCC compiler, was used to build OpenTTD.
See www.innotek.de for more information. You WILL need a reasonably UNIX-like
build environment in order to build OpenTTD successfully - the following link
may help to set one up (although some of the links from that page are broken):
http://www.mozilla.org/ports/os2/gccsetup.html
Alternatively, Paul Smedley's ready-to-go GCC build environment has been known to
successfully build the game:
http://www.smedley.info/os2ports/index.php?page=build-environment
To build, you should, if your environment is set up well enough, be able to just
type `./configure' (or `sh configure' if you're using the OS/2 shell) and `make'.
You may have to manually specify `--os OS2' on the configure command line, as
configure cannot always detect OS/2 correctly.
A note on Open Watcom
---------------------
Open Watcom C/C++ was previously used to build OpenTTD (version 0.4.x and earlier).
However, due to advanced C++ features used in the YAPF portion of OpenTTD 0.5
in particular, the compiler is no longer able to build the game at the moment.
Hopefully one day Open Watcom will be able to catch up and we will be able to build
the game once again (it's easier than getting an OS/2 UNIX-like environment set up
in my opinion!), but until then, OpenTTD 0.5 and later can only be built with GCC.
Libraries Required
------------------
The following libraries are required. To build zlib and libpng, I
simply added the required files (watch out for sample programs, etc)
to an IDE project file and built a library. Do not use the makefiles
provided, they are not designed for Watcom (apart from SDL):
- zlib
http://www.zlib.org/
- libpng
http://www.libpng.org/
- SDL for OS/2
ftp://ftp.netlabs.org/pub/sdl/sdl-1.2.7-src-20051222.zip used for
0.4.7
- Freetype
http://freetype.sourceforge.net/
Currently, there are no pre-built libraries available for GCC. If you manage to get
OpenTTD working on Watcom though (do let us know if this is the case!), pre-built
versions can be downloaded from the Files section at
http://sourceforge.net/projects/openttd/ - see "os2-useful-v1.1.zip".
Contact Information
-------------------
If you have any questions regarding OS/2 issues, please contact me
(owen@owenrudge.net) and I'll try to help you out. For general OpenTTD
issues, see the Contacting section of readme.txt.
Thanks to Paul Smedley for his help with getting OpenTTD to compile under GCC on OS/2.
- Owen Rudge, 24th June 2007

View File

@@ -0,0 +1,115 @@
Compiling OpenTTD using Microsoft Visual C++
January 2, 2007
--------------------------------------------
PLEASE READ THE ENTIRE DOCUMENT BEFORE DOING ANY ACTUAL CHANGES!!
SUPPORTED MSVC COMPILERS
------------------------
OpenTTD includes projects for MSVC 2005.NET and MSVC 2008.NET. Both will
compile out of the box, providing you have the required libraries/headers;
which ones, see below. There is no support for VS6 or MSVC 2002, or
MSVC 2003.NET. You are therefore strongly encouraged to either upgrade to
MSVC 2005 Express (free) or use GCC.
1) REQUIRED FILES
-----------------
You might already have some of the files already installed, so check before
downloading; mostly because the DirectX SDK and Platform SDK are about
500MB each.
Download the following files:
* openttd-useful.zip (http://binaries.openttd.org/extra/openttd-useful/)
* DirectX 8.1 SDK (http://neuron.tuke.sk/~mizanin/eng/Dx81sdk-include-lib.rar) (or alternatively the latest DirectX SDK from Microsoft)
* MS Windows Platform SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en)
* afxres.h (http://www-d0.fnal.gov/d0dist/dist/packages/d0ve/devel/windows/AFXRES.H)
...and of course the newest source from svn://svn.openttd.org/trunk
You need an SVN-client to download the source from subversion:
* CLI Subversion (http://subversion.tigris.org/)
* GUI TortoiseSVN (http://tortoisesvn.tigris.org/)
2) INCLUDES AND LIBRARIES
-------------------------
Put the newly downloaded files in the VC lib\ and include\ directories; where
"C:\Program Files\Microsoft Visual Studio 8\VC" is your location of Visual C.
If you are compiling for an x64 system, use the include\ and lib\ directories
from the win64/ folder.
* openttd-useful.zip\include\*
* afxresh.h
to > C:\Program Files\Microsoft Visual Studio 8\VC\Include
* openttd-useful.zip\lib\*
to > C:\Program Files\Microsoft Visual Studio 8\VC\Lib
Custom directories might be recommended, check 2.2)
2.1) INCLUDES AND LIBRARIES - DIRECTX/PLATFORM SDK
--------------------------------------------------
Basically the same procedure as with the useful zip file, providing
you are not using the Microsoft installer. Put the include files in the
include\ directory and the library files to the Lib\ directory.
It is recommended to use custom directories so you don't overwrite any
default header or library files.
2.2) CUSTOM DIRECTORIES
-----------------------
If you have put the above include and/or library files into custom folders,
MSVC will not find them by default. You need to add these paths to VC through:
Tools > Options > Projects and Solutions > VC++ Directories > show directories for
* Include files: Add the DirectX/Platform SDK include dir you've created
* Library files: Add the path to the SDK custom lib dir
NOTE: make sure that the directory for the DirectX SDK is the first one in the
list, above all others, otherwise compilation will most likely fail!!
3) TTD GRAPHICS FILES
---------------------
Copy the following files from Transport Tycoon Deluxe to the bin/data folder
* sample.cat
* trg1r.grf
* trgcr.grf
* trghr.grf
* trgir.grf
* trgtr.grf
4) COMPILING
------------
Open trunk/openttd_vs[89]0.sln
Set the build mode to 'Release' in
Build > Configuration manager > Active solution configuration > select "Release"
Compile...
If everything works well the binary should be in trunk/objs/Win[32|64]/Release/openttd.exe
5) EDITING, CHANGING SOURCE CODE
--------------------------------
Set the build mode (back to) 'Debug'
Change the startup project to openttd by right-clicking the 'openttd' project
in the Solution Explorer and selecting 'Set as Startup Project'. The 'openttd'
project should now show up bold instead of 'strgen'.
6) PROBLEMS?
------------
If compilation fails, double-check that you are using the latest SVN (!)
source. If it still doesn't work, check in on IRC (irc://irc.oftc.net/openttd),
to ask about reasons; or just wait. The problem will most likely solve itself
within a few days as the problem is noticed and fixed.
An up-to-date version of this README can be found on the wiki:
http://wiki.openttd.org/index.php/MicrosoftVisualCExpress

View File

@@ -1,235 +0,0 @@
# OpenTTD's admin network
Last updated: 2011-01-20
## Table of contents
- 1.0) [Preface](#10-preface)
- 2.0) [Joining the network](#20-joining-the-network)
- 3.0) [Asking for updates](#30-asking-for-updates)
- 3.1) [Polling manually](#31-polling-manually)
- 4.0) [Sending rcon commands](#40-sending-rcon-commands)
- 5.0) [Sending chat](#50-sending-chat)
- 5.1) [Receiving chat](#51-receiving-chat)
- 6.0) [Disconnecting](#60-disconnecting)
- 7.0) [Certain packet information](#70-certain-packet-information)
## 1.0) Preface
The admin network provides a dedicated network protocol designed for other
applications to communicate with OpenTTD. Connected applications can execute
console commands remotely (rcon commands) with no further authentication.
Furthermore information about clients and companies can be provided.
Admin applications remain connected when starting a new game or loading a saved
game in contrast to normal OpenTTD clients that get disconnected.
This document describes the admin network and its protocol.
Please refer to the mentioned enums in `src/network/core/tcp_admin.h`
Please also note that further improvements to the admin protocol can mean that
more packet types will be sent by the server. For forward compatibility it is
therefore wise to ignore unknown packets. Future improvements might also add
additional data to packets. This data should be ignored. Data will never be
removed from packets in later versions, except the possibility that complete
packets are dropped in favour of a new packet.
This though will be reflected in the protocol version as announced in the
`ADMIN_PACKET_SERVER_PROTOCOL` in section 2.0).
A reference implementation in Java for a client connecting to the admin interface
can be found at: [http://dev.openttdcoop.org/projects/joan](http://dev.openttdcoop.org/projects/joan)
## 2.0) Joining the network
Create a TCP connection to the server on port 3977. The application is
expected to authenticate within 10 seconds.
To authenticate send a `ADMIN_PACKET_ADMIN_JOIN` packet.
The server will reply with `ADMIN_PACKET_SERVER_PROTOCOL` followed directly by
`ADMIN_PACKET_SERVER_WELCOME`.
`ADMIN_PACKET_SERVER_PROTOCOL` contains details about the protocol version.
It is the job of your application to check this number and decide whether
it will remain connected or not.
Furthermore, this packet holds details on every `AdminUpdateType` and the
supported `AdminFrequencyTypes` (bitwise representation).
`ADMIN_PACKET_SERVER_WELCOME` contains details on the server and the map,
e.g. if the server is dedicated, its NetworkLanguage, size of the Map, etc.
Once you have received `ADMIN_PACKET_SERVER_WELCOME` you are connected and
authorized to do your thing.
The server will not provide any game related updates unless you ask for them.
There are four packets the server will none the less send, if applicable:
- ADMIN_PACKET_SERVER_ERROR
- ADMIN_PACKET_SERVER_WELCOME
- ADMIN_PACKET_SERVER_NEWGAME
- ADMIN_PACKET_SERVER_SHUTDOWN
However, `ADMIN_PACKET_SERVER_WELCOME` only after a `ADMIN_PACKET_SERVER_NEWGAME`
## 3.0) Asking for updates
Asking for updates is done with `ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY`.
With this packet you define which update you wish to receive at which
frequency.
Note: not every update type supports every frequency. If in doubt, you can
verify against the data received in `ADMIN_PACKET_SERVER_PROTOCOL`.
The server will not confirm your registered update. However, asking for an
invalid `AdminUpdateType` or a not supported `AdminUpdateFrequency` you will be
disconnected from the server with `NETWORK_ERROR_ILLEGAL_PACKET`.
Additional debug information can be found with a debug level of `net=3`.
`ADMIN_UPDATE_DATE` results in the server sending:
- ADMIN_PACKET_SERVER_DATE
`ADMIN_UPDATE_CLIENT_INFO` results in the server sending:
- ADMIN_PACKET_SERVER_CLIENT_JOIN
- ADMIN_PACKET_SERVER_CLIENT_INFO
- ADMIN_PACKET_SERVER_CLIENT_UPDATE
- ADMIN_PACKET_SERVER_CLIENT_QUIT
- ADMIN_PACKET_SERVER_CLIENT_ERROR
`ADMIN_UPDATE_COMPANY_INFO` results in the server sending:
- ADMIN_PACKET_SERVER_COMPANY_NEW
- ADMIN_PACKET_SERVER_COMPANY_INFO
- ADMIN_PACKET_SERVER_COMPANY_UPDATE
- ADMIN_PACKET_SERVER_COMPANY_REMOVE
`ADMIN_UPDATE_COMPANY_ECONOMY` results in the server sending:
- ADMIN_PACKET_SERVER_COMPANY_ECONOMY
`ADMIN_UPDATE_COMPANY_STATS` results in the server sending:
- ADMIN_PACKET_SERVER_COMPANY_STATS
`ADMIN_UPDATE_CHAT` results in the server sending:
- ADMIN_PACKET_SERVER_CHAT
`ADMIN_UPDATE_CONSOLE` results in the server sending:
- ADMIN_PACKET_SERVER_CONSOLE
`ADMIN_UPDATE_CMD_LOGGING` results in the server sending:
- ADMIN_PACKET_SERVER_CMD_LOGGING
## 3.1) Polling manually
Certain `AdminUpdateTypes` can also be polled:
- ADMIN_UPDATE_DATE
- ADMIN_UPDATE_CLIENT_INFO
- ADMIN_UPDATE_COMPANY_INFO
- ADMIN_UPDATE_COMPANY_ECONOMY
- ADMIN_UPDATE_COMPANY_STATS
- ADMIN_UPDATE_CMD_NAMES
`ADMIN_UPDATE_CLIENT_INFO` and `ADMIN_UPDATE_COMPANY_INFO` accept an additional
parameter. This parameter is used to specify a certain client or company.
Setting this parameter to `UINT32_MAX (0xFFFFFFFF)` will tell the server you
want to receive updates for all clients or companies.
Not supported `AdminUpdateType` in the poll will result in the server
disconnecting the application with `NETWORK_ERROR_ILLEGAL_PACKET`.
Additional debug information can be found with a debug level of `net=3`.
## 4.0) Sending rcon commands
Rcon runs separate from the `ADMIN_UPDATE_CONSOLE` `AdminUpdateType`. Requesting
the execution of a remote console command is done with the packet
`ADMIN_PACKET_ADMIN_RCON`.
Note: No additional authentication is required for rcon commands.
The server will reply with one or more `ADMIN_PACKET_SERVER_RCON` packets.
Finally an `ADMIN_PACKET_ADMIN_RCON_END` packet will be sent. Applications
will not receive the answer twice if they have asked for the `AdminUpdateType`
`ADMIN_UPDATE_CONSOLE`, as the result is not printed on the servers console
(just like clients rcon commands).
Furthermore, sending a `say` command (or any similar command) will not
be sent back into the admin network.
Chat from the server itself will only be sent to the admin network when it
was not sent from the admin network.
Note that when content is queried or updated via rcon, the processing
happens asynchronously. But the `ADMIN_PACKET_ADMIN_RCON_END` packet is sent
already right after the content is requested as there's no immediate output.
Thus other packages and the output of content rcon command may be sent at
an arbitrary later time, mixing into the output of other console activity,
e.g. also of possible subsequent other rcon commands sent.
## 5.0) Sending chat
Sending a `ADMIN_PACKET_ADMIN_CHAT` results in chat originating from the server.
Currently four types of chat are supported:
- NETWORK_ACTION_CHAT
- NETWORK_ACTION_CHAT_CLIENT
- NETWORK_ACTION_CHAT_COMPANY
- NETWORK_ACTION_SERVER_MESSAGE
`NETWORK_ACTION_SERVER_MESSAGE` can be sent to a single client or company
using the respective `DestType` and ID.
This is a message prefixed with the 3 stars, e.g. `*** foo has joined the game`
## 5.1) Receiving chat
Register `ADMIN_UPDATE_CHAT` at `ADMIN_FREQUENCY_AUTOMATIC` to receive chat.
The application will be able to receive all chat the server can see.
The configuration option `network.server_admin_chat` specifies whether
private chat for to the server is distributed into the admin network.
## 6.0) Disconnecting
It is a kind thing to say good bye before leaving. Do this by sending the
`ADMIN_PACKET_ADMIN_QUIT` packet.
## 7.0) Certain packet information
All `ADMIN_PACKET_SERVER_*` packets have an enum value greater 100.
`ADMIN_PACKET_SERVER_WELCOME`
Either directly follows `ADMIN_PACKET_SERVER_PROTOCOL` or is sent
after a new game has been started or a map loaded, i.e. also
after ADMIN_PACKET_SERVER_NEWGAME.
`ADMIN_PACKET_SERVER_CLIENT_JOIN` and `ADMIN_PACKET_SERVER_COMPANY_NEW`
These packets directly follow their respective INFO packets. If you receive
a CLIENT_JOIN / COMPANY_NEW packet without having received the INFO packet
it may be a good idea to POLL for the specific ID.
`ADMIN_PACKET_SERVER_CMD_NAMES` and `ADMIN_PACKET_SERVER_CMD_LOGGING`
Data provided with these packets is not stable and will not be
treated as such. Do not rely on IDs or names to be constant
across different versions / revisions of OpenTTD.
Data provided in this packet is for logging purposes only.

View File

@@ -1,69 +0,0 @@
# How to compile lang files (OpenTTD and strgen)
Last updated: 2009-06-30
## strgen usage
This guide is only interesting for people who want to alter something
themselves without access to [translator.openttd.org](https://translator.openttd.org/).
Please note that your compiled language file will only be compatible with the OpenTTD version
you have downloaded `english.txt`, the master language file, for. While this is
not always true, namely when changes in the code have not touched language
files, your safest bet is to assume this 'limitation'.
As a first step you need to compile strgen. This is as easy as typing
`'make strgen'`. You can download the precompile strgen from:
[http://www.openttd.org/download-strgen](http://www.openttd.org/download-strgen)
strgen takes as argument a txt file and translates it to a lng file, allowing
it to be used inside OpenTTD. strgen needs the master language file
`english.txt` to work. Below are some examples of strgen usage.
## Examples
### Example 1
If you are in the root of your working copy (git repository), you should type
`./strgen/strgen -s lang lang/english.txt`
to compile `english.txt` into `english.lng`. It will be placed in the lang dir.
### Example 2
You only have the strgen executable (no working copy) and you want to compile
a txt file in the same directory. You should type
`./strgen english.txt`
and you will get and `english.lng` in the same dir.
### Example 3
You have strgen somewhere, `english.txt` in `/usr/openttd/lang` and you want the
resulting language file to go to /tmp. Use
`./strgen -s /usr/openttd/lang -d /tmp english.txt`
You can interchange `english.txt` to whichever language you want to generate a
.lng file for.
## strgen command switches
`-v | --version`
strgen will tell what git revision it was last modified
`-t | --todo`
strgen will add <TODO> to any untranslated/missing strings and use the english
strings while compiling the language file
`-w | --warning`
strgen will print any missing strings or wrongly translated (bad format)
to standard error output(stderr)
`-h | --help | -?`
Print out a summarized help message explaining these switches
`-s | --source_dir`
strgen will search for the master file english.txt in the directory specified
by this switch instead of the current directory
`-d | --dest_dir`
strgen will put <language>.lng in the directory specified by this switch; if
no dest_dir is given, output is the same as source_dir

View File

@@ -1,267 +0,0 @@
# Some explanations about Desyncs
Last updated: 2014-02-23
## Table of contents
- 1.0) Desync theory
- 1.1) [OpenTTD multiplayer architecture](#11-openttd-multiplayer-architecture)
- 1.2) [What is a Desync and how is it detected](#12-what-is-a-desync-and-how-is-it-detected)
- 1.3) [Typical causes of Desyncs](#13-typical-causes-of-desyncs)
- 2.0) What to do in case of a Desync
- 2.1) [Cache debugging](#21-cache-debugging)
- 2.2) [Desync recording](#22-desync-recording)
- 3.0) Evaluating the Desync records
- 3.1) [Replaying](#31-replaying)
- 3.2) [Evaluation of the replay](#32-evaluation-of-the-replay)
- 3.3) [Comparing savegames](#33-comparing-savegames)
## 1.1) OpenTTD multiplayer architecture
OpenTTD has a huge gamestate, which changes all of the time.
The savegame contains the complete gamestate at a specific point
in time. But this state changes completely each tick: Vehicles move
and trees grow.
However, most of these changes in the gamestate are deterministic:
Without a player interfering a vehicle follows its orders always
in the same way, and trees always grow the same.
In OpenTTD multiplayer synchronisation works by creating a savegame
when clients join, and then transferring that savegame to the client,
so it has the complete gamestate at a fixed point in time.
Afterwards clients only receive 'commands', that is: Stuff which is
not predictable, like
- player actions
- AI actions
- GameScript actions
- Admin Port command
- rcon commands
- ...
These commands contain the information on how to execute the command,
and when to execute it. Time is measured in 'network frames'.
Mind that network frames to not match ingame time. Network frames
also run while the game is paused, to give a defined behaviour to
stuff that is executing while the game is paused.
The deterministic part of the gamestate is run by the clients on
their own. All they get from the server is the instruction to
run the gamestate up to a certain network time, which basically
says that there are no commands scheduled in that time.
When a client (which includes the server itself) wants to execute
a command (i.e. a non-predictable action), it does this by
- calling DoCommandP resp. DoCommandPInternal
- These functions first do a local test-run of the command to
check simple preconditions. (Just to give the client an
immediate response without bothering the server and waiting for
the response.) The test-run may not actually change the
gamestate, all changes must be discarded.
- If the local test-run succeeds the command is sent to the server.
- The server inserts the command into the command queue, which
assigns a network frame to the commands, i.e. when it shall be
executed on all clients.
- Enhanced with this specific timestamp, the command is send to all
clients, which execute the command simultaneously in the same
network frame in the same order.
## 1.2) What is a Desync and how is it detected
In the ideal case all clients have the same gamestate as the server
and run in sync. That is, vehicle movement is the same on all
clients, and commands are executed the same everywhere and
have the same results.
When a Desync happens, it means that the gamestates on the clients
(including the server) are no longer the same. Just imagine
that a vehicle picks the left line instead of the right line at
a junction on one client.
The important thing here is, that no one notices when a Desync
occurs. The desync client will continue to simulate the gamestate
and execute commands from the server. Once the gamestate differs
it will increasingly spiral out of control: If a vehicle picks a
different route, it will arrive at a different time at a station,
which will load different cargo, which causes other vehicles to
load other stuff, which causes industries to notice different
servicing, which causes industries to change production, ...
the client could run all day in a different universe.
To limit how long a Desync can remain unnoticed, the server
transfers some checksums every now and then for the gamestate.
Currently this checksum is the state of the random number
generator of the game logic. A lot of things in OpenTTD depend
on the RNG, and if the gamestate differs, it is likely that the
RNG is called at different times, and the state differs when
checked.
The clients compare this 'checksum' with the checksum of their
own gamestate at the specific network frame. If they differ,
the client disconnects with a Desync error.
The important thing here is: The detection of the Desync is
only an ultimate failure detection. It does not give any
indication on when the Desync happened. The Desync may after
all have occurred long ago, and just did not affect the checksum
up to now. The checksum may have matched 10 times or more
since the Desync happened, and only now the Desync has spiraled
enough to finally affect the checksum. (There was once a desync
which was only noticed by the checksum after 20 game years.)
## 1.3) Typical causes of Desyncs
Desyncs can be caused by the following scenarios:
- The savegame does not describe the complete gamestate.
- Some information which affects the progression of the
gamestate is not saved in the savegame.
- Some information which affects the progression of the
gamestate is not loaded from the savegame.
This includes the case that something is not completely
reset before loading the savegame, so data from the
previous game is carried over to the new one.
- The gamestate does not behave deterministic.
- Cache mismatch: The game logic depends on some cached
values, which are not invalidated properly. This is
the usual case for NewGRF-specific Desyncs.
- Undefined behaviour: The game logic performs multiple
things in an undefined order or with an undefined
result. E.g. when sorting something with a key while
some keys are equal. Or some computation that depends
on the CPU architecture (32/64 bit, little/big endian).
- The gamestate is modified when it shall not be modified.
- The test-run of a command alters the gamestate.
- The gamestate is altered by a player or script without
using commands.
## 2.1) Cache debugging
Desyncs which are caused by improper cache validation can
often be found by enabling cache validation:
- Start OpenTTD with '-d desync=2'.
- This will enable validation of caches every tick.
That is, cached values are recomputed every tick and compared
to the cached value.
- Differences are logged to 'commands-out.log' in the autosave
folder.
Mind that this type of debugging can also be done in singleplayer.
## 2.2) Desync recording
If you have a server, which happens to encounter Desyncs often,
you can enable recording of the gamestate alterations. This
will later allow the replay the gamestate and locate the Desync
cause.
There are two levels of Desync recording, which are enabled
via '-d desync=2' resp. '-d desync=3'. Both will record all
commands to a file 'commands-out.log' in the autosave folder.
If you have the savegame from the start of the server, and
this command log you can replay the whole game. (see Section 3.1)
If you do not start the server from a savegame, there will
also be a savegame created just after a map has been generated.
The savegame will be named 'dmp_cmds_*.sav' and be put into
the autosave folder.
In addition to that '-d desync=3' also creates regular savegames
at defined spots in network time. (more defined than regular
autosaves). These will be created in the autosave folder
and will also be named 'dmp_cmds_*.sav'.
These saves allow comparing the gamestate with the original
gamestate during replaying, and thus greatly help debugging.
However, they also take a lot of disk space.
## 3.1) Replaying
To replay a Desync recording, you need these files:
- The savegame from when the server was started, resp.
the automatically created savegame from when the map
was generated.
- The 'commands-out.log' file.
- Optionally the 'dmp_cmds_*.sav'.
Put these files into a safe spot. (Not your autosave folder!)
Next, prepare your OpenTTD for replaying:
- Get the same version of OpenTTD as the original server was running.
- Uncomment/enable the define 'DEBUG_DUMP_COMMANDS' in
'src/network/network_func.h'.
(DEBUG_FAILED_DUMP_COMMANDS is explained later)
- Put the 'commands-out.log' into the root save folder, and rename
it to 'commands.log'.
- Run 'openttd -D -d desync=3 -g startsavegame.sav'.
This replays the server log and creates new 'commands-out.log'
and 'dmp_cmds_*.sav' in your autosave folder.
## 3.2) Evaluation of the replay
The replaying will also compare the checksums which are part of
the 'commands-out.log' with the replayed gamestate.
If they differ, it will trigger a 'NOT_REACHED'.
If the replay succeeds without mismatch, that is the replay reproduces
the original server state:
- Repeat the replay starting from incrementally later 'dmp_cmds_*.sav'
while truncating the 'commands.log' at the beginning appropriately.
The 'dmp_cmds_*.sav' can be your own ones from the first reply, or
the ones from the original server (if you have them).
(This simulates the view of joining clients during the game.)
- If one of those replays fails, you have located the Desync between
the last dmp_cmds that reproduces the replay and the first one
that fails.
If the replay does not succeed without mismatch, you can check the logs
whether there were failed commands. Then you may try to replay with
DEBUG_FAILED_DUMP_COMMANDS enabled. If the replay then fails, the
command test-run of the failed command modified the game state.
If you have the original 'dmp_cmds_*.sav', you can also compare those
savegames with your own ones from the replay. You can also comment/disable
the 'NOT_REACHED' mentioned above, to get another 'dmp_cmds_*.sav' from
the replay after the mismatch has already been detected.
See Section 3.2 on how to compare savegames.
If the saves differ you have located the Desync between the last dmp_cmds
that match and the first one that does not. The difference of the saves
may point you in the direction of what causes it.
If the replay succeeds without mismatch, and you do not have any
'dmp_cmd_*.sav' from the original server, it is a lost case.
Enable creation of the 'dmp_cmd_*.sav' on the server, and wait for the
next Desync.
Finally, you can also compare the 'commands-out.log' from the original
server with the one from the replay. They will differ in stuff like
dates, and the original log will contain the chat, but otherwise they
should match.
## 3.3) Comparing savegames
The binary form of the savegames from the original server and from
your replay will always differ:
- The savegame contains paths to used NewGRF files.
- The gamelog will log your loading of the savegame.
- The savegame data of AIs and the Gamescript will differ.
Scripts are not run during the replay, only their recorded commands
are replayed. Their internal state will thus not change in the
replay and will differ.
To compare savegame more semantically, there exist some ugly hackish
tools at:
http://devs.openttd.org/~frosch/texts/zpipe.c
http://devs.openttd.org/~frosch/texts/printhunk.c
The first one decompresses OpenTTD savegames. The second one creates
a textual representation of an uncompressed savegame, by parsing hunks
and arrays and such. With both tools you need to be a bit careful
since they work on stdin and stdout, which may not deal well with
binary data.
If you have the textual representation of the savegames, you can
compare them with regular diff tools.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -4,137 +4,71 @@
<head>
<meta name="Author" content="Marcin Grzegorczyk">
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>OpenTTD Landscape Internals</title>
</head>
<body>
<h3><a name="Landscape">Landscape</a></h3>
<p>Seven attributes (counting &quot;<span style="font-weight: bold;">type_height</span>&quot;) hold the informations about a tile.<BR>
These attributes are referred to as
"<span style="font-weight: bold;">type_height</span>",
"<span style="font-weight: bold;">m1</span>", "<span style="font-weight: bold;">m2</span>",
"<span style="font-weight: bold;">m3</span>", "<span style="font-weight: bold;">m4</span>",
"<span style="font-weight: bold;">m5</span>" and "<span style="font-weight: bold;">m6</span>".<BR>
The most important value is the class of a tile, stored in the upper 4 bits
of the <span style="font-weight: bold;">type_height</span> attribute. The lower 4 bits are used to encode the height and
slope data.
</p>
Special Attribute : <span style="font-weight: bold;">m6</span>. There are 4 bits of it that are used accross multiple tile classes<br>
<ul>
<li>
<a name = "bridge_direction">
Bits 7..6 :
<table border="1">
<tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above,<br>for tiles that support this.</td></tr>
<tr><td><tt>00</tt>&nbsp; </td><td>no bridge</td></tr>
<tr><td><tt>01</tt>&nbsp; </td><td>Axis X (North-East)</td></tr>
<tr><td><tt>02</tt>&nbsp; </td><td>Axis Y (South-West)</td></tr>
</table>
</li>
<li>
<a name = "tropic_zone">
Bits 1..0 :
<table border="1">
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningfull in tropic climate.<br>It contains the definition of the available zones</td></tr>
<tr><td><tt>00</tt>&nbsp; </td><td>normal</td></tr>
<tr><td><tt>01</tt>&nbsp; </td><td>desert</td></tr>
<tr><td><tt>02</tt>&nbsp; </td><td>rain forest</td></tr>
</table>
In any other climate, those 2 bits are free of use.
</li>
</ul>
<p>
For a graphical representation of the tile-layout have a look at
<a href="landscape_grid.html">Landscape grid</a> page.
</p>
<p>Nine attributes (counting &quot;<span style="font-weight: bold;">type</span>&quot; and
&quot;<span style="font-weight: bold;">height</span>&quot;) hold the information about a tile.<BR>
These attributes are referred to as
&quot;<span style="font-weight: bold;">type</span>",
&quot;<span style="font-weight: bold;">height</span>",
&quot;<span style="font-weight: bold;">m1</span>&quot;, &quot;<span style="font-weight: bold;">m2</span>&quot;,
&quot;<span style="font-weight: bold;">m3</span>&quot;, &quot;<span style="font-weight: bold;">m4</span>&quot;,
&quot;<span style="font-weight: bold;">m5</span>&quot;, &quot;<span style="font-weight: bold;">m6</span>&quot;
and "<span style="font-weight: bold;">m7</span>".<br>
The most important value is the class of a tile, stored in the upper 4 bits
of the <span style="font-weight: bold;">type</span> attribute.
</p>
Frequently repeating patterns:
<ul>
<li><span style="font-weight: bold;">type</span>
<ul>
<li>
<a name="type"></a>
Bits 7..4:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">The tile type.</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>Ground</td></tr>
<tr><td><tt>01</tt></td><td>Railway tracks</td></tr>
<tr><td><tt>02</tt></td><td>Roads</td></tr>
<tr><td><tt>03</tt></td><td>Town building</td></tr>
<tr><td><tt>04</tt></td><td>Trees</td></tr>
<tr><td><tt>05</tt></td><td>Station tiles</td></tr>
<tr><td><tt>06</tt></td><td>Water</td></tr>
<tr><td><tt>07</tt></td><td>Void</td></tr>
<tr><td><tt>08</tt></td><td>Industries</td></tr>
<tr><td><tt>09</tt></td><td>Tunnel / bridge</td></tr>
<tr><td><tt>0A</tt></td><td>Objects</td></tr>
</table>
</li>
Bits 3..2:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above.</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>no bridge</td></tr>
<tr><td><tt>01</tt></td><td>Axis X (North-East)</td></tr>
<tr><td><tt>02</tt></td><td>Axis Y (South-West)</td></tr>
</table>
<li>
<a name="tropic_zone"></a>
Bits 1..0:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningful in tropic climate. It contains the definition of the available zones</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>normal</td></tr>
<tr><td><tt>01</tt></td><td>desert</td></tr>
<tr><td><tt>02</tt></td><td>rain forest</td></tr>
</table>
In any other climate these 2 bits are theoretically free of use, however using them does not seem useful.
</li>
</ul>
<li><span style="font-weight: bold;">m1</span>
<ul>
<li>
<a name="WaterClass"></a>
Bits 6..5:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">The type of water that is on a tile.
<tr><td style="width: 5em;"><tt>00</tt></td><td align=left>Sea</td></tr>
<tr><td><tt>01</tt></td><td align=left>Canal</td></tr>
<tr><td><tt>02</tt></td><td align=left>River</td></tr>
<tr><td><tt>03</tt></td><td align=left>Invalid, i.e. no water on this tile</td></tr>
</table>
Some tiles, such as houses, reuse these bits of other purposes.
</li>
<li>
<a name="OwnershipInfo"></a>
Bits 4..0:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">The owner of a tile can be either companies (human or AI) or "Game entities".
<tr><td style="width: 5em;"><tt>00..0E</tt></td><td align=left>Normal companies</td></tr>
<tr><td><tt>0F</tt></td><td align=left>a town owns the tile</td></tr>
<tr><td><tt>10</tt></td><td align=left>nobody owns the tile</td></tr>
<tr><td><tt>11</tt></td><td align=left>"water" owns the tile</td></tr>
<tr><td><tt>FF</tt></td><td align=left>spectator in MP or in scenario editor</td></tr>
</table>
Some tiles, such as houses and industries, reuse these bits of other purposes.
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m4:</span><br>
<a name="RoadType"></a>
Road roadtype. Used for all tiles with road (road, station, tunnelbridge).
<ul>
<li>
Bits 5..0: Road roadtype, 0x3F for no road.
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m8:</span><br>
<a name="TramType"></a>
Tram roadtype. Used for all tiles with road (road, station, tunnelbridge).
<ul>
<li>
Bits 11..6: Tram roadtype, 0x3F for no tram.
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m8:</span><br>
<ul>
<li>
<a name="RailType"></a>
Bits 5..0: Railtype. Used for all tiles with rail (road, rail, station, tunnelbridge).
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m7:</span><br>
Animation frame/state. Used for houses, industries, objects and stations.
</li>
</ul>
The <a name="OwnershipInfo">owner of a tile</a>, as frequently associated with attribute m1,
can be either players (human or AI) or "Game entities".
They are identified using:
<table border="1">
<tr><td><tt>00</tt>&nbsp; </td><td align=left>current player</td></tr>
<tr><td><tt>01..08</tt>&nbsp; </td><td align=left>AI or network players</td></tr>
<tr><td><tt>0F</tt>&nbsp; </td><td align=left>a town owns the tile</td></tr>
<tr><td><tt>10</tt>&nbsp; </td><td align=left>nobody owns the tile</td></tr>
<tr><td><tt>11</tt>&nbsp; </td><td align=left>"water" owns the tile</td></tr>
<tr><td><tt>FF</tt>&nbsp; </td><td align=left>spectator in MP or in scenario editor</td></tr>
</table>
<p>OTTD's class-specific periodic tile processing routine is called once every +256 ticks for each tile.</p>
<table border=1 cellpadding=3>
<tr bgcolor="#0099FF">
<th align=left><font color="#FFFFFF">Class</font></th>
<th align=left><font color="#FFFFFF">Meaning &amp; details of encoding</font></th>
<th align=left><font color="#FFFFFF">Meaning & details of encoding</font></th>
</tr>
<tr bgcolor="#CCCCCC">
<td align=left><strong><a name="Class0"><tt> 0 </tt></a></strong></td>
@@ -144,11 +78,9 @@
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)</li>
<li>m1: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)</li>
<li>m2: see fields</li>
<li>m3 bits 7..5: type of hedge on NE border of the tile</li>
<li>m3 bits 3..0: see fields</li>
<li>m3 bit 4: set if the tile is covered with snow</li>
<li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
<li>m4 bits 4..2: same as 7..5, but for the SE border</li>
<li>m5 bits 7..5: update counter, incremented on every periodic processing for tile types,
@@ -236,7 +168,8 @@
</tr>
</table>
</li>
<li>m6 bits 4..2: type of hedge on NW border of the tile</li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul>
</td>
</tr>
@@ -249,11 +182,10 @@
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bit 7: Ship docking tile status (for half-tile with water)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile</li>
<li>m2: see signals</li>
<li>m1: <a href="#OwnershipInfo">owner</a> of the tile</li>
<li>m2: see waypoint and signals</li>
<li>m3 bits 7..4: see signals</li>
<li>m8 bits 5..0 = <a name="TrackType">track type</a>:
<li>m3 bits 3..0 = <a name="TrackType">track type</a>:
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
@@ -520,9 +452,27 @@
<li>m2 bit 11: opposite track is reserved, too</li>
</ul>
</li>
<li>m5 bit 7 set, bit 6 clear: checkpoint
<ul>
<li>m2: index into the array of waypoints.</li>
<li>m5 bit 0:
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
<td>in X direction</td>
</tr>
<tr>
<td><tt>1</tt>&nbsp; </td>
<td>in Y direction</td>
</tr>
</table>
</li>
<li>m5 bit 4: pbs reservation state</li>
</ul>
</li>
<li>m5 bit 7 set, bit 6 set: railway depot
<ul>
<li>m2: Depot index</li>
<li>m5 bits 1..0: exit towards
<table>
<tr>
@@ -549,6 +499,8 @@
<li>m5 bit 4: pbs reservation state</li>
</ul>
</li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul>
</td>
</tr>
@@ -562,10 +514,20 @@
<td>
<ul>
<li>m2: Index into the array of towns (owning town for town roads; closest town otherwise, INVALID_TOWN if there is no town or we are creating a town)</li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
<li>m4 bits 5..0: <a href="#RoadType">Roadtype</a></li>
<li>m7 bit 5 set = on snow or desert</li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m7 bits 7..6: present road types
<table>
<tr>
<td>bit 0&nbsp; </td>
<td>normal road</td>
</tr>
<tr>
<td>bit 1&nbsp; </td>
<td>tram</td>
</tr>
</table>
</li>
<li>m5 bits 7 clear: road or level-crossing
<ul>
<li>m6 bits 5..3:
@@ -600,9 +562,10 @@
</tr>
</table>
</li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
<li>m5 bit 6 clear: road
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
<li>m1: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
<li>m7 bits 3..0: counter for the roadworks</li>
<li>m5 bits 3..0: road layout road type 0 (normal road): bit set = road piece present:
<table>
@@ -641,9 +604,8 @@
</li>
<li>m5 bit 6 set: level crossing
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the railway track</li>
<li>m5 bit 5: set if crossing lights are on</li>
<li>m5 bit 4: pbs reservation state</li>
<li>m1: <a href="#OwnershipInfo">owner</a> of the railway track</li>
<li>m3 bits 3..0: <a href="#TrackType">railway track type</a></li>
<li>m5 bit 0: direction
<table>
<tr>
@@ -656,17 +618,17 @@
</tr>
</table>
</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
<li>m8 bits 5..0: <a href="#TrackType">railway track type</a></li>
<li>m5 bit 5: set if crossing lights are on</li>
<li>m6 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
<li>m5 bit 4: pbs reservation state</li>
</ul>
</li>
</ul>
</li>
<li>m5 bit 7 set, bit 6 clear: road depot
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the depot</li>
<li>m2: Depot index</li>
<li>m5 bits 1..0: exit towards:
<li>m1: <a href="#OwnershipInfo">owner</a> of the depot</li>
<li>m5 bits 3..0: exit towards:
<table>
<tr>
<td><tt>0</tt>&nbsp; </td>
@@ -689,9 +651,10 @@
</tr>
</table>
</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
</ul>
</li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul>
</td>
</tr>
@@ -722,7 +685,7 @@
</li>
</ul>
<li>m3 bit 6 : bit 8 of house type (m4), allowing 512 different types.</li>
<li>m3 bit 5 : free</li>
<li>m3 bit 5 : bit 6 of current animation frame (see m6)</li>
<li>m3 bits 4..0 : triggers activated <a href="#newhouses">(newhouses)</a></li>
<li>m4 : <a href="landscape_externals.html">town building type</a> (with m3[6] bit)</li>
<li>m5 : see m3 bit 7</li>
@@ -730,7 +693,7 @@
<ul>
<li>If <a href="#newhouses">newhouses</a> is activated
<ul>
<li>bits 7..2 : Periodic processing time remaining</li>
<li>bits 7..2 : Current animation frame (bits 5..0); bit 6 in m3</li>
</ul>
</li>
<li>Standard behaviour
@@ -738,13 +701,14 @@
<li>bits 7..2 : lift position (for houses type 04 and 05)</li>
</ul>
</li>
<li>bits 1..0 : tropic zone specifier</li>
</ul>
</li>
<li>m7 :
<ul>
<li>If <a href="#newhouses">newhouses</a> is activated
<ul>
<li>Current animation frame</li>
<li>Periodic processing time remaining</li>
</ul>
</li>
<li>Standard behaviour (only for houses type 04 and 05)
@@ -760,7 +724,7 @@
</ul>
</li>
</ul>
<small><a name="newhouses"></a>Newhouses is the name englobing a newGRF feature developed by TTDPatch devs (mainly Csaboka).<br>
<small><a name="newhouses">Newhouses is the name englobing a newGRF feature developped by TTDPatch devs (mainly Csaboka).<br>
It allows the replacement of the properties as well as the graphics of houses in the game.<br>
To distinguish between the standard behaviour and the newGRF one, HouseID (m4 + m3[6]) is tested for anything above 110.<br>
110 is the count of standard houses. So above 110 means there is a new definition of at least one house</small>
@@ -775,9 +739,9 @@
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bits 6..5: water class (sea or land)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
<li>m2 bits 8..6: ground
<li>m1: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
<li>m2 bits 7..6: ground density
<li>m2 bits 5..4: ground
<table>
<tr>
@@ -799,14 +763,8 @@
<td align=left><tt>3</tt>&nbsp; </td>
<td>on shore (density must be 3)</td>
</tr>
<tr>
<td align=left><tt>4</tt>&nbsp; </td>
<td>on snow with rough land underneed</td>
</tr>
</table>
</li>
<li>m2 bits 5..4: ground density</li>
<li>m2 bits 3..0: update counter, incremented on every periodic processing.<br>
on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
<li>m3 bits 7..0: type of trees:
@@ -843,6 +801,8 @@
</table>
<small>Note: the actually displayed set of trees depends on both type and number of trees</small>
</li>
<li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
<li>m4 bits 4..2: type of hedge on the SE border of the tile (1 through 6, or 0=none)</li>
<li>m5 bits 7..6: number of trees minus one</li>
<li>m5 bits 2..0: growth status:
<table border="0">
@@ -860,6 +820,7 @@
</tr>
</table>
</li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul>
</td>
</tr>
@@ -872,14 +833,13 @@
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bit 7: Ship docking tile status (for buoys)</li>
<li>m1 bits 6..5: water class for buoys, water part of docks and for airport tiles</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the station</li>
<li>m1: <a href="#OwnershipInfo">owner</a> of the station</li>
<li>m2: index into the array of stations</li>
<li>m3 bits 7..4: persistent random data for railway stations/waypoints and airports)</li>
<li>m3 bits 7..4: persistent random data for newstations (train station)</li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram tracks (road stop)</li>
<li>m3 bits 3..0: <a href="#TrackType">track type</a> for railway stations</li>
<li>m3 bits 1..0: water class for buoys and water part of docks</li>
<li>m4: custom station id; 0 means standard graphics</li>
<li>m4: <a href="#RoadType">Roadtype</a> for road stops</li>
<li>m5: graphics index (range from 0..255 for each station type):
<table>
<tr>
@@ -906,29 +866,13 @@
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>01</tt></td>
<td align=left>waypoints
<table>
<tr>
<td><tt>00</tt>&nbsp; </td>
<td align=left>in X direction</td>
</tr>
<tr>
<td><tt>01</tt>&nbsp; </td>
<td align=left>in Y direction</td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>FF</tt></td>
<td nowrap valign=top><tt>00</tt>..<tt>8F</tt></td>
<td align=left>all airports</td>
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>05</tt>&nbsp; </td>
<td align=left>road stops
<td align=left>road stops:
<table>
<tr>
<td><tt>00</tt>&nbsp; </td>
@@ -991,13 +935,13 @@
</tr>
</table>
</li>
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy)</li>
<li>m6 bit 2: pbs reservation state for railway stations</li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
<li>m7: animation frame (railway stations/waypoints, airports)</li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway stations/waypoints</li>
<li>m7 bits 7..6: present road types (road stops)</li>
<li>m7: animation frame (train station)</li>
</ul>
</td>
</tr>
@@ -1010,10 +954,8 @@
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bit 7: Ship docking tile status</li>
<li>m1 bits 6..5 : Water class (sea, canal or river)
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (for sea, rivers, and coasts normally <tt>11</tt>)</li>
<li>m2: Depot index (for depots only)</li>
<li>m1: <a href="#OwnershipInfo">owner</a> (for sea, rivers, and coasts normally <tt>11</tt>)</li>
<li>m3 bits 1..0 : Water class (sea, canal or river)
<li>m4: Random data for canal or river tiles</li>
<li>m5: tile type:
<table>
@@ -1108,6 +1050,8 @@
</tr>
</table>
</li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul>
</td>
</tr>
@@ -1125,7 +1069,7 @@
<tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="Class8"><tt> 8</tt></a></strong></td>
<td><strong>Industries </strong></td>
<td><strong>Industry tile </strong></td>
</tr>
<tr>
<td valign=top nowrap>&nbsp;</td>
@@ -1140,7 +1084,7 @@
</ul>
</li>
<li>m2: index into the array of industries</li>
<li>m3: random bits (NewGRF)</li>
<li>m3: animation state</li>
<li>m4: animation loop</li>
<li>m5: type (plus m6 bit 2):<br>
<small>(note: this is not the same as the industry type, which is stored in the array of industries)</small>
@@ -1157,7 +1101,7 @@
<tr>
<td nowrap valign=top><tt>01</tt>&nbsp; </td>
<td align=left>wheel tower when animated<br>
animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
</tr>
</table>
</td>
@@ -1173,7 +1117,7 @@
</tr>
<tr>
<td nowrap valign=top><tt>0A</tt>&nbsp; </td>
<td align=left>transformer; animation progress in m7(valid range <tt>0</tt>..<tt>7</tt>)</td>
<td align=left>transformer; animation progress in m3(valid range <tt>0</tt>..<tt>7</tt>)</td>
</tr>
</table>
</td>
@@ -1216,7 +1160,7 @@
</tr>
<tr>
<td nowrap valign=top><tt>1E</tt>..<tt>20</tt>&nbsp; </td>
<td align=left>various stages of animation; progress of animation in m7</td>
<td align=left>various stages of animation; progress of animation in m3</td>
</tr>
</table>
</td>
@@ -1247,7 +1191,7 @@
</tr>
<tr>
<td nowrap valign=top><tt>30</tt>&nbsp; </td>
<td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
<td align=left>wheel tower when animated; animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
</tr>
<tr>
<td nowrap valign=top><tt>31</tt>&nbsp; </td>
@@ -1287,7 +1231,7 @@
</tr>
<tr>
<td nowrap valign=top><tt>58</tt>&nbsp; </td>
<td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
<td align=left>wheel tower when animated; animation state in m3 bits 5..0; m3 bit 6 set = sound already generated</td>
</tr>
</table></td>
</tr>
@@ -1382,7 +1326,7 @@
<table>
<tr>
<td nowrap valign=top><tt>8F</tt>&nbsp; </td>
<td align=left>Animated part; animation state in m7 (valid range <tt>00</tt>..<tt>31</tt>)<br>
<td align=left>Animated part; animation state in m3 (valid range <tt>00</tt>..<tt>31</tt>)<br>
Tile animation is started (m4 zeroed) on the periodic processing.<br>
While the animation is in progress, m4 holds the number
of animation cycles that have already taken place.<br>
@@ -1412,7 +1356,7 @@
</tr>
<tr>
<td nowrap valign=top><tt>A2</tt>&nbsp; </td>
<td align=left>bubble capture facility; animation state in m7 (valid range <tt>00</tt>..<tt>27</tt>)</td>
<td align=left>bubble capture facility; animation state in m3 (valid range <tt>00</tt>..<tt>27</tt>)</td>
</tr>
</table>
</td>
@@ -1449,7 +1393,8 @@
</li>
<li>m6 bits 5..3: random triggers (NewGRF)</li>
<li>m6 bit 2: bit 8 of type (see m5)</li>
<li>m7: animation frame</li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
<li>m7: random bits (NewGRF)</li>
</ul>
</td>
</tr>
@@ -1462,10 +1407,9 @@
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bit 7: Ship docking tile status (for aqueducts)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a></li>
<li>m1: <a href="#OwnershipInfo">owner</a></li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram</li>
<li>m4: <a href="#RoadType">Roadtype</a></li>
<li>m3 bits 3..0: <a href="#TrackType">track type</a> for railway</li>
<li>m5 bit 4: pbs reservation state for railway</li>
<li>m5 bits 7 clear: tunnel entrance/exit</li>
<li>m5 bit 7 set: bridge ramp
@@ -1575,7 +1519,6 @@
<td><tt>2</tt>&nbsp;</td>
<td>water</td>
</tr>
</table>
</li>
<li>m5 bits 1..0: direction onto the bridge / out of the tunnel
<table>
@@ -1600,28 +1543,61 @@
</tr>
</table>
</li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road</li>
<li>m7 bit 5 set = on snow or desert</li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway</li>
<li>m7 bits 7..6: present road types for road</li>
</ul>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="ClassA"><tt> A</tt></a></strong></td>
<td><strong><tt>Objects</tt></strong></td>
<td><strong><tt>Unmovables</tt></strong></td>
</tr>
<tr>
<td valign=top nowrap>&nbsp;</td>
<td>
<ul>
<li>m1 bits 6..5 : Water class (sea, canal, river or land)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
<li>m2: index into the array of objects, bits 0 to 15 (upper bits in m5)</li>
<li>m3: random bits</li>
<li>m5: index into the array of objects, bits 16 to 23 (lower bits in m2)</li>
<li>m7: animation counter</li>
<li>m1: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
<li>m2: see company statue
<li>m3 bits 4..2: size of HQ
<li>m3 bits 1..0: section identification of the HQ
<li>m5: tile type:
<table>
<tr>
<td nowrap valign=top><tt>00</tt>&nbsp; </td>
<td align=left>transmitter</td>
</tr>
<tr>
<td nowrap valign=top><tt>01</tt>&nbsp; </td>
<td align=left>lighthouse</td>
</tr>
<tr>
<td nowrap valign=top><tt>02</tt>&nbsp; </td>
<td align=left>company statue
<ul>
<li>m2: TownID on which the statue is built in</li>
</ul>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>03</tt>&nbsp; </td>
<td align=left>company-owned land</td>
</tr>
<tr>
<td nowrap valign=top><tt>04</tt><tt></tt>&nbsp; </td>
<td align=left>company headquarters</td>
</tr>
</table>
</li>
<li>m6 bits 7..6 : Possibility of a bridge above, in the <a href="#bridge_direction">direction specified</a></li>
<li>m6 bits 1..0 : <a href="#tropic_zone">Tropic zone definition</a></li>
</ul>
</td>
</tr>

View File

@@ -4,7 +4,7 @@
<head>
<meta name="Author" content="Marcin Grzegorczyk">
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>OpenTTD Landscape externals</title>
</head>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays #2">
<title>OpenTTD Landscape Internals - #2</title>
<style type="text/css">
@@ -17,7 +17,7 @@
</head>
<body style="direction: ltr;">
<h3 style="font-weight: bold;">Landscape</h3>
<span style="font-weight: bold;"></span>Nine attributes hold the information about a tile.
<span style="font-weight: bold;"></span>Six attributes hold the information about a tile.
This can be seen in the <a href="landscape.html">Landscape</a> document. This page tries to give an overview of used and free bits of
the array so you can quickly see what is used and what is not.
<ul>
@@ -28,24 +28,21 @@ the array so you can quickly see what is used and what is not.
</ul>
<p>
<ul>
<li><span style="font-weight: bold;">type</span> - 8 bits in size, tile class (bits 4..7), bridge (bits 2..3) tropic zone (bits 0..1, only valid in tropic climate)</li>
<li><span style="font-weight: bold;">height</span> - 8 bits in size, stores tile height</li>
<li><span style="font-weight: bold;">type_height</span> - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits)</li>
<li><span style="font-weight: bold;">m1</span> - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.)</li>
<li><span style="font-weight: bold;">m2</span> - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array</li>
<li><span style="font-weight: bold;">m3</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m4</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m5</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m6</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m6</span> - 8 bits in size, special meaning : lower 2 bits only valid in tropic climate, upper 2 bits for bridges</li>
<li><span style="font-weight: bold;">m7</span> - 8 bits in size, is used for general storage</li>
<li><span style="font-weight: bold;">m8</span> - 16 bits in size, is used for general storage</li>
</ul>
<table align=center border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<th colspan=2>class</th>
<th>type (8)</th>
<th>height (8)</th>
<th>type_height (8)</th>
<th>m1 (8)</th>
<th>m2 (16)</th>
<th>m3 (8)</th>
@@ -53,342 +50,303 @@ the array so you can quickly see what is used and what is not.
<th>m5 (8)</th>
<th>m6 (8)</th>
<th>m7 (8)</th>
<th>m8 (16)</th>
</tr>
<tr>
<td colspan=2 class="caption">bits</td>
<td class="bits">7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">FEDC BA98 7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">7654 3210</td>
<td class="bits">FEDC BA98 7654 3210</td>
</tr>
<tr>
<td rowspan="2">0</td>
<td class="caption">ground</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XX<span class="free">OO</span></td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">farmland</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=3>1</td>
<td rowspan=4>1</td>
<td class="caption">rail</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">X<span class="free">OO</span>X XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX <span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
</tr>
<tr>
<td class="caption">rail with signals</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits">XXXX <span class="option">~~</span>XX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">-inherit-</td>
</tr>
<tr>
<td class="caption">depot</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits">XX<span class="free">O</span>X <span class="free">O</span>XXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">waypoint</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
<td class="bits"><span class="free">OOOO</span> XXXX</td>
<td class="bits">XX<span class="free">O</span>X <span class="free">OO</span>XX</td>
<td class="bits">XX<span class="free">O</span>X <span class="free">OOO</span>X</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">-inherit-</td>
</tr>
<tr>
<td rowspan=3>2</td>
<td class="caption">road</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOO</span>X XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="free">OO</span>X<span class="free">O</span> XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX XX<span class="free">OO OOOO</span></td>
<td class="bits">XXXX X<span class="free">O</span>XX</td>
<td class="bits">XXX<span class="free">O</span> XXXX</td>
</tr>
<tr>
<td class="caption">level crossing</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="option">~~</span>XX</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX <span class="free">OOO</span>X</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
<td class="bits">XXXX<span class="free"> OOO</span>X</td>
<td class="bits">XXXX X<span class="free">O</span>XX</td>
<td class="bits">XXXX XXXX</td>
</tr>
<tr>
<td class="caption">road depot</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OO</span>X<span class="free">O</span> XXXX</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits">XXX<span class="free">O OOOO</span></td>
</tr>
<tr>
<td>3</td>
<td class="caption">house</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XX<span class="free">O</span><span class="option">~ ~~</span>XX</td>
<td class="bits">XXX<span class="option">~ ~~</span>XX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXX<span class="abuse">X XXXX</span></td>
<td class="bits"><span class="abuse">XXXX XX</span><span class="free">OO</span></td>
<td class="bits"><span class="abuse">XXXX XX</span>XX</td>
<td class="bits">XXXX <span class="abuse">XXXX</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td>4</td>
<td class="caption">trees</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">O</span>XX<span class="option">~ ~~~~</span></td>
<td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OOOO OOOO</span> XXXX XXXX</td>
<td class="bits"><span class="option">~~</span>XX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XX<span class="free">OO</span></td>
<td class="bits">XX<span class="free">OO O</span>XXX</td>
<td class="bits"><span class="free">OOOO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=7>5</td>
<td rowspan=6>5</td>
<td class="caption">rail station</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits">XXXX <span class="option">~~</span>XX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OO</span>XX XXXX</td>
</tr>
<tr>
<td class="caption">rail waypoint</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
</tr>
<tr>
<td class="caption">road stop</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="free">OOO</span>X XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX XX<span class="free">OO OOOO</span></td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits">XXXX X<span class="free">O</span>XX</td>
</tr>
<tr>
<td class="caption">dock</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OO</span>XX</td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="option">~~~~ ~</span>XXX</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">airport</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">buoy</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OO</span>XX</td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">oilrig</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
<td class="bits"><span class="option">~~~~ ~~~~</span></td>
<td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=3>6</td>
<td class="caption">sea, shore</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">X<span class="option">~~</span>X XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">canal, river</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OO</span>XX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">shipdepot</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
</tr>
<tr>
<td>8</td>
<td class="caption">industry</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXX<span class="free">O</span> <span class="abuse">XXXX</span></td>
<td class="bits">XXX<span class="free">O</span> <span class="abuse">
XXXX</span></td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
</tr>
<tr>
<td rowspan=2>9</td>
<td class="caption">tunnel entrance</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">X<span class="free">OO</span>X XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits">XXXX <span class="free">OOOO</span></td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits">X<span class="free">OO</span>X XXXX</td>
<td class="bits">XXXX <span class="option">~~</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OO</span>XX XXXX</td>
<td class="bits"><span class="free">OOOO</span> XXXX XXXX XXXX</td>
<td class="bits">X<span class="free">OO</span>X XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits">XXXX X<span class="free">O</span>XX</td>
</tr>
<tr>
<td>bridge ramp</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">-inherit-</td>
</tr>
<tr>
<td rowspan=2>A</td>
<td class="caption">objects</td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">O</span>XXX XXXX</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="caption">unmovables</td>
<td class="bits">XXXX XXXX</td>
<td class="bits"><span class="option">~~~</span>X XXXX</td>
<td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
<td class="bits"><span class="free">OOO</span>X XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">XXXX XXXX</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
</tr>
<tr>
<td class="caption">company statue</td>
<td class="bits">-inherit-</td>
<td class="bits">-inherit-</td>
<td class="bits">XXXX XXXX XXXX XXXX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
<td class="bits">-inherit-</td>
<td class="bits">XX<span class="free">OO OO</span>XX</td>
<td class="bits"><span class="free">OOOO OOOO</span></td>
</tr>
</tbody>
</table>

View File

@@ -1,30 +0,0 @@
# Some clarifications about the link graph
`InitializeLinkGraphs` joins all threads, so if the game is abandoned
with some threads still running, they're joined as soon as the next game
(possibly the title game) is started. See also `InitializeGame`.
The MCF (multi-commodity flow) algorithm can be quite CPU-hungry as it's
NP-hard and takes exponential time (though with a very small constant
factor) in the number of nodes.
This is why it is run in a separate thread where possible. However after
some time the thread is joined and if it hasn't finished by then the game
will hang. This problem gets worse if we are running on a platform without
threads. However, as those are usually the ones with less CPU power I
assume the contention for the CPU would make the game hard to play even
with threads or even without cargodist (autosave ...). I might be wrong,
but I won't put any work into this before someone shows me some problem.
You can configure the link graph recalculation time. A link graph
recalculation time of X days means that each link graph job has X days
to run before it is joined. The downside is that the flow stats won't be
updated before the job is finished and thus a high value means less
updates and longer times until changes in capacities are accounted for.
If you play a very large map with a complicated link graph you may want to
raise the time setting to avoid lags. The same holds for systems with slow
CPUs.
Another option to avoid excessive lags is to reduce the accuracy of link
graph calculations. Generally the accuracy is inversely correlated to the
CPU requirements of the MCF algorithm.

View File

@@ -1,213 +0,0 @@
# Multiplayer manual for OpenTTD
Last updated: 2011-02-16
## Table of contents
- 1.0) [Starting a server](#10-starting-a-server)
- 2.0) [Connecting to a server](#20-connecting-to-a-server)
- 2.1) [Connecting to a server over the console](#21-connecting-to-a-server-over-the-console)
- 3.0) [Playing internet games](#30-playing-internet-games)
- 4.0) [Tips for servers](#40-tips-for-servers)
- 4.1)[Imposing landscaping limits](#41-imposing-landscaping-limits)
- 5.0) [Some useful things](#50-some-useful-things)
- 6.0) [Troubleshooting](#60-troubleshooting)
## 1.0) Starting a server
- Make sure that you have your firewall of the computer as well as possible
routers or modems of the server configured such that:
- port 3979 is free for both UDP and TCP connections in- and outgoing
- port 3978 is free outbound for UDP in order to advertise with the master
server (if desired). Otherwise you'll have to tell players your IP.
- port 3977 if use of the admin interface is desired (see admin_network.txt)
- Click "multiplayer" on the startup screen
- Click "start server"
- Type in a game name
- Select the type of game ('LAN/Internet' or 'Internet (advertise)'. With the
last one other people are able to see you online. Else they need your IP and
port to join)
- Click "start game", "load game" or "load scenario"
- Start playing
## 2.0) Connecting to a server
- Click "multiplayer" on the startup screen
- If you want to connect to any network game in your LAN click on 'LAN', then
on 'Find Server'
- If you want to see which servers all online on the Internet, click on
'Internet' and 'Find Server'
- If there were more than one server
- select one in the list below the buttons
- click on 'join game'
- If you want to play and you have the ip or hostname of the game server you
want connect to.
- click add server
- type in the ip address or hostname
- if you want to add a port use :<port>
- Now you can select a company and press: "Join company", to help that company
- Or you can press "Spectate game", to spectate the game
- Or you can press "New company", and start your own company (if there are
slots free)
- You see a progressbar how far you are with joining the server.
- Happy playing
## 2.1) Connecting to a server over the console
- Open the console and type in the following command:
connect `<ip/host>:<port>#<company-no>`
## 3.0) Playing internet games
- Servers with a red dot behind it have a different version then you have. You
will not be able to join those servers.
- Servers with a yellow dot behind it have NewGRFs that you do not have. You
will not be able to join those servers. However, via "NewGRF Settings" and
"Find missing content online" you might be able to download the needed
NewGRFs after which you can join the server.
- It can happen that a connection is that slow, or you have that many clients
connected to your server, that your clients start to loose their connection.
Some things you can do about it:
- [network] frame_freq:
change it in console with: 'set network.frame_freq <number>'
the number should be between the 0 and 10, not much higher. It indicates
the delay between clicking and showing up. The higher, the more you notice
it, but the less bandwidth you use.
A good value for Internet-games is 2 or 3.
- [network] sync_freq:
change it in console with: 'set network.sync_freq <number>'
the number should be between the 50 and 1000, not much lower, not much
higher. It indicates the time between sync-frames. A sync-frame is a frame
which checks if all clients are still in sync. When the value it too high,
clients can desync in 1960, but the server detects it in 1970. Not really
handy. The lower the value, the more bandwidth it uses.
NB: changing frame_freq has more effect on the bandwidth then sync_freq.
## 4.0) Tips for servers
- You can launch a dedicated server by adding -D as parameter.
- In UNIX like systems, you can fork your dedicated server by adding -f as
parameter.
- You can automatically clean companies that do not have a client connected to
them, for, let's say, 3 years. You can do this via: 'set autoclean_companies'
and 'set autoclean_protected' and 'set autoclean_unprotected'. Unprotected
removes a password from a company when it is not used for more then the
defined amount of months. 'set autoclean_novehicles' can be used to remove
companies without any vehicles quickly.
- You can also do this manually via the console: 'reset_company'.
- You can let your server automatically restart a map when, let's say, year 2030
is reached. See 'set restart_game_date' for detail.
- If you want to be on the server-list, enable Advertising. To do this, select
'Internet (advertise)' in the Start Server menu, or type in console:
'set server_advertise 1'.
- You can protect your server with a password via the console: 'set server_pw',
or via the Start Server menu.
- When you have many clients connected to your server via Internet, watch your
bandwidth (if you have any limit on it, set by your ISP). One client uses
about 1.5 kilobytes per second up and down. To decrease this amount, setting
'frame_freq' to 1 will reduce it to roughly 1 kilobyte per second per client.
- OpenTTD's default settings for maximum number of clients, and amount of data
from clients to process are chosen to not influence the normal playing of
people, but to prevent or at least make it less likely that someone can
perform a (distributed) denial-of-service attack on your server by causing
an out-of-memory event by flooding the server with data to send to all
clients. The major factor in this is the maximum number of clients; with
32 clients "only" sending one chat message causes 1024 messages to be
distributed in total, with 64 clients that already quadruples to 4096. Given
that upstream bandwidth is usually the limiting factor, a queue of packets
that need to be sent will be created.
To prevent clients from exploiting this "explosion" of packets to send we
limit the number of incoming data, resulting in effectively limiting the
amount of data that OpenTTD will send to the clients. Even with the default
limits it is possible to generate about 70.000 packets per second, or about
7 megabit per second of traffic.
Given that OpenTTD kicks clients after they have not reacted within about 9
seconds from sending a frame update packet it would be possible that OpenTTD
keeps about 600.000 packets in memory, using about 50 megabytes of memory.
Given that OpenTTD allows short bursts of packets, you can have slightly
more packets in memory in case of a distributed denial of service attack.
When increasing the amount of incoming data, or the maximum number of
clients the amount of memory OpenTTD needs in case of a distributed denial
of service attack is linearly related to the amount of incoming data and
quadratic to the amount of clients. In short, a rule of thumb for, the
maximum memory usage for packets is:
#max_clients * #max_clients * bytes_per_frame * 10 KiB.
### 4.1) Imposing landscaping limits
- You can impose limits on companies by the following 4 settings:
- terraform_per_64k_frames
- terraform_frame_burst
- clear_per_64k_frames
- clear_frame_burst
- Explaining 'per_64K_frames' and 'burst'
- 'burst' defines 3 things, the maximum limit, the limit of a single action,
and the initial value for the limit assigned to a new company.
This setting is fairly simple and requires no math.
A value of 1 means a single tile can be affected by a single action.
This results in having to click 400 times when wanting to cover an area
of 20 x 20 tiles.
The default value 4096 covers an area of 64 x 64 tiles.
- 'per_64k_frames' defines the number of tiles added to each companies limit
per frame (however not past the possible maximum value,the 'burst').
64k rather resembles the exact number of 65536 frames. So setting this
variable to 65536 means: 65536 / 65536 = 1 tile per frame.
As a day consists of 74 frames, a company's limit is increased by 74
tiles during the course of a single day (2.22 seconds).
To achieve a 1 tile per day increase the following calculation is needed:
1 / 74 (frames per day) * 65536 (per_64k_frames) = 885.62...
after rounding: a value of 886 means adding a bit over 1 tile per day.
There is still enough space to scale this value downwards:
decreasing this value to 127 results in a bit over 1 tile added to the
allowance per week (7 days).
To create a setup in which a company gets an initial allowance only,
set the value to 0 - no increase of the allowance per frame.
- Even though construction actions include a clear tile action, they are not
affected by the above settings.
## 5.0) Some useful things
- You can protect your company so nobody else can join uninvited. To do this,
set a password in your Company Screen
- You can give other players some money via the ClientList (under the 'head'
in the mainbar).
- You can chat with other players via ENTER or via SHIFT+T or via the ClientList
- Servers can now kick players, so don't make them use it!
## 6.0) Troubleshooting
- My advertising server does not show up in list at servers.openttd.org
Run openttd with the '-d net=2' parameter. That will show which incoming
communication is received, whether the replies from the master server or
communication from an admin tool reach the programme. See section 1
'Starting a server' further up for the ports and protocols used by OpenTTD.
The ports can be configured in the config file.

121
docs/multiplayer.txt Normal file
View File

@@ -0,0 +1,121 @@
Multiplayer Manual for OpenTTD (0.3.5)
=======================================
1. Starting a Server
---------------------
- Click "multiplayer" on the startup screen
- Click "start server"
- Type in a game name
- Select the type of game ('LAN/Internet' or 'Internet (advertise)'. With the last one
other people are able to see you online. Else they need your IP and port to join)
- Click "start game", "load game" or "load scenario"
- Start playing
2. Connecting to a Server
--------------------------
- Click "multiplayer" on the startup screen
- If you want to connect to any network game in your LAN click on 'LAN', then on
'Find Server'
- If you want to see which servers all online on the Internet, click on 'Internet'
and 'Find Server'
- If there were more then one server
- select one in the list below the buttons
- click on 'join game'
- If you want to play and you have the ip or hostname of the game server you want connect to.
- click add server
- type in the ip address or hostname
- if you want to add a port use :<port>
- Now you can select a company and press: "Join company", to help that company
- Or you can press "Spectate game", to spectate the game
- Or you can press "New company", and start your own company (if there are slots free)
- You see a progressbar how far you are with joining the server.
- Happy playing
3. Connecting to a Server over the Console
-------------------------------------------
- Open the console and type in the following command:
connect <ip/host>:<port>#<player-no>
4. Playing Internet-Games
--------------------------
- Since OpenTTD 0.3.5 the network protocol has been rewritten and is very stable, even over slow connections.
- Servers with a red dot behind it have a different version then you have. You will not be able to join those servers.
- Servers with a yellow dot behind it have NewGRFs that you do not have. You will not be able to join those servers.
- It can happen that a connection is that slow, or you have that many clients connected to your server, that your clients start to loose their connection. Some things you can do about it:
- net_frame_freq:
change it in console with: net_frame_freq = <number>
the number should be between the 0 and 10, not much higher. It indicates the delay between clicking and showing up. The higher, the more you notice it, but the less bandwidth you use.
A good value for Internet-games is 2 or 3.
- net_sync_freq:
change it in console with: net_sync_freq = <number>
the number should be between the 50 and 1000, not much lower, not much higer. It indicates the time between sync-frames. A sync-frame is a frame which checks if all clients are still in sync. When the value it too high, clients can desync in 1960, but the server detects it in 1970. Not really handy. The lower the value, the more bandwidth it uses.
NB: changing net_frame_freq has more effect on the bandwidth then net_sync_freq. You should never change net_sync_freq!
5. Tips for servers
--------------------
- You can launch a dedicated server by adding -D as parameter
- In UNIX like systems, you can fork your dedicated server by adding -f as parameter
- You can automaticly clean companies that do not have a client connected to them, for, let's say,
3 years. You can do this via: 'set autoclean_companies' and 'set autoclean_protected' and
'set autoclean_unprotected'. Unprotected removes a password from a company when it is
not used for more then the defined amount of months.
- You can also do this manually via the console: 'reset_company'.
Both ways, the company will go bankrupt.
- You can let your server automaticly restart a map when, let's say, year 2030 is reached.
See 'set restart_game_date' for detail.
- If you want to be on the server-list, enable Advertising. To do this, select 'Internet (advertise)'
in the Start Server menu, or type in console: 'set server_advertise 1'.
- You can protect your server with a password via the console: 'set server_pw', or via the
Start Server menu.
- When you have many clients connected to your server via Internet, watch your bandwidth (if
you have any limit on it, set by your ISP). 1 client uses +/- 3 kb/s up and down. To decrease
this amount, set 'net_frame_freq' to 1 for example. This will reduce it to 1.5 kb/s per client.
6. Some useful things
----------------------
- You can protect your company so nobody else can join uninvited. To do this, check your Company Screen
- You can give other players some money via the ClientList (under the 'head' in the mainbar).
- You can chat with other players via ENTER or via SHIFT+T or via the ClientList
- Servers can now kick players, so don't make them use it!
- From 0.3.5, desyncs should not happen anymore
- From 0.3.5, patch-settings are also synced. You can now play without deleting openttd.cfg, and with, for example, extra large trains enabled.
7. Troubleshooting
------------------
- My advertised server does not show up in the 'advertised server list' (servers.openttd.org)
Run openttd with the '-d net=2' parameter, as this will show whether it receives replies from the master server.
If it does not receive replies it is most likely that you need to configure your router to forward the OpenTTD ports 3979 (both TCP and UDP) to the computer that is hosting the game.

Some files were not shown because too many files have changed in this diff Show More