Editor (MVP)¶
The editor authors level JSON, manages prefab instances and project assets, and runs in two modes:
Embedded (default): one
editorprocess with egui UI plus an in-process engine viewport.External engine: separate editor UI process and engine host process (
editor engine-runner) communicating over localhost IPC.
Mode selection uses this precedence:
CLI flags:
--no-embeddedforces external,--embeddedor-eforces embedded.VGE_EMBEDDEDenv var (1/true/yes/onor0/false/no/off).Saved preferences default (embedded by default unless changed in Preferences).
Launching¶
Requirements
Same prerequisites as the main engine (Rust, Vulkan where applicable).
In external mode, the editor and engine host must use the same IPC port.
Environment
Variable |
Meaning |
|---|---|
|
TCP port for editor ↔ engine IPC (default in app: 7878 if unset). |
|
Optional full path to the editor binary (or legacy standalone |
|
Overrides saved preference default. Truthy values force embedded; falsy values force external. |
|
Optional |
Commands
From the repository root:
export VGE_IPC_PORT=7878 # Linux/macOS
cargo run -p editor -- engine-runner
export VGE_IPC_PORT=7878
cargo run -p editor
On Windows (PowerShell):
$env:VGE_IPC_PORT = "7878"
cargo run -p editor -- engine-runner
$env:VGE_IPC_PORT = "7878"
cargo run -p editor
If external mode starts without an engine listening on the port, the editor attempts to spawn an engine host automatically. Resolution order is:
VGE_ENGINE_EXEpathcurrent executable path, launched with
engine-runnerlegacy sibling
engine-runner(.exe)
Startup waits up to 15 seconds for host readiness.
Embedded launch (explicit override)
export VGE_EMBEDDED=1
cargo run -p editor
Main window layout¶
Left — Library
Collapsible groups by category (Primitive, Gameplay, Environment, Utility). Click a prefab name to add a new placed instance at a default position (see Built-in prefabs).
Right — Scene
List of placed objects; click to select.
Delete selected removes the instance.
For the selection: edit name, x / y / z position, visible.
Camera prefab: extra fields fov, yaw/pitch (degrees), active (first active camera drives the engine view).
Terrain (MVP):
surface_material(voxel material id),base_height_voxels(flat slab height in world voxel units). Mode is currently flat only.
Center
Level name and Level file path (relative or absolute).
Ping engine / Retry start engine — external mode only.
Save level — writes JSON to the level file path.
Load level — reads JSON from that path.
Push to engine — always saves first, then:
external mode: sends IPC
LoadLevelFromPathto engine hostembedded mode: applies the current level in-process
Play / Stop (embedded mode):
entering Play captures engine input in the viewport and hides cursor
Escor Stop releases capture and exits Play mode
Workflow¶
Start the editor (embedded default), or start in external mode with
--no-embedded.If using external mode, start
editor engine-runnerwith matchingVGE_IPC_PORT(or let the editor spawn it).Add objects from the library; adjust transforms and terrain.
Save level to e.g.
demo_level.vge.json.Push to engine to save and apply/reload the level.
In external mode, Push requires the level path to be readable by the engine host process on the same machine.
Level file format¶
Levels are JSON documents produced by the scene crate (Level::to_json_pretty). They include:
format_version— schema version (currently 1).name— display name.objects— array of placed instances (instance_id,prefab_id,name,position[x,y,z],visible, optionalcamerafor the Camera prefab).terrain—mode(flat),surface_material,base_height_voxels.
See Built-in prefabs for stable prefab_id values.
Projects and assets¶
Project workflows are implemented and use binary .vge project files plus project-relative asset paths.
See Projects for project scaffold layout, path rules, and current capabilities.
Further reading¶
Projects — project workflow, binary
.vgefiles, path validation, and current limitations.Built-in prefabs — built-in prefab IDs and categories.
Lua scripting (ECS hooks) — Lua hooks, per-object script assets, and sandbox details.
Repository
README.md— build matrix and crate overview.agents.md— project mission and roadmap phases.