Debugging

Log files, Urho3D utilities, and tips for common problems.

Log File

Urho3D writes to GalaxyEggbert.log in the working directory (configured in GalaxyEggbertApp::Setup()). Check this first on any crash or unexpected behaviour.

tail -f cmake-build-debug/bin/GalaxyEggbert.log

Debug Build

Always debug with a Debug build — it enables Urho3D's internal assertions and has no optimisations that mask bugs:

cmake -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug
cmake --build cmake-build-debug

Urho3D Debug Renderer

Urho3D provides a DebugRenderer component that can draw AABBs, lines, and text in the 3D view. Add it to the scene and use it to visualise Blupi's hitbox or chunk boundaries:

// In CreateScene():
scene_->CreateComponent<DebugRenderer>();

// In Update():
DebugRenderer* dr = scene_->GetComponent<DebugRenderer>();
BoundingBox bb(pos - Vector3(0.35, 0, 0.35), pos + Vector3(0.35, 1.4, 0.35));
dr->AddBoundingBox(bb, Color::GREEN);

Unit Tests

The 54-test suite in tests/GalaxyEggbert/Worlds/ covers the engine-agnostic data model. Run before and after changes:

cd cmake-build-debug
ctest --output-on-failure -R Worlds

Common Problems

SymptomLikely CauseFix
Black screen, no geometry No level file found and BuildDemoWorld() failed Check Content/Data/Level/ exists and contains at least one scene0N.txt
Blupi falls through floor Block coordinate offset wrong (kWCX/kWCZ) Verify IsSolid() uses the correct offset formula
Objects not appearing Decor pool full (all 100 slots occupied) Reduce object count in level or increase kMaxObjects
Sound not playing SoundManager::enabled_ is false, or WAV file missing Check gameData_.sounds() flag; verify Content/Data/Sound/sound0NN.wav exists
Save not persisting Write path has no permission or IDBFS not synced (Web) Check permissions for ~/.local/share/galaxy-eggbert/
Test suite fails to compile GoogleTest not found Run git submodule update --init

GDB Quick Start

cd cmake-build-debug/bin
gdb ./GalaxyEggbert
(gdb) run
# On crash:
(gdb) bt