Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Editor

The editor application — panels, gizmos, play mode, scene I/O.

  • Document — Khora Editor v1.0
  • Status — Authoritative
  • Date — May 2026

Contents

  1. What the editor is
  2. Workspace anatomy
  3. Modes
  4. Play mode
  5. Scene I/O
  6. Gizmos and selection
  7. The Control Plane
  8. For game developers
  9. For engine contributors
  10. Decisions
  11. Open questions

01 — What the editor is

khora-editor is a separate binary built on the SDK. It opens a project (a folder containing .kscene files and assets), authors scenes through ECS-aware panels, and previews them with play mode — a one-button switch between editing and full simulation.

The editor is not a separate engine. It uses the same agents, lanes, and ECS as a shipping game. What changes is which agents run (Editor mode runs Render, Shadow, UI; Playing mode adds Physics and Audio) and what the panels do on top of the world.

The visual language — colors, typography, panels, voice — is documented in Editor design system. This chapter covers the architecture, not the look.

02 — Workspace anatomy

+--------------------------------------------------------------+
| Title bar — brand, project name, window controls            |
+----+----------------------------------------------+----------+
|    |                                              |          |
| Sp |               Viewport                       | Inspect  |
| in |                                              | -or      |
| e  |                                              |          |
|    |                                              |          |
+----+----------------------------------------------+----------+
| Bottom dock: Assets · Console · GORNA stream                |
+--------------------------------------------------------------+
| Status bar — engine state, FPS, build status                |
+--------------------------------------------------------------+
RegionPurpose
Title barBrand, project name, window controls
SpineMode rail (Scene / Canvas / Graph / Animation / Shader / Control Plane)
HierarchyTree of entities, left of the viewport
ViewportThe 3D scene with floating gizmos
InspectorComponents of the selected entity, right of the viewport
Bottom dockAssets browser, console, GORNA stream
Status barEngine state, FPS, build status, GORNA pulse

Full anatomy and pixel-level layout in Editor design system.

03 — Modes

The Spine offers six modes:

ModePurpose
Scene3D editing (default)
Canvas2D layout and UI
GraphNode-based logic and shader
AnimationTimeline and curves
ShaderCode editor with live preview
Control PlaneEngine telemetry and GORNA stream

Each mode has its own panel layout. We commit to opinionated defaults — Unity and Unreal let you arrange panels freely, and most users keep the defaults forever. We pick the layouts users won’t want to change.

04 — Play mode

flowchart LR
    A[Editor] -->|Press Play| B[Playing]
    B -->|Press Pause| C[Paused]
    C -->|Press Resume| B
    C -->|Press Stop| A
    B -->|Press Stop| A

When you press Play:

  1. The current world is serialized using SerializationGoal::FastestLoad (Archetype strategy).
  2. The snapshot is stored in memory.
  3. The editor’s PlayMode (UI-state) becomes Playing.
  4. EngineMode switches from Custom("editor") to PlayingPhysicsAgent and AudioAgent start running, UiAgent stops.
  5. The play camera takes over from the editor camera.

When you press Stop:

  1. The editor’s PlayMode becomes Editing.
  2. EngineMode switches back to Custom("editor").
  3. The snapshot is deserialized into the world.
  4. The editor camera resumes.

The snapshot is fast — milliseconds for a 10 000-entity scene — because Archetype strategy serializes ECS pages directly. See Serialization.

AspectEditor (Custom("editor"))Playing (Playing)
Active agentsRender, Shadow, UIRender, Shadow, Physics, Audio
CameraEditor camera (free orbit)Scene cameras (active ones)
InputEditor input (gizmos, selection)Game input (player controls)
ECSMutable — user edits directlySnapshot-based — original world preserved
RenderingViewport texture + gizmos + overlayFull scene, no editor chrome

Two enums, two scopes. PlayMode (Editing / Playing / Paused) is the editor’s UI state — it drives buttons, panel visibility, and what the user sees. EngineMode (Playing / Custom("editor") / other) is the engine’s filter for agent execution. The editor application bridges them: user clicks Play → editor sets PlayMode::Playing → editor requests EngineMode::Playing from the engine.

Physics state is not preserved across play mode. Velocities, contacts, and sleep state are reset on restore. The ECS components are restored exactly; the physics world rebuilds from those components.

05 — Scene I/O

The editor uses SerializationService for all scene operations:

ActionWhat happens
Open projectEditor scans the project folder, builds the asset browser, loads default.kscene if present
New sceneEditor creates an empty world, ready for editing
Save sceneEditor serializes the world with SerializationGoal::HumanReadableDebug (Definition / RON)
Save scene asSame, with a new path
Load sceneDouble-click a .kscene in the asset browser, or File → Open

Scene files are RON in development — hand-editable, diff-friendly, useful in Git history. Release builds typically use Recipe or Archetype.

06 — Gizmos and selection

The viewport has floating gizmos for the selected entity:

  • Move — three-axis arrows + center sphere for screen-space drag.
  • Rotate — three rings, one per axis.
  • Scale — three handles + uniform-scale center.

Selection is tracked in EditorState.selected_entity. Clicking an entity in the hierarchy or the viewport sets it; Esc clears it. Selected entities get a 2 px gold inner-stroke outline (1 px dark outer stroke), visible against any background.

Numeric fields in the Inspector are draggable scrubbers — drag horizontally to change a value, modifier keys for precision. No spinner buttons.

07 — The Control Plane

The sixth Spine mode is the Control Plane — a workspace dedicated to the engine’s mind.

RegionPurpose
Lane Timeline (top)Horizontal lanes per subsystem, execution windows as colored bands
GORNA Stream (bottom-left)Live feed of negotiation: timestamp, subsystem, suggestion, accept/reject
Meters Wall (bottom-right)Frame time, GPU %, memory, agent budget, assets pending

The Control Plane is not a profiler popup. It is a first-class workspace. The whole pitch of Khora is the self-optimizing architecture; the editor surfaces that intelligence as a place you go to, not a window you launch.

Full design in Editor design system, section 09.


For game developers

You typically run the editor against your project folder:

cargo run -p khora-editor -- --project /path/to/my_project

Inside the editor, you author scenes. Each scene is one .kscene file. Spawn entities by dragging a vessel from the Assets panel into the viewport, or by right-clicking in the hierarchy → Add Entity. Edit components in the Inspector. Save with Ctrl+S.

To preview your scene in play mode, press the Play button. Your EngineApp::update runs every frame, exactly as in your shipping game.

For engine contributors

The editor is implemented as a set of EnginePlugins — each panel registers callbacks at the appropriate ExecutionPhase:

FolderContents
crates/khora-editor/src/panels/Scene tree, properties, asset browser, viewport, console, GORNA stream
crates/khora-editor/src/gizmos/Move / rotate / scale, selection outline
crates/khora-editor/src/ops/High-level scene operations (spawn, despawn, parent, add component)
crates/khora-editor/src/scene_io/Scene save / load via SerializationService
crates/khora-editor/src/state.rsEditorState — selection, mode, pending operations

To add a panel: implement the panel render function, register it as an EnginePlugin in the editor’s main plugin list. Panels read EditorState and the world; they mutate through ops/ operations to keep the action layer clear.

To add a gizmo type: add a render path in gizmos/ that draws the gizmo for the selected entity, plus an interaction handler in ops/ that converts mouse drags into Transform mutations.

The editor depends directly on khora-agents and khora-io for performance — it bypasses the SDK in places. This is a known trade-off (see Decisions).

Decisions

We said yes to

  • Editor as a separate binary. The editor is a different application from a shipping game — different lifecycle, different active agents, different input.
  • Mode-first layouts. Opinionated defaults beat infinite customization for 95% of users.
  • Play mode through scene snapshot. Press Play, run the game; press Stop, you are back where you were. No state pollution.
  • Editor reaches into khora-agents and khora-io. Pragmatic shortcut for performance. The SDK is the public API for games; the editor is privileged.

We said no to

  • Free-form panel docking. Powerful but exhausting. We pick layouts users won’t want to change.
  • Telemetry charts in the main UI. Telemetry belongs in the Control Plane mode. Scene mode shows the scene.
  • Editor chrome during play mode. Play mode is a near-shipping preview. Chrome reappears on stop.

Open questions

  1. Multi-window. How does Spine + Modes work when the user pops the viewport to a second monitor? Likely the popped window keeps its own Spine, with one mode lit.
  2. Plugin UI surface. Third-party plugins need a place to live — probably the Inspector as additional component cards, but the contract is undefined.
  3. Collaboration. Real-time multi-user editing (shared cursors, shared selections) is on no roadmap, but the architecture does not preclude it.

Next: writing your own agent or lane. See Extending Khora.