An OCaml remake of Railroad Tycoon (1990). Build railroads, manage trains, compete with AI rivals, and grow your empire across historical regions.
See FEATURES.md for a full list of implemented features.
Precompiled packages are available on the Releases page for Windows, Linux, and macOS:
- Download the release archive for your OS:
- Windows:
rails-*-windows-x86_64.zip(includes all required SDL2 & codec DLLs) - Linux:
rails-*-linux-x86_64.AppImage(or.tar.gz) - macOS:
rails-*-macos-arm64.zip/x86_64.zip
- Windows:
- Copy your original Railroad Tycoon DOS files (
*.PIC,*.PAN,*.DTA) into thedata/folder next to the executable/AppImage. - Launch the game (
rails.exeon Windows, double-click the.AppImageon Linux, or openRails.appon macOS).
- OCaml 5.x with opam
- SDL2 and SDL2_mixer development libraries
- Original Railroad Tycoon DOS files
The game expects original game assets in ./data/ (or specified via --data-dir <path>).
opam install . --deps-only
dune build# New game
dune exec rails
# Load saved game (can also be done via the menu system)
dune exec rails -- --load 0
# With options
dune exec rails -- --zoom 3 --shader crt-hyllian2 --adjust-ar| Option | Description |
|---|---|
--load N |
Load save slot 0–9 |
--zoom N |
Display zoom, multiply the original 320x200 resolution (default: 3) |
--shader NAME |
Shader from shaders/*.glsl (test, crt-hyllian, vga-1080p, etc.) |
--adjust-ar |
Adjust aspect ratio (rectangular pixels like DOS) |
--no-audio |
Disable audio playback |
--data-dir PATH |
Custom path to folder containing original game data |
--debug |
Enable global debug logging |
--debug-module MOD |
Enable debug logging for specific module(s) (comma-separated, e.g. train,backend) |
--list-debug-modules |
List all available logging modules and exit |
src/rails_lib/— Main librarybackend/— Game logic (trains, stations, AI, economy)ui/— Menus, rendering, fonts, texturesanim/— PANI animation formatutils/— Rendering, image loading, sound
shaders/— GLSL shaders for display- technical_documentation.md — Architecture and design details
dune runtest
dune build @docMIT — see LICENSE.
Unlike the original, the game is built with fronted-backend separation, so in theory it could be made to support >1 player.