Debugging - szapp/Ninja GitHub Wiki
Ninja provides limited but sufficient options for debugging. These are both relevant for developers creating and for players troubleshooting a patch.
Console
Ninja adds itself as command to the in-game default console. By typing Ninja into the console, version and build information of Ninja is displayed as well as a list of active patches in ascending order of their timestamps.
Entering Ninja PatchName, for any of the active patches displays a short description of the patch. This description corresponds to the VDF header comment, as mentioned in VDF Header.
Logging
As mentioned in Other Mechanics, Ninja enables the zSpy if it is open at game start and sets its logging to level five if not already higher. The filter of the zSpy is required to be set to all events including information (not just warnings and errors).
Ninja itself logs the most significant of its actions with level five. More detailed information is available at level six or higher. All messages are indicated by the unique author-prefix "J:" as well as a message prefix "NINJA:". This allows setting the text filter specifically to show Ninja messages only.
At level five (and higher) Ninja logs the following events.
- Ignored patches, order of loaded patches
- Any type of injections made by a patch
- Names of the parsed script files
- Appended output units (incl. the number of blocks before and after)
- Appended MDS files (incl. the number of new animations)
- Basic operations of Ninja (initializing, cleaning up, etc.)
More detailed information is available at level six (and higher). However, the high amount of messages will increase starting time.
- Each and every symbol that the patches overwrite
- All output units that are added
- Every attempt of Ninja to find matching source (SRC) files in patches
- Every Daedalus function call initiated by Ninja, e.g. menu initializations
These messages allow pinpointing the exact action connected to a crash or malfunction.