Skip to content

v0.4.0 — native game modules

Latest

Choose a tag to compare

@matthewdeaves matthewdeaves released this 05 Jul 14:07

One DMG that auto-tunes every Mac from a G3 running Panther to a modern Intel — now with native game modules.

This release adds native game-code modules to the single fat .app. The cgame/qagame/ui game logic now ships as native dylibs (fat ppc750+ppc7400+x86_64, bundled inside the app) and is loaded in place of the stock pak8.pk3 bytecode. dyld picks the right slice per machine, and it falls back to the bytecode automatically if a module is missing or you're on a pure server. The engine binary is otherwise unchanged from v0.3.0.

What's new

  • Native game modules (vm_cgame/vm_game/vm_ui 0). Stock ioquake3 already JIT-compiles the QVM bytecode to native PowerPC, so this isn't an "interpreter → native" leap — it's a real compiler's codegen plus dropping the VM's per-access sandbox masking. Bench-measured +1.3% on the Radeon-9000 G4 (41.10 → 41.65 fps; 42.0 on the production auto-config path), zero visual cost, and it's free on every machine. Native load verified on all three arches (ppc750 / ppc7400 / x86_64).
  • Honest scope in the README. A new "What this port actually changes in the engine" section: the graphics/fps tuning is all config (cvars in the bundled autoexec-*.cfg), and the measured C changes are the per-machine auto-config (common.c), the Panther objc_msgSend SIGSEGV fix (SDLMain.m), the optional Apple Watch companion (watchlink), and Makefile plumbing. The native modules are built from stock, unmodified game source.

Under the hood (measured negatives, so they're never re-chased)

Two candidate code-level wins were investigated on real hardware and rejected with data (see docs/PROFILING.md):

  • Bot-skin upload pre-caching — the recurring frame-time spikes are not first-time texture uploads (a cold-vs-warm-VRAM run is frame-for-frame identical); they're per-frame CPU on heavy scenes. Nothing to pre-cache.
  • A bigger native-module win — the QVM is already JIT'd to native PPC, so the realistic gain is the ~1% measured here, not the hoped ~5%. Shipped anyway because it's free and consistent.

Measured native-res fps (demo four, each machine's native panel)

Machine GPU Native res fps
yosemite (G3 449 MHz) Rage 128 800×600 22
quicksilver (G4 733 MHz) Radeon 9000 1680×1050 42
mini-g4 (G4 1.25 GHz) Radeon 9200 1680×1050 27.5
imac-g5 (PPC 970 2.0 GHz) Radeon 9600 1440×900 60 (34.5 w/ 2× FSAA)
mini-intel (Core 2 Duo) GMA 950 1920×1080 41.6

Install

Mount the DMG, copy ioquake3.app next to your existing baseq3/ (your own Quake III game data — none is shipped here), and launch. The .app auto-tunes to your Mac and loads the native game modules from inside the bundle. To override, edit baseq3/autoexec.cfg; to disable auto-tuning, launch with +set com_archAutoexec 0; to force the bytecode, +set vm_cgame 2 +set vm_game 2 +set vm_ui 2.

The DMG is built on Tiger so it mounts on Panther 10.3.9 through modern macOS, and every binary inside it (engine + SDL + all six game dylibs) is verified byte-identical to the source build.