2.4 KiB
2.4 KiB
Cutscene Editor Architecture Analysis
Current System Overview
The current cutscene editor addon consists of several key components:
-
Editor Components (in
addons/cutscene_editor/editor/):CutsceneGraphEdit.gd: Main graph editor interface that manages nodes and connectionsCutsceneResource.gd: Resource for storing cutscene data (nodes, connections)CutsceneGenerator.gd: System for generating executable cutscene code from graph data- Node implementations (MoveActionNode, DialogueActionNode, etc.)
-
Runtime Components (in
cutscene/):CutsceneManager.gd: Manages execution of cutscene actionsAction.gd: Base class for all actions- Specific action implementations (MoveAction, DialogueAction, etc.)
Current Data Flow
- User creates nodes in the graph editor
- Node data is stored in
CutsceneResource CutsceneGeneratorcan convert the resource to:- GDScript code (current approach, not desired)
- JSON (potential future approach)
- Direct instantiation of runtime actions (desired approach)
Issues with Current Approach
- The addon currently focuses on generating GDScript code rather than managing a clean data structure
- The
CutsceneResourceexists but isn't fully utilized as the primary data structure - There's a disconnect between the editor representation and runtime execution
Requirements for New System
- Resource-Centric Design: The cutscene resource should be the primary data structure that both editor and runtime use
- Clean Data Structure: Store nodes and edges between slots in a structured way that can be easily serialized/deserialized
- Runtime Compatibility: The resource should contain all information needed for the runtime
CutsceneManagerto execute actions - No Code Generation: Eliminate the GDScript generation functionality
- Extensibility: Easy to add new node types and action types
Proposed Data Structure
The cutscene resource should store:
-
Nodes:
- Unique ID
- Type (entry, exit, move, dialogue, etc.)
- Position (x, y)
- Parameters specific to the node type
-
Connections:
- Source node ID
- Source port
- Target node ID
- Target port
-
Metadata:
- Version info
- Creation/modification timestamps
This structure should be directly usable by the runtime system to instantiate and execute actions.