Skip to content

Debugging and Instrumentation

Isthimius edited this page Jun 22, 2026 · 2 revisions

Gondwana is built to be inspectable. It exposes lifecycle events, logging infrastructure, debug overlays, and runtime sampling hooks that make it much easier to understand what the engine is doing.


Useful built-in hooks

The engine exposes events such as:

  • PreInitialization
  • PostInitialization
  • InitializationComplete
  • BeforeBackgroundTasksExecute
  • AfterBackgroundTasksExecute
  • BeforeFrameRender
  • AfterFrameRender
  • CPSCalculated

These are excellent places to attach diagnostics. See Gondwana Engine Lifecycle for a more detailed description of the available lifecycle hooks.


Visual debugging

At the layer level you can turn on:

  • ShowGridLines
  • ShowCollisionBoxes

Those are simple but very effective when debugging alignment, tile boundaries, or collision issues.


Logging

The engine routes logs through EngineLogger, so subsystems can emit structured logs without being tied to one UI or one host.


Rendering diagnostics mindset

When debugging rendering, ask:

  • is the scene actually dirty?
  • is the change in world space or screen space?
  • did the layer enqueue a refresh rect?
  • did the view project it where I expect?
  • did the backbuffer mark the screen region dirty for presentation?

That sequence usually gets you to the answer quickly.


Where to read next

  • Gondwana/Engine.cs
  • Gondwana/Logging/EngineLogger.cs
  • Gondwana/Scenes/SceneLayer.cs
  • Gondwana/Rendering/Backbuffers/BackbufferBase.cs

Clone this wiki locally