Reply To: [Design] Graph only as ScriptableObject

NodeCanvas Forums Support [Design] Graph only as ScriptableObject Reply To: [Design] Graph only as ScriptableObject

#15522
Gavalakis
Keymaster

Hello again,

Changing the whole framework to work outside of ScriptableObject will be a big endavour since the whole project is built on this all this years. I do understand that instantiating a scriptable object comes at a cost, but A) We instantiate unity objects all the time in a project. It is really not that costly and B) Instantiating any object (unity or not) comes at a close anyways 🙂
The OnAfterDeserialize callback is not useless at all, because it is utilized by the graph to deserialize itself. Whether or not that data were to be deserialized in the graph itself or in another object, such deserialization would still need o take place regardless of where that will take place.

Thus, the culprit here is the deserialization, rather than the fact that graph is a scriptable object. Deserialization is always costly, but I have really taken a great deal of effort to optimize and alter the the core framework code in use (FullSerializer) to be as fast as I can possible make it be. Furthermore, instantiation and deserialization cost of graphs can be further reduced by loading the graphs asynchronously (in a separate thread). This option for example can be enabled by setting the GraphOwner -> First Activation -> to “Async”. Just in case you didn’t know of this option 😉

Let me know what you think.
Thanks!

Join us on Discord: https://discord.gg/97q2Rjh