ECS Tool

C++ EnTT Dear ImGui Vulkan Gateware Data Oriented
Team Size1
Development Time1 month
The ECS Tool editor running a solar system scene, with Inspector, Entities tree and Console panels

Contributions

Self-registering component reflection Entity hierarchy with drag and drop reparenting Inspector for editing a selected entity Local matrix composition per entity
Dear ImGui layer over a Vulkan renderer Console with per-severity filtering Free-look editor camera Solar system scene for stress testing

Component Reflection
  • Components declare themselves through a macro that registers the name against its type before main ever runs.
  •  
  • The Components panel reads straight from that map, so a new component turns up in the editor without the UI knowing anything about it.
  •  
  • Each registration prints on startup, which makes it obvious when something never got pulled into the build.
The component registry and the macro that auto-registers each component
Entity Hierarchy
  • The Entities panel rebuilds the parent and child tree each frame from the parent ID stored on every Transform.
  •  
  • Anything without a valid parent counts as a root, and the panel draws down from there recursively.
  •  
  • Every row is labelled with the entity name and its raw ID, which makes lining it up against the Inspector straightforward.
The tree node drawing code, including its drag and drop payload
Reparenting
  • Rows in the tree are both drag sources and drop targets, so an entity is reparented by dragging it onto another one.
  •  
  • Here Saturn has been dropped under Mars, and Jupiter under one of Saturn's own moons. Nonsense astronomically, but it proves the links rebuild wherever you put them.
  •  
  • Orbits follow whatever they are attached to, so a moved planet takes its moons with it.
The entity tree after dragging Saturn under Mars and Jupiter under a moon
Transforms
  • Each entity builds its own local matrix from translation, rotation and scale.
  •  
  • Rotation is composed one axis at a time in radians, then multiplied together as pitch, yaw and roll.
  •  
  • Gateware's math library does the work here, which kept the tool consistent with the rest of my Gateware projects.
Building a local transform matrix from translation, rotation and scale
Console and Diagnostics
  • Log entries carry a severity of Debug, Warning or Error, each with its own checkbox filter.
  •  
  • Entries live in the registry's context, so any system can log without being handed a pointer to the console.
  •  
  • Severity also drives the text colour, so an error stays findable in a long list.
The logging system, filtering by severity and storing entries on the registry

The editor on launch, with the solar system scene loaded.

ECS Tool editor on launch

Saturn dragged under Mars, and Jupiter under one of Saturn's moons.

Reparented entity tree

The macro that registers every component by name before main runs.

Component registry source

Drawing a tree row, and making it a drag and drop target.

Entity node drawing source

Composing an entity's local matrix from its transform values.

Local matrix composition source

Severity filtering, and logs stored on the registry context.

Logging system source