Files
top-octane/README.md
T

62 lines
5.2 KiB
Markdown
Raw Normal View History

2026-11-30 22:31:51 +02:00
# Top-Octane
A modern, cross-platform **SDL2 + OpenGL 3.3 Core** C++20 source port of Bullfrog's 1995 vehicular combat racer ***Hi-Octane***, designed to load essential game assets read-only from `data/` while fixing DOS/DOSBox CPU-cycle speed bugs, display scaling/pop-in, gameport controls, and sound/General MIDI crashes.
2026-11-30 23:22:00 +02:00
## Key fixes over the original DOS version
- **CPU cycles & timing:** Fixed `60 Hz` deterministic simulation clock with high-refresh render-state interpolation and OS-friendly VSync yielding (eliminates DOSBox hyper-speed and frame hitching).
- **Graphics:** Native OpenGL 3.3 Core renderer with widescreen Hor+ FOV, HiDPI support, extended draw distance, MSAA, perspective-correct 3D terrain & column geometry (`TEXTU0-0..8`, `SKY0-0..5`, `BULLFROG OBJECT DATA`), authentic `TMAPS` pickup/weapon-upgrade billboards, modern directional shadows & dynamic lighting, scaled cockpit HUD, explosion/smoke effects, autoscaling menus, plus **classic mode** (`F2`) featuring 4:3 `320×200`/`640×480` quantization against `PALET0-0.DAT` and optional scanlines.
- **Gameplay & Revision content:** Full support for all 9 tracks—including Bullfrog's Revision expansion tracks (*7. Ancient Mine Town*, *8. Arctic Land*, and *9. Death Match Arena*)—across Track Select, 8-track Championships, Highscores, Clone Races, and Track Viewer; stat-matched vehicle top speeds and HUD speedometers; pitstop recharge audio cues; and anti-stuck AI navigation/recovery.
2026-11-30 22:31:51 +02:00
- **Controls:** Scancode-based remappable keyboard, hot-plugged `SDL_GameController` analog steering/triggers with deadzone/curve calibration and rumble haptics, optional mouse steering, and 2-player local split-screen.
2026-11-30 23:22:00 +02:00
- **Audio & music:** Low-latency SDL2 float32 stereo mixer with 3D spatial panning/attenuation, bank 3 & bank 9 WAV SFX extraction from `SOUND.DAT`, and native Miles XMIDI (`MUSIC.DAT`) playback via **OPL3 FM (`SAMPLE.OPL`)**, **SoundFont (`BULLFROG.SBK` / `.sf2`)**, or custom `.wav` tracks — completely bypassing the DOS `MPU401.MDI` crash.
2026-11-30 22:31:51 +02:00
## Prerequisites
- C++20 compiler (`g++` or `clang++`)
- POSIX `make`
- `SDL2` development libraries & headers (`pkg-config` or `sdl2-config`)
- OpenGL 3.3+ drivers / system headers
- Essential game assets in `./data` (default lookup; also searches relocatable `../share/top-octane/data` and XDG `XDG_DATA_HOME`/`XDG_DATA_DIRS` directories when installed, or can be overridden via `--data-dir` or `HIOCTANE_DATA`, with `./HiOctane` supported as a legacy fallback). Optional `DATA/INTRO.DAT` is excluded by default so the game boots cleanly to the title screen.
2026-11-30 22:31:51 +02:00
2026-11-30 23:22:00 +02:00
## Building & running
2026-11-30 22:31:51 +02:00
### Linux / macOS
```bash
make -j$(nproc) # builds Release ./top-octane by default (or `make release`)
make test # builds & runs all 5 test suites in the active mode
make smoke # runs `./top-octane --smoke-test 30`
./top-octane
```
2026-11-30 23:22:00 +02:00
Other make targets:
- `make debug`: builds `./top-octane` with `-g -O0` (automatically cleans stale release objects).
- `make install` / `make uninstall`: installs/removes `top-octane`, game assets (`$(PREFIX)/share/top-octane/data`), XDG desktop shortcut (`$(PREFIX)/share/applications/top-octane.desktop`, **Games** menu group), and hicolor icons (`scalable`, `48x48`–`256x256`) into `$(DESTDIR)$(PREFIX)` (default `PREFIX=/usr/local`).
- `make install-user` / `make uninstall-user`: installs/removes per-user (rootless) into `~/.local/bin` and `${XDG_DATA_HOME:-~/.local/share}` (adds **Top-Octane** to the desktop **Games** menu for the current user).
2026-11-30 22:31:51 +02:00
- `make clean`: removes built objects, libraries, binaries, and `.buildmode`.
### Windows (MSYS2 / MinGW)
```bash
make -j$(nproc)
make test
./top-octane.exe
```
2026-11-30 23:22:00 +02:00
## CLI options
- `--data-dir <path>`: Path to the read-only assets directory (default: `./data` or installed/XDG data dirs; also reads `HIOCTANE_DATA` env var).
- `--track <1..9>`: Jump directly into a race on track 1–9.
- `--track-viewer <1..9>`: Open interactive 3D track inspection camera.
2026-11-30 23:22:00 +02:00
- `--classic`: Launch in 4:3 classic palette visual mode.
2026-11-30 22:31:51 +02:00
- `--fullscreen`: Launch in borderless fullscreen.
2026-11-30 23:22:00 +02:00
- `--music-backend <opl3|sf|custom>`: Choose OPL3 FM, SoundFont, or custom WAV music.
2026-11-30 22:31:51 +02:00
- `--skip-intro`: Skip the `INTRO.DAT` FLC movie.
- `--smoke-test <frames>`: Render `<frames>` frames and exit cleanly (for automated verification).
2026-11-30 23:22:00 +02:00
## Default controls
- **Player 1 (keyboard):** `W/S` or `Up/Down` (throttle/brake), `A/D` or `Left/Right` (steer), `Left Shift` (boost), `Space` (minigun), `E` (missile), `Q` (auto-pilot), `C` (camera view), `Esc`/`P` (pause).
- **Player 2 (split-screen):** `Arrow keys` (steer/throttle/brake), `Right Shift` (boost), `Right Ctrl` (minigun), `Enter` (missile).
- **Gamepad:** Left stick / D-pad (steer), `RT`/`A` (throttle), `LT`/`B` (brake), `LB`/`X` (boost), `RB` (minigun), `Y` (missile), `Start` (pause).
- **Hotkeys:** `F2` (toggle classic mode), `F4` (switch OPL3 / SoundFont music), `F11` or `Alt+Enter` (toggle fullscreen), `1–9` / `[` `]` (switch tracks in Track Viewer).
2026-11-30 22:31:51 +02:00
User configuration, highscores, clone ghosts, and championship saves are stored in your OS user preferences directory (`SDL_GetPrefPath`). Original files in `data/` are never modified.
2026-11-30 23:22:00 +02:00
## Credits
Ported by Luxferre in 2026, released into the public domain with no warranties.