Patches

From OpenTTD
Jump to: navigation, search


Patch(es) can refer to some different things:

This page is about the second type of patches: user-made modifications of the game, adding features that are not possible via NewGRF. We'll explain what patches are and what you can and cannot do with them as a regular OpenTTD player.

Contents

What are patches?

Patches are text files that describe changes to a certain version of the source code of OpenTTD. You can recognize them by the file extension: either .diff (most common) or .patch. There's no easy way to 'install' patches, certainly not as easy as installing a NewGRF.

Let's break it down a bit. The game OpenTTD you play is made from source code. This source code is written by the OpenTTD developers, but anyone is free to take this source code and modify it. Players who modify the source code themselves often publish these changes in the form of a patch, hoping that the developers will pick it up and add it to the main source code of the game.

The source code itself is not yet a program (or game if you will) that can be used on a computer by you and me. For this, the source code first needs to be made into a program, which is called compiling. One can compile the original source code, which gives the game as you can download it from the OpenTTD website. One can also compile modified, or patched source code, which puts the modifications of the patch into the program, such that they can be used.

So to summarize: if you want to play the game with a patch, you need to get the source code, then apply the patch to the source code and finally compile the modified source code into a program.

How can I use a patch?

If you want to use a patch, there's two ways to do that. The hard way is to get the source code, apply the patch and compile the game yourself. This involves setting up a compile environment on your computer, which can take anywhere from a few hours to a few days, depending on your computer skill level. The easy way is hoping that someone else has done this compiling before, so that you can download a precompiled binary, similar to downloading the official version from the OpenTTD website.

Assuming you're a regular player, you may want to go for the last option. Putting a patch file in some directory on your computer will not work.

Where do I get these precompiled binaries?

There's no guarantee that there is one available for the patch you're interested in. If there is one available, you can usually find it in the topic devoted to the patch in the development forum. Often there are links in the first post of the topic.

What to do if I want to use multiple patches?

This is tricky, as patches are generally not compatible with each other. Each patch changes the original game, and doesn't know about other patches. Especially if multiple patches change the same thing in the game to something different, there is a problem.

However, there are users who make so called patch packs. Heavily modified versions of the game that combine the most popular patches. Have a look, maybe there is a patch pack that incorporates the patches you're looking for. Patch packs always have precompiled binaries available, which you can find in the patch pack's forum topic.

What if none of the above is available?

In that case the only option is to compile yourself. This takes time and perseverance. Don't expect that it will work in one go and that you're done in five minutes. A "if something is hard it's not worth doing" attitude won't cut it here. Still interested? Then there are some articles that will get you started.

Personal tools