menu

NeoRey Engine and Editor

Introduction

NeoRey is my new C++ engine with an editor built using ImGui. It features hot-reload for the game DLL written in C++ and exposed to the editor as script components.

Duration: July 2025 - Present

Technologies: C++ | DirectX11 | ImGui

Role: Sole Developer

Key Features

  • Entity-Component-System (ECS) architecture with flyweight entities and templated component storages.
  • Hot-reload for game code consumed by the editor as script components through a script registry.
  • Header parsing using Python for generating C++ code from custom annotations to expose fields to the editor.
  • Runtime field reflection and ImGui widget creation based on field type.
  • Entity and component serialization with scene saving in a custom binary file format.
  • Custom physics utilities with script callbacks for collision and trigger events.
  • 3D editing with static and skeletal models imported from OBJ and FBX files.
  • 2D spritesheet animations and 3D animation with an animation controller for creating state machines.
  • Scripting API for creating and modifying components and controlling animation states.

Entity-Component-System Architecture

I used an ECS architecture for entities and components, with flyweight entities holding only a UID and script components for game code.

  • Templated component storages storing entity-component mappings based on component type.
  • Methods to get all components as ComponentBase* data from any entity.
  • Script Registry for game code to add script components at runtime and creating scripts by name.

Runtime Reflection, Exposing Fields to Editor and Entity/Component Serialization

With no built-in features for runtime reflection, I created my own system for runtime reflection which helped with exposing fields to the editor and entity/component serialization.

  • FieldDescriptor struct for storing field name, type (FieldType enum) and memory offset from component's memory address.
  • Custom header parser written in Python for generating C++ code to register fields for components based on custom [[EditorField]] annotations.
  • Widget functions to create inspector widgets based on field type.
  • Custom binary file format for saving serialized entities and components.

2D Physics

NeoRey consists of a 2D physics system with Rigidbody2D and Collider2D components.

  • Full box collisions with bounciness, friction and angular effects.
  • Options on Rigidbody2D to freeze rotation and mark entities as static, dynamic or kinematic.
  • Ability to create triggers with script callbacks for collision and trigger events.

2D Sprite Animations

NeoRey also includes a 2D sprite animation system with a editor.

  • Ability to create and editor multiple animation clips on any entity.
  • Animation editor with editor preview features.
  • Scripting API to control animation state changes.

3D Physics

NeoRey also includes a 3D physics system with Rigidbody3D and Collider3D components with similar features as the 2D animation system.

  • Full box collisions with rotation effects, bounciness and friction.
  • Options on Rigidbody3D to freeze rotation on any axis and mark entities as static, dynamic or kinematic.
  • Script callbacks for collision and trigger events.

Static and Skeletal Meshes with 3D Animations

NeoRey allows importing 3D models from obj files or fbx files as static or skeletal meshes with animations.

  • Animation editor to create animation state machines on entities with skeletal mesh components.
  • Scripting API to control animation states.
  • Custom shader for GPU skinning for skeletal meshes using bone hierarchies with weights.