# 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.

- Type: Case study
- Targets: Game
- Category: Independent reconstruction cases
- Relationship: Independent reconstruction project
- Sources reviewed: 2026-10-19
- Added to the catalog: 2026-10-27
- Original resource: <https://github.com/vabold/Kinoko>
- Primary source: <https://github.com/vabold/Kinoko/blob/550c97a299c4de4a9f7cb90bc79cf8c7c768557c/README.md>
- Catalog page: <https://awesomerea.org/resources/kinoko-mkwii-physics-reimplementation-case/>
- Record JSON: <https://awesomerea.org/resources/kinoko-mkwii-physics-reimplementation-case/record.json>
- Chinese version: [简体中文](https://awesomerea.org/zh/resources/kinoko-mkwii-physics-reimplementation-case/index.md)

## 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.
- 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.

## Primary sources

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

## More in Games

- [LBA2 Remake: a Little Big Adventure 1 and 2 reimplementation in TypeScript and Three.js](https://awesomerea.org/resources/lba2remake-little-big-adventure-case/index.md) · Case study
- [Legend of Legaia: a Rust port with disc-local browser tooling](https://awesomerea.org/resources/legend-of-legaia-rust-port-case/index.md) · Case study
- [libd2: Diablo II 1.14d engine-core libraries](https://awesomerea.org/resources/libd2-engine-core-reconstruction-case/index.md) · Case study
- [librw: a re-implementation of the RenderWare Graphics engine](https://awesomerea.org/resources/librw-renderware-reimplementation-case/index.md) · Case study
- [MechRewired: rebuilding MechWarrior 2 from original game data](https://awesomerea.org/resources/mechrewired-mechwarrior-2-case/index.md) · Case study
- [Nanolathe: a documented Total Annihilation engine reimplementation](https://awesomerea.org/resources/nanolathe-case/index.md) · Case study

## About this entry

The description was reviewed against primary sources.
Original editorial content: MIT. Linked projects, papers and assets retain their own rights and licenses.
