Kinoko is a reimplementation of Mario Kart Wii's physics engine in C++. This project is a spiritual continuation of stblr/Hanachan. Like Hanachan, the goal of this reimplementation is to reach perfectly accurate ghost replay.
To see the current list of test cases and progress, visit STATUS.md.
Kinoko relies on files from the base game to run, with the same paths relative to the executable. Dolphin is the preferred method of extracting these files.
Generate the ninja file and test case binary:
Execute it:
Run Kinoko:
The simplest use of Kinoko is to just determine whether or not a ghost finishes the race with the timer matching what is present in the ghost .rkg file header. To replay a ghost, you can run:
When a ghost doesn't play back correctly, we want to be able to capture the exact frame that a desynchronization occurs, as well as gain insight as to what variables desynced. There are two ways to evaluate test cases in Kinoko. Both approaches require generating a .krkg file.
Test cases use a custom .krkg file format, which stores relevant in-game memory values to validate accuracy on every frame of a race. This file is generated using a custom version of MKW-SP.
mkw-sp-test artifact at the bottom of the page.boot.dol to a folder of your choosing.Default ISO to the path of your Mario Kart Wii PAL ISO.boot.dol.[DolphinDir]\User\Wii\title\00010004\524d4345\data. You should see a new file called test.krkg.Kinoko will iterate the array of test cases defined in testCases.json, each with the following format:
rkgPath is the path to the game's native ghost file for the time trial you want to simulate.
krkgPath points to the krkg file generated in the previous section for this time trial ghost.
targetFrame is the number of frames to attempt sync for this ghost. Kinoko will throw an error if it is larger than the framecount stored in the krkg. If Kinoko reaches targetFrame while maintaing sync, then the test case will pass.
To update the test binary after making changes to testCases.json, be sure to re-run:
If you just want to test a single ghost, you can run:
In this scenario, Kinoko will validate the entire ghost, only passing the test if the entire ghost syncs.
While a GUI is not planned for the project at this time, contributors are welcome to add a graphics frontend under three conditions: the license must not change, it does not interfere with the CLI, and most importantly, it must not distribute any in-game assets.
You can link Kinoko to your own project using CMake by linking with the libkinoko target. For example:
Note that any project using Kinoko's include directories will also require C++23.
The codebase uses C++ for the engine and Python for any external scripts.
Pull requests resolving an issue or element of a tracking issue should reference the issue or item in the description.
Any commits should be formatted using the project's clang-format file.