mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 06:45:33 +00:00
2.9 KiB
2.9 KiB
Bullet Script Graph Editor Plan
Goals
- Create an editor plugin in GDScript using
GraphEditandGraphNodefor visual authoring of bullet scripts. - Support opening from
BossScript,BossPhase,BulletScript3D, orBulletScript. - Visualize parent/child pattern relationships as linked graph nodes.
- Keep legacy
BossPhase.Patternsintact to avoid breaking existing compositions. - Introduce
BossPhase -> BulletScript3Dfor flexible composition. - Persist graph layout metadata so graph positions remain stable across sessions.
Existing System Summary
BossScriptcontains phases:Scripts/Resources/ScriptableBullets/BossScript.cs.BossPhasecurrently executes legacyPatterns(Array<AttackPattern>):Scripts/Resources/BossPhase.cs.BulletScript3DandBulletScriptare standalone pattern containers:Scripts/Resources/BulletScripts/BulletScript3D.csScripts/Resources/BulletScript.cs
- Pattern composition already exists with:
- Sequential group:
Scripts/Resources/PatternGroup.cs - Parallel group:
Scripts/Resources/ScriptableBullets/ParallelPatternGroup.cs
- Sequential group:
Non-Breaking Runtime Changes
- Add
[Export] public BulletScript3D BulletScript3D;toBossPhase. - Keep
Patternsunchanged and mark as legacy with a TODO comment. - In
BossPhase.StartandBossPhase.UpdatePhase, prioritizeBulletScript3Dexecution when assigned. - Fall back to legacy
Patternspath whenBulletScript3Dis not assigned. - Add null/empty guards for robust editor/runtime behavior.
Plugin Architecture
- New addon:
addons/bullet_script_graph_editor/ - Main files:
plugin.cfgplugin.gd(EditorPluginentry)inspector_plugin.gd(open-in-graph button in inspector)ui/graph_editor_dock.tscnui/graph_editor_dock.gdmodel/graph_adapter.gd
Entry Points
- Bottom dock panel for direct resource picking/opening.
- Inspector button for fast open from selected resource.
Graph Mapping Rules
BossScript-> phase chain nodes.BossPhase->- legacy pattern chain lane from
Patterns - optional linked
BulletScript3Dlane.
- legacy pattern chain lane from
BulletScript3D/BulletScript-> ordered pattern chain.PatternGroupandParallelPatternGroup-> composite nodes with child links.
Persistence
- Store node graph position metadata on resources using editor metadata keys.
- Use stable node IDs to restore positions across reopen.
Validation Checklist
- Enable plugin and confirm dock is visible.
- Open
Resources/BossPhases/Rumia_Boss_Script_3D.tresand verify phase/pattern graph. - Open
Resources/BulletScripts/Danmaku_Room_1.tresand verify pattern chain graph. - Save, reopen, and verify node positions persist.
- Run build:
dotnet build k:/godot/cirno/Cirno.csproj -c Debug -v normal -p:GodotTargetPlatform=windows
Out-of-Scope for Initial Cut
- Removing legacy
Patterns. - Full simulation/debug playback inside the graph UI.
- Automatic bulk migration of all existing resources.