VisualScriptingKai icon indicating copy to clipboard operation
VisualScriptingKai copied to clipboard

Use a cached database to track embedded graphs in closed scenes and prefabs

Open chocola-mint opened this issue 2 years ago • 0 comments

(Due to conscription I won't be able to work on this properly until April 2024. In meantime if anyone wants to take on this feature, feel free to do so)

This feature will allow Graph Lens and Graph Analyzer to run queries against graphs that aren't actually loaded at the time of query, enabling the use of embedded graphs.

This should be done by building a per-project database that fetches all graph data on initial creation, and then dynamically adds entries to the database as the developer adds new embedded graphs in scenes and prefabs. The database, represented by the class GraphDatabase, should support:

  • Rebuild: A heavy operation that opens every scene and prefab to extract searchable data (type information, node name, etc.) and trace data (how to "jump" to the node, similar to classes that implement IGraphElementTrace). There should also be an easy way to manually trigger Rebuild (maybe as a menu item in Tools?)
  • Save/Load: Automatically performed. GraphDatabase should be serialized and stored in a temporary folder (perhaps the built-in Temp folder?) and deserialized when the project is loaded.
  • Iterate Units/States/StateTransitions/StickyNotes: Similar to the static methods found in GraphTraversalUtility, it should be possible to easily enumerate nodes for querying.
  • Update: Dynamically update the database's contents as the currently-edited graph is changed.
  • Update Schema: GraphDatabase should contain a version field so that when the schema (ie. what fields are in each entry) is changed, the database will automatically rebuild.

Once GraphDatabase is complete, we can migrate GraphUtility's query methods to query against the database instead.

chocola-mint avatar Dec 11 '23 13:12 chocola-mint