Case study

Kinoko: reimplementing Mario Kart Wii’s physics engine for exact ghost replay

Re-implements Mario Kart Wii’s physics engine in C++ as a command-line simulator, continuing stblr/Hanachan’s goal of perfectly accurate time-trial ghost replay. Each test case replays a recorded ghost through the engine and compares kart position, rotation, velocities, speed and checkpoint state frame by frame with a trace captured from the original game. It is a behavioural reimplementation of the physics only, not a matching decompilation, and has no graphical frontend.

Requirements & limits

  • README describes a C++ reimplementation of Mario Kart Wii’s physics engine aiming at perfectly accurate ghost replay. At the reviewed commit STATUS.md lists 55 time-trial ghost test cases, each marked synchronized for every frame; the latest GitHub release, 0.6 (2025-09-04), adds x86-64 Linux, macOS and Windows binaries of the simulator. Source comments name addresses in the original game, but nothing rebuilds its executable; README points to the separate riidefi/mkw matching decompilation for that.
  • Running needs the Race folder (the Common and course archives) from your own Mario Kart Wii disc, placed relative to the executable; the repository ships no game files, and README requires any contributed frontend not to distribute in-game assets. The committed samples are time-trial ghost files (.rkg) with per-frame .krkg reference traces that README says come from a custom vabold/mkw-sp build running the PAL release; such traces are verification data captured from the game, as is common for reconstruction projects.
  • README lists g++ 13.1 with C++23, ninja 1.3 and Python 3.6; configure.py generates the ninja build and compiles testCases.json into the binary suite file. CMakeLists.txt also exposes a libkinoko library target for embedding the engine in other C++23 projects. CI builds with GCC 14 on Ubuntu; the program is a command-line host with test and replay modes, and README says no GUI is planned.
  • kinoko test compares position, rotation, internal and external velocity, speed, acceleration, soft speed limit, race completion and checkpoint values with every .krkg frame by exact equality and reports the first desynchronized frame; kinoko replay checks whether a ghost finishes with the time in its .rkg header. CI runs the suite with runtime files fetched from a secret-configured URL and checks that STATUS.md is current. These are project-reported results; this collection built and ran nothing.
  • LICENSE applies MIT (copyright vabold, 2022–2026) to the project; Mario Kart Wii and its game data keep Nintendo’s rights, and the bundled doxygen-awesome-css theme has its own license file. The reviewed sources establish no AI or REA use, and no runtime reproduction is claimed.

About this entry

Type
Case study
Category
Independent reconstruction cases
Relationship
Independent reconstruction project
Targets
Game

Sources reviewed

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Report an outdated entry Suggest a translation fix

Primary sources

  1. README.md GitHub · vabold/Kinoko · Revision 550c97a
  2. STATUS.md GitHub · vabold/Kinoko · Revision 550c97a
  3. docs/KRKG.md GitHub · vabold/Kinoko · Revision 550c97a
  4. docs/TestCase.md GitHub · vabold/Kinoko · Revision 550c97a
  5. source/host/KTestSystem.cc GitHub · vabold/Kinoko · Revision 550c97a
  6. source/game/system/ResourceManager.cc GitHub · vabold/Kinoko · Revision 550c97a
  7. configure.py GitHub · vabold/Kinoko · Revision 550c97a
  8. CMakeLists.txt GitHub · vabold/Kinoko · Revision 550c97a
  9. .github/workflows/build.yml GitHub · vabold/Kinoko · Revision 550c97a
  10. tools/status_check.py GitHub · vabold/Kinoko · Revision 550c97a
  11. LICENSE GitHub · vabold/Kinoko · Revision 550c97a
  12. https://github.com/vabold/Kinoko/releases/tag/0.6

More in Games

All 231 entries in GamesGames case studies (189)