OpenBallance
Ballance (2004), reimplemented on a Virtools-compatible runtime with a port of its physics engine
GitHub · Website, user guide & internals · Download · Play in the browser

About
Ballance is Cyparade's 2004 marble game: a ball of wood, stone or paper, twelve levels of tracks floating in the sky, and physics that punishes every careless key press. It was built with Virtools, and like most Virtools games it hasn't aged well on current systems.
OpenBallance doesn't rewrite the game. Ballance keeps almost all of its logic in Virtools behaviour graphs inside its .cmo and .nmo files, so OpenBallance runs those graphs on a new runtime: a CK2-compatible object model and behaviour engine, the Building Blocks the graphs call, ported one by one from the original DLLs, a renderer for gasm's graphics API, and a port of the Ipion physics engine that physics_RT.dll was built on. Each ported function cites the original address it came from.
Bring your own CD
OpenBallance ships no original code, assets or data. It reads the game from the user's own copy at runtime — a disc image, the CD or an installed game. The CD keeps everything inside InstallShield cabinets, so OpenBallance reads those directly: 474 files, decompressed on demand and checked against the MD5s in the cabinet header.
What the original turned out to be
| Piece | What it is |
|---|---|
| Game logic | Virtools behaviour graphs in base.cmo and 50 .nmo files, calling 184 different Building Blocks from 19 DLLs |
| Levels | Placeholder objects in each level file, replaced at load time by pooled copies of module templates and re-placed as you move from sector to sector |
| Physics | The Ipion (IVP) engine compiled into physics_RT.dll: a fixed 1/66 s step, event-driven collision detection on "compact ledges", a friction system with its own linear solver, and an impact solver |
| Ball feel | Gravity 20 instead of 9.81, simulation time running at 2× real time, and the steering force applied as an impulse every physics step |
| Rendering | Direct3D 7 fixed-function: per-vertex lighting, fog, colour-keyed textures, a camera-centred sky box and the ball's shadow as an extra material channel on the floor |
Verification
The physics was specified before it was ported: three documents, about 9,500 lines, describing the core, the collision detection and the contact response function by function from the disassembly, with every constant in hex. The port follows them, and the measured numbers agree with the specification — acceleration, top speed and the bounce height of all three balls. Headless runs check every level: all twelve load and play with no missing Building Blocks or parameter operations, and a level restarted ten times doesn't grow the heap.
Status
| Intro, menus, options, highscores | Done |
| All twelve levels, the tutorial, modules, transformers, extras, lives, checkpoints | Done |
| Physics: IVP core, collision, friction, impacts, constraints and springs | Done |
| Data from the CD image, the CD or an installed copy | Done |
| The original's keyboard and mouse controls, including Options key bindings (gasm 0.5.0 raw input) | Done |
| Release | 0.1.0: bundles for macOS (universal), Linux (x86_64, arm64) and Windows (x86_64), and openballance.wasm for gasm 0.5.0+ |
| Platforms | Everything gasm runs on: macOS, Linux, Windows and the browser (WebGPU) |
| Next | Comparing the physics against recordings of the original |
GPL-3.0. Ballance is © 2004 Cyparade / Atari.
