Debug System

NihiloCore provides a small debug framework consisting of two systems: a console command subsystem for registering and executing cheat/debug commands, and a Slate-based debug overlay for displaying live messages on screen. Both are designed to be extended by other plugins and games rather than used directly.

Cheat Subsystem

UNihiloCheatSubsystem is a ULocalPlayerSubsystem base class for registering namespaced console commands. Each subclass owns a namespace — a string prefix that all of its commands are registered under. For example, a subsystem with namespace Gateway registers commands like Gateway.ResetStats and Gateway.CompleteAllChallenges.
Being a ULocalPlayerSubsystem means commands are routed to the correct player automatically in PIE multi-player sessions — the console command dispatch resolves the owning ULocalPlayer from the world context and calls into that player's subsystem instance, so there's no ambiguity about which player is being targeted.
Creating a Subclass
To create your own cheat subsystem, subclass UNihiloCheatSubsystem and override two functions: GetNamespace to return your prefix string, and RegisterCommands to register your commands on initialization.
Each command is described by an FNihiloCommandHandle, which carries the command name, a description shown in the help output, optional argument hint strings, and the delegate to execute. When the command fires, it receives an FNihiloCheatContext containing the parsed argument list, the owning ULocalPlayer, APlayerController, APawn, and UWorld — everything typically needed to act on the game state.
Help Command
Every subsystem automatically registers a Help command (e.g. Gateway.Help) that prints all commands in the namespace to the output log, column-aligned with their descriptions and argument hints. An optional filter argument narrows results by name or description substring — Gateway.Help damage would show only commands matching "damage".
Argument Parsing
Console command arguments arrive as raw strings. The base class provides GetArgOrEmpty as a safe accessor that returns an empty string rather than crashing on out-of-bounds indices. For type conversion, use the String Library parsing functions — GetInt, GetFloat, GetTag, and so on — which return false on failure rather than throwing.

Debug Overlay

The debug overlay is a Slate-based heads-up display for showing live messages during play. It follows the same pattern as the built-in GAS debug overlay: a fullscreen SNihiloDebugWidget is added to the viewport at a high Z-order with hit-test invisibility, so it never interferes with game input.
The overlay is split into two horizontal regions. The left third is a scrolling message column managed internally. The right two-thirds is a configurable content region — a custom SWidget can be passed in at construction time, giving derived systems a place to render structured debug panels, stat tables, or anything else.
Debug Subsystem
UNihiloDebugSubsystem is a ULocalPlayerSubsystem that manages overlay lifetime. It owns a map of named SNihiloDebugWidget instances keyed by FName, and exposes GetOrCreateWidget — a factory method that either returns an existing widget for a given key or creates and adds a new one to the viewport. Subclass this to build a debug overlay for your own plugin or game.
Messages
Messages are added via AddMessage on the widget. Each message has a display string, a duration in seconds, a UNihiloDebugFontType class for styling, and an optional FName key. The key system allows messages to be updated in place — calling AddMessage with an existing key replaces the text, duration, and font of the existing message widget rather than adding a new one. This is useful for values that update every frame, like a player's current speed or a stat value, where you want a single stable line rather than a flood of new entries.
Internally, message widgets are pooled. When a message expires, its widget is returned to the pool and reused for the next incoming message, avoiding per-message Slate allocations during active debugging.
Font Types
UNihiloDebugFontType is a UObject subclass that provides a font style to the message widget via GetStyle, returning an FNihiloDebugFontStyle with font info, color, and outline color. Create subclasses to define different visual tiers — for example, a warning font in yellow and an error font in red — and pass the appropriate class when calling AddMessage.