# Ski Jump International 3 for the browser

Original DOS game and bundled game artwork by Ville Könönen. Rust/SDL3 port by Grzegorz Perun (Mensix) and contributors. Browser adaptation by Old Games Archive. The first DOS v3 release was October 1, 2000. This build is based on Mensix 3.14.0, commit ea6e08ed63f1599143f4ca810d9e6f06d038e087. Original project notices are included unchanged. The Rust code and our browser glue are GPL-3.0-only. The upstream README separately credits the author's permission to redistribute the bundled game assets. No optional fan hill or other separately downloaded game artwork is included.

- [Original author's port and download guide](https://www.nomasi.com/sj3/download.html)
- [Upstream source and asset permission](https://github.com/Mensix/skijump3-rs/tree/ea6e08ed63f1599143f4ca810d9e6f06d038e087)
- [Original credits and high-score policy](https://github.com/suomipelit/skijump3)
- [Play on Old Games Archive](https://oldgamesarchive.org/games/ski-jump-international-3)

## Build the browser edition

Use Rust 1.99.1 with the wasm32-unknown-emscripten target, Python 3 and Emscripten 4.0.23. Extract upstream.zip into a new directory. In the following example SRC denotes the extracted upstream checkout and SDK denotes the Emscripten SDK root. The unmodified upstream ZIP has SHA-256 de3e9e1a56056ed450db299ff5db1e84a28deff98471cd7defb32e73451d2133.

    rustup target add wasm32-unknown-emscripten
    python adapt.py SRC

Copy browser-Cargo.lock over SRC/Cargo.lock. Run the following command with a short, writable target path, especially on Windows.

    python build.py SRC SDK target web
    python -m http.server --directory web 8080

Open localhost:8080 in a browser. Release source.zip contains the original checkout, the exact browser lockfile, adaptation and build scripts, touch shell, Cargo dependency archives, and the SDL 3.2.22 source used by the Emscripten SDK port. Cargo downloads its locked dependencies on an ordinary first build. Refer to each dependency's own license. The three game outputs are skijump3.js, skijump3.wasm and skijump3.data. The website serves them after Start with HTTP gzip encoding.

## Controls and replays

Choose English and press Esc to skip the introductory replay. Open Jump! → Practise, pick a hill, and use Enter to step to the bar. Push off with Right, take off with Up, adjust lean with Left/Right, and choose T (Telemark) or R (two feet) shortly before landing. English results offer (S)ave Replay. Choose a filename and Exit and Save. Wait for the device-save confirmation. On reopening the same site and browser, choose Replays, select your file and press Enter, then Right to play. TEMP.SJR is the game's default filename. INTRO.SJR is bundled. The open edition is ineligible for the original official high-score lists.

The browser schedules the original fixed-step simulation once per animation frame. Touch feeds the game's existing input events. The original replay format is stored in IndexedDB at a stable mount point. A single writer and a completion message protect consecutive sessions. No cloud sync is advertised.


# Ski Jump 3

An SDL3-based Rust port of Ski Jump 3 (SJ3). Windows release archives ship a
single folder: `skijump3.exe` with its data files flat next to it — no
subfolders, no installer. Sprites and the main background are baked into the
exe; everything else beside it is editable and customizes the game. Debug
builds read `game/assets/` from the workspace instead.

## Requirements

- Rust 1.88 or newer
- CMake and a C compiler (SDL3 is built from source and linked statically)
- Any desktop OS SDL3 supports (Linux needs X11 or Wayland plus audio
  development dependencies); release zips are cut for Windows x86_64 only

On Debian or Ubuntu, the packages used by CI can be installed with:

```sh
sudo apt-get install cmake ninja-build pkg-config libasound2-dev libpulse-dev \
  libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
  libxss-dev libxtst-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \
  libgl1-mesa-dev libegl1-mesa-dev libdbus-1-dev libudev-dev
```

## Build And Run

```sh
cargo build --release --locked
cargo run --release --locked
```

Use `cargo run --locked -- --help` for startup options. If hardware rendering
does not work, start with `--sw-rendering`.

## Controls

- Arrow keys move through menus; Enter selects and Escape goes back.
- During a jump, Right starts the in-run and leans forward, Up takes off, and
  Left corrects or leans back.
- `T` starts a telemark landing; `R` starts a two-footed landing.
- `P` pauses during flight or landing, `S` saves a replay from the result
  screen, and `F5` resets wind where the game mode permits it.
- `+` and `-` adjust the start gate where the game mode permits it.

The five main jump keys can be changed in Setup.

## Save Data

The game is portable: saves live next to the executable, not in the OS
profile. On first start (no language saved yet) the game opens with the
WELCOME language picker, then plays the intro replay.

The TOML save formats are versioned and strict: a `config.toml`,
`players.toml`, or `hiscores.toml` with an unsupported format version or
invalid fields is a startup error naming the file — fix the file or re-run
with `-c`, `-r`, or `-z`. Missing files are created from bundled defaults
(records and players from the shipped data, config from built-in defaults).
Invalid cup saves are ignored.

The startup reset flags overwrite their target immediately:

- `-c` replaces `config.toml` with default settings.
- `-r` replaces `hiscores.toml` with bundled records.
- `-z` replaces `hiscores.toml` with zeroed records.

Only one reset flag may be supplied. Unknown and conflicting command-line
options are errors.

## Licensing

The Rust source code is available under the GNU GPL version 3 only; see
[LICENSE](LICENSE). The bundled SJ3 game assets originate from the original
Ski Jump 3 by Ville Kononen and are redistributed with the author's permission.
