opentrail is The Oregon Trail (MECC, Apple II, 1985), rebuilt rule for rule, in two versions: Classic and Modern.
opentrail is free, open source, and has no tracking.
History#
MECC released The Oregon Trail for the Apple II in 1985. The player leads a family from Independence, Missouri to Oregon’s Willamette Valley in 1848. Outfit the wagon at Matt’s store, set the pace and the rations, hunt for food, trade at the forts, and choose how to cross each river. The trail ends at The Dalles, with a raft down the Columbia River or the toll road around Mount Hood.
Classic: the original, rebuilt#
Classic is the 1985 game, screen for screen. The goal from the first day was a picture identical to the original’s, pixel for pixel.
From the disks#
The original disks were taken apart into a full specification: the BASIC program listings, the data tables, and a disassembly of the machine code behind the text, the pictures, the music, the hunt and the raft. Everything in opentrail is built from that specification.
A rewrite, not an emulator#
No Apple II runs inside opentrail. The BASIC programs are ported to C line by line, keeping their variable names. The machine-code routines are rewritten in C from what they do. The game keeps the original’s memory layout for its screens and pictures, so the original’s on-screen quirks come back with it.
Checked against the original#
During the build, the original ran in an emulator under a script, and opentrail’s screens were compared with it pixel by pixel:
- Each rewritten routine matched the original across 297 test cases.
- Whole hunts matched, from the walk to the kills.
- 16 full screens matched captures of the original.
Once the port matched, the comparison tools were removed.
Timing#
Much of the original’s pace came from the machine. The 12-second title screen was the disk loading behind it. The BASIC interpreter was slow, and every program change was a disk load. Classic drops that waiting. It keeps the waits that belong to the game: the travel days, the music, the hunt and the raft.
Cutting too much broke the game’s pacing. The “loading the trail” screen went by instantly, and its pause was put back.
The picture#
The old monitor’s colour fringing is gone. Classic draws a clean colour picture, scaled to the window.
Modern: the same game, redrawn#
Modern runs the same rules engine as Classic, unchanged. Only the screens are different, so a Modern game plays out exactly as a Classic one would.
New art#
- Every scene, landmark, event, hunter, animal and hunting ground is new pixel art.
- Landmarks are drawn larger, set in the foreground or on the horizon.
- The river crossings, the Columbia and the tombstone are drawn in code.
- The hunt is the original’s game, played with the new hunter, animals and terrain.
Music#
The original’s 19 tunes play note for note on a synthesized orchestra, generated as the game runs.
Screens#
- The game opens on its logo, then the wagon scene, then the menu.
- Landmarks wait for a key, so they can be looked at.
- The store and trade screens show what the party already has.
- The tombstone carries its epitaph.
- Every choice is numbered and taken with a single key, yes and no included.
Technical details#
Source code: github.com/dannyheskett/opentrail, MIT license.
Where to play#
- Browser: Modern or Classic. Nothing to install.
- Windows, macOS, Linux: download the archive for your system from the latest release. Each is one file with both versions inside.
--classicor--modernpicks one at launch.
Controls#
| Input | Action |
|---|---|
| Number keys | Choose. Classic takes the number, then Return. Modern takes the number at once |
| Y / N | Answer yes or no |
| Space or Return | Continue past a page |
| Return | Stop the wagon at the next day |
Arrows, or ; P O I K , . / | Aim in the hunt |
| Space | Fire in the hunt |
| Left / Right | Steer the raft |
| Esc Esc | Abandon the game and return to the menu |
| Esc | Quit. In the browser, the game starts again |
| Ctrl+S | Sound on or off |
| Alt+Enter | Toggle fullscreen |
Code#
- Written in C, with raylib for the window, drawing, input and sound.
- The rules engine knows nothing about screens. It asks the front end for each screen and each answer, and the two versions are two front ends.
- Modern draws on a 384x252 canvas, scaled to the window, with text in the Press Start 2P font.
- The music is synthesized in code. There are no audio files.
- The browser versions are the same C compiled to WebAssembly with Emscripten.
Art#
Modern’s art was made with Retro Diffusion. Each image was generated from a description of the original’s picture, and kept only once approved. The river crossings, the Columbia and the tombstone are drawn by a script instead.
Testing#
A test harness runs the real game one frame at a time from commands, and reports its state as JSON with screenshots. A test player uses it to play 20 different games to the end in each version: other jobs, months, paces and rations, every way across a river, both routes at The Dalles, starving and winter.
Recording#
Desktop builds record to an H.264 MP4 file. F12 starts and stops recording, and --record or --record <file>.mp4 records from launch. The video at the top of this page is a Modern game recorded through the test harness.
Builds and releases#
Every push to main builds and publishes a release: Linux x86-64, macOS universal, Windows x64 and x86, and the two web games.