Overview
The Deki Editor is a desktop application (Windows) that opens, edits, plays, and ships Deki Engine prefabs. It hosts the engine in-process: components you author in C++ are compiled into a plugin DLL, loaded by the editor, and instantly available in the inspector and prefab view. Modules ship as standalone DLLs alongside it, registering their components and inspector overlays through the same loading pipeline.
Panels
| Panel | What it does |
|---|---|
| Hierarchy | Multi-select object tree with drag-drop reparenting and reordering. |
| Inspector | Multi-object property editor driven by reflection. Mixed values across selections show as ---. |
| Prefab View | 2D canvas with gizmos, pan, zoom, and selection. Pixel-perfect with runtime output. |
| Asset Browser | GUID-keyed asset listing with previews. |
| Console | Filtered log output from the engine, modules, and the plugin. |
| Build | Build firmware for embedded boards, export assets to storage/, flash to device. |
| Profiler | Hierarchy, flat, and flame-graph views with memory stats. Driven by MSVC /Gh /GH function-entry hooks, no external dependency. |
| Frame Capture | Save a sequence of play-mode frames to PNG for visual debugging. |
| Font Importer | Import TTF / OTF or bake grid-based bitmap fonts. |
| Boards Manager | Configure MCU, memory, display, and peripherals for a target board. |
| Package Manager | Install, remove, or update modules from one or more registries. |
Play mode
Play, Pause, and Stop run the current prefab inside the editor. Play mode allocates a render buffer, walks the lifecycle (Awake -> Start -> Update), and renders through the exact same DekiRenderSystem::RenderToBuffer() path that runs on hardware. What you see in the editor is what the device draws.
Hot reload
When the editor window gains focus, HotReloadService diffs the source tree against the last build:
- Detects modified, added, or removed source files.
- Unloads module DLLs and the plugin DLL.
- Rebuilds via CMake.
- Reloads the new DLLs and re-registers component editors.
No editor restart, no scene reload. Module install and uninstall both trigger the same rebuild path through ForceNextBuild().
Undo / redo
Every edit goes through a command on CommandHistory. Commands support merging for continuous edits, so dragging a slider produces one undo entry, not hundreds. Multi-selection edits batch into a single ModifyMultipleComponentPropertyCommand that applies the same change across every selected object.
Selected commands:
ModifyFloatCommand,ModifyIntCommand,ModifyBoolCommand,ModifyStringCommandModifyComponentPropertyCommandand the multi-selection variantCreateObjectCommand,DeleteObjectCommandAddComponentCommand,RemoveComponentCommandReparentObjectCommand,ReorderObjectCommand
Build and flash
The Build panel reads the project’s board configuration and runs the right toolchain end-to-end:
- Generate platform CMake config.
- Build firmware for the selected board (e.g. an ESP32 via ESP-IDF).
- Export assets to
storage/in the engine’s binary formats (.dtextextures,.prefabMessagePack scenes, GUID table, baked fonts,.dtilemap/.dtilesetif Tiled is in use). - Optionally flash the firmware over USB.
The asset export step is the same one used to populate an SD card for offline boot.
Reflection-driven inspector
Component fields tagged with DEKI_EXPORT are picked up at build time by generate_metadata.py, which emits property descriptors and MessagePack deserialization for each one. The editor uses those descriptors to:
- Render the right widget per type (slider, color picker, asset picker, enum dropdown, object picker).
- Auto-resolve
AssetRef<T>properties on Awake by GUID. - Auto-resolve
ObjectRef<T>properties before Start by looking up sibling objects.
DEKI_COMPONENT(Health)
DEKI_PROP_RANGE(int, value, 100, 0, 999)
DEKI_PROP_ASSET(std::string, hit_sound, "", AssetType::Audio)
DEKI_EXPORT ObjectRef<DamageBar> bar;
DEKI_COMPONENT_IMPL(Health)
The inspector renders value as a slider clamped to [0, 999], hit_sound as an audio-filtered asset picker, and bar as an object picker filtered to objects that own a DamageBar.