Storming Engine
The Storming Engine is designed as a high-performance, decoupled renderer that communicates with the Java Editor via a strict JSON-based IPC (Inter-Process Communication) protocol.
C++ Core Architecture
The engine supports two distinct operational modes, allowing for a Godot-style workflow where the Editor workspace and the Game runtime remain separate.
1. Editor Mode (--editor)
Used for the background workspace view.
- Visual Overlays: Renders an infinite grid and coordinate origin cross (Red X, Green Y).
- Selection Highlighting: Draws a yellow bounding box around the currently selected entity.
- Stateful Tracking: The engine maintains an internal
m_SelectedEntityIDto facilitate relative transformations.
2. Runtime Mode (Default)
Used for the Simulation Window.
- Clean View: No grid or editor-specific overlays.
- Performance Focused: Optimized for running game logic and scripts without editor overhead.
Core Systems
Application Lifecycle (Application.cpp)
The Application class manages the main engine loop, windowing (via SDL3), and the IPC bridge.
- Initialization: Sets up OpenGL 4.5 Core context. If launched with
--shm, it initializes aFrameBufferlinked to Shared Memory. - The Run Loop: Polls events, processes commands via a line-buffered non-blocking
STDINreader, renders the scene, and broadcasts performance stats toSTDOUTevery 500ms.
Entity Component System (ECS)
The engine uses EnTT, a fast, cache-friendly ECS library.
- Scene: Owns the
entt::registry. Handles updates, entity picking (AABB), and serialization. - Components: Pure data structures including
Tag,Transform, andSpriteRenderer.
Rendering Pipeline (Renderer2D.cpp)
A high-performance batch-oriented 2D renderer. Quads and Lines are accumulated in CPU-side buffers and uploaded to the GPU in bulk. Supports up to 16 texture slots per draw call.
Inter-Process Communication (IPC)
Commands (Java → C++)
| Action | Payload | Description |
|---|---|---|
load_scene | {"path": "..."} | Clears scene and loads entities from file. |
select_entity | {"id": 123} | Selects an entity and requests details. |
translate_selected | {"dx": val, "dy": val} | Moves selected entity. |
rotate_selected | {"da": val} | Rotates selected entity. |
scale_selected | {"ds": val} | Scales selected entity. |
request_save | {} | Requests a full JSON dump of the state. |
Telemetry (C++ → Java)
Broadcast to STDOUT with the [TELEMETRY] prefix.
| Type | Description |
|---|---|
scene_tree | The full hierarchy list. Sent on any scene change. |
entity_details | Full component state for the Inspector panel. |
telemetry | Real-time performance and renderer stats (FPS, Draw Calls). |
scene_data_dump | Raw JSON string of the scene, ready for disk writing. |
Build System
- CMake: Manages the C++ build process.
- Key Dependencies: SDL3, GLAD, EnTT, GLM, nlohmann/json.
Java Editor Architecture
Core Application Lifecycle
- EditorApp: Manages global themes via FlatLaf and handles the startup sequence.
- EngineLauncher: Handles the C++ process lifecycle, capturing logs, and shared memory image streaming via JNA.
- ProjectManager: Manages project history and automatic discovery in
~/StormingProjects.
Window Management
- MainWindow: Manages complex nested split panes and JetBrains-style sidebars.
- SimulationWindow: Dedicated debugging window with pulsating "LIVE" indicators and a performance monitor with area-graphs (FPS, CPU, GPU, Memory).
- ProjectSelector: Animated interface for "New Project" and "Open Project" actions.
- NewProjectDialog: Handles directory scaffolding and template selection.
Editor Panels & Systems
| Panel | Description | Status |
|---|---|---|
| ProjectBrowserPanel | File system explorer for project navigation. | Implemented |
| TerminalPanel | Multi-tabbed terminal using JediTerm and Pty4j. | Implemented |
| SceneViewPanel | Real-time viewport utilizing JNA shared memory. | Implemented |
| ConsolePanel | Logging interface with level-based filtering. | Implemented |
| HierarchyPanel | Scene tree navigation and object management. | Implemented |
| InspectorPanel | Property editor for scene objects. | WIP |
| Git / PR Panel | Integrated version control interface. | WIP |
Project Management & Format
The engine uses a JSON-based project descriptor with the .storm extension.
ProjectName/
├── ProjectName.storm (Project settings)
├── assets/ (Textures, scripts, and resources)
└── scenes/
└── main.storm_scene (Initial scene data)
Development Note
As outlined in the roadmap, several high-level editor systems (Git, PR, Inspector, and Analyzer) are currently in an early Work-in-Progress (WIP) state. These components serve as visual placeholders and utilize mock data to illustrate the final intended experience.