An open source re-implementation of Chris Sawyer's Locomotion. A construction and management simulation video game that simulates running a transport company.
- 1 - Introduction
- 2 - Downloading the game (pre-built)
- 3 - Contributing
- 4 - Compiling the game
- 4.1 - Building prerequisites
- 4.2 - Compiling and running
- 5 - Licence
- 6 - More information
Windows / Linux | Download | |
---|---|---|
master |
Feel free to join our Discord server to talk about developing the game, or for help getting it to run.
OpenLoco is an open-source re-implementation of Chris Sawyer's Locomotion (CSL). CSL is the spiritual successor to Transport Tycoon and OpenLoco aims to improve the game similar to how OpenTTD improved Transport Tycoon and OpenRCT2 improved RollerCoaster Tycoon.
Chris Sawyer's Locomotion was originally written by Chris Sawyer in x86 assembly, building on top of his RollerCoaster Tycoon 2 engine. Much of the code is 1:1 with RollerCoaster Tycoon 2. However, the engine has changed substantially enough that OpenLoco currently does not share its codebase with OpenRCT2.
Recent implementation efforts have focussed on re-implementing the UI, so that the data structures involved may be better understood. Once this is done, it is our hope the game logic will be easier to understand and implement.
The latest releases can be downloaded from GitHub. Releases are currently provided for Windows and macOS (32-bit only). For Linux and BSD distributions, we currently do not provide any builds. Please refer to the next section to compile the game manually.
Please note that OpenLoco requires the asset files of the original Chris Sawyer's Locomotion to play the game. It can be bought at e.g. Steam or GOG.com.
We warmly welcome any contributions to the project, e.g. for C++ code (game implementation, bug fixes, features) or localisation (new translations). Please have a look at our issues for newcomers.
For code contributions, please stick to our code style.
You can use clang-format
to apply these guidelines automatically.
If you would like to contribute code to OpenLoco, please follow the instructions below to get started compiling the game. Alternatively, we have platform-specific guides for Ubuntu and macOS.
If you just want to play the game, you can just download the latest release from GitHub. Releases are currently provided for Windows and macOS (32-bit only).
The following libraries/dependencies are required:
- libpng
- libzip
- OpenAL
- SDL2
- yaml-cpp (included as submodule for Linux builds)
- breakpad (only required on Windows)
- 7 / 8 / 10
- Visual Studio 2019
- Desktop development with C++
- Dependencies are managed with vcpkg
- cmake
- make or ninja
- 32-bit versions of the libraries mentioned above
- Check out the repository. This can be done using GitHub Desktop or other tools.
- Open a new Developer Command Prompt for VS 2019, then navigate to the repository (e.g.
cd C:\GitHub\OpenLoco
). - Run
msbuild openloco.sln /t:restore;build
- Run
mklink /D bin\data ..\data
orxcopy data bin\data /EIY
- Run
mklink bin\openloco.exe ..\loco.exe
orcopy loco.exe bin\openloco.exe
- Run the game,
bin\openloco.exe
Note: The game can currently only be built for 32-bit architectures.
To install dependencies, you need to have vcpkg installed and in the root directory run .\vcpkg.exe install sdl2:x86-windows sdl2-mixer:x86-windows zlib:x86-windows libpng:x86-windows yaml-cpp:x86-windows breakpad:x86-windows
- Run
mkdir build
- Run
cd build
- Run
cmake .. -A Win32 "-DCMAKE_TOOLCHAIN_FILE=<vcpkg_root>/scripts/buildsystems/vcpkg.cmake"
- Run
cmake --build .
Due to issues with yaml-cpp package, for Linux we bundle our own copy via git submodule. Make sure you have cloned repository recursively.
The standard CMake build procedure is to install the required libraries, then:
mkdir build
cd build
CXXFLAGS="-m32" cmake .. -G Ninja # remember the usual cmake options, e.g. -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja
Note that installing some packages can be problematic on desktop AMD64 distributions, you can use our docker images for compilation.
Running the game will need the data directory from the root of the source code next to the binary. Assuming you're in $SRC/build
,
ln -s ../data
OR
cp -r ../data ./data
For technical reasons OpenLoco can only be built as 32-bit x86 application, for which Apple dropped support in Mac OS 10.15. We can't provide MacOS builds at this time.
OpenLoco is licensed under the MIT License.