Editor & Workflow

Using the integrated editor, play modes, and package management.

Editor Overview

The editor uses Dear ImGui + ImGuizmo. Typical workflow:

Core Editor Areas

  • Launcher - Create or open a project.
  • Hierarchy - Scene object list, parent/child relationships.
  • Inspector - Edit components and run script inspectors.
  • File Browser - Browse assets and run context actions (compile scripts, import models, etc.).
  • Viewport - Scene editing with gizmos.

Play, Spec, Test

The engine differentiates between edit mode and runtime simulation:

  • Scripts run only in Play/Spec/Test to avoid edit-time side effects.
  • PhysX simulation runs when playing or in spec mode.
  • 2D simulation can run in play/spec/test.

Mode Descriptions

  • Play - Full game simulation with all systems active.
  • Spec - Spectator mode for testing without player control.
  • Test - Editor testing mode for script development.

Script Compilation

In the editor, scripts can be compiled from:

  • File browser context menu
  • Script component menu in the inspector

Packages & Dependencies

The package manager is designed for script build dependencies:

  • Registry-based with built-in and optional external packages.
  • Installed packages contribute include directories, defines, and link libs.
  • Per-project manifest is stored in packages.modu.

Package Features

  • Include Directories - Header paths added to compilation.
  • Preprocessor Defines - Macros defined during compilation.
  • Link Libraries - Libraries linked during script build.

Engine Loop

From Engine::run, the core flow is:

  1. Poll events and check for project/scene loads.
  2. Update viewport focus and camera controls.
  3. Update scripts (Play/Spec/Test only).
  4. Update player controller + 2D physics + camera follow.
  5. Update animations and world transforms.
  6. Step PhysX if enabled and active.
  7. Render editor and game views.

This loop keeps edit-time changes isolated from runtime simulation.

Extending the Engine

Common extension points for adding custom functionality:

Custom Components

  • Add new components in SceneObject.h + serialization in ProjectManager.cpp.
  • Register component types and properties in the editor.

Rendering Features

  • Add new rendering features in Rendering.*
  • Extend material properties and shader overrides.
  • Implement custom post-processing effects.

Script APIs

  • Add new script APIs in ScriptRuntime.* and ScriptRuntimeCAPI.h for native scripts.
  • Extend managed bindings in ManagedBindings.* for C# scripts.
  • Create custom ImGui editor windows via script exports.