[BUG] Graph breaking bug.

NodeCanvas Forums Support [BUG] Graph breaking bug.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15030
    covis
    Participant

    This happens on latest NodeCanvas patch ( v3.0.8). Graph stops working completely, GUI doesnt show any nodes and runtime errors. New clean graphs still work.

    HOW TO REPRODUCE:
    Add connection with condition shown below. Let Unity compile and BOOM!

    I was working with code that has to do with NavMeshPath and when i added NavMeshPath to my local BB graph this started to happen.

    Here is the code i was working on and below are the errors too.

    1[T] references, System.Object instance) (at Assets/ParadoxNotion/CanvasCore/Common/Runtime/Serialization/JSONSerializer.cs:111)
    ParadoxNotion.Serialization.JSONSerializer.TryDeserializeOverwrite[T] (T instance, System.String json, System.Collections.Generic.List1[T] references) (at Assets/ParadoxNotion/CanvasCore/Common/Runtime/Serialization/JSONSerializer.cs:80)
    NodeCanvas.Framework.Graph.Deserialize (System.String serializedGraph, System.Collections.Generic.List
    1[T] references, System.Boolean validate) (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Graph.cs:150)
    UnityEngine.Logger:LogException(Exception)
    ParadoxNotion.Services.Logger:ForwardToUnity(LogType, Object, String, Object) (at Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/Logger.cs:114)
    ParadoxNotion.Services.Logger:Internal_Log(LogType, Object, String, Object) (at Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/Logger.cs:108)
    ParadoxNotion.Services.Logger:LogException(Exception, String, Object) (at Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/Logger.cs:66)
    NodeCanvas.Framework.Graph:Deserialize(String, List1, Boolean) (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Graph.cs:166)
    NodeCanvas.Framework.Graph:SelfDeserialize() (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Graph.cs:111)
    NodeCanvas.Framework.Graph:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Graph.cs:48)

    #15031
    zsoik
    Participant

    I think you’re not supposed to use non-serializable types as BBParameter variables. This happens because NC tries to create a NavMeshPath instance when it loads the graph and unity doesn’t allow that (similarly to how you can’t access some other APIs during certain points like serialization or construction). I guess you’re trying to have one action generate the path where you can store it and then re-use it in some other action to apply it. But I’m unfortunately not having an idea how this could be solved properly. I guess something in the underlying serialization logic must be changed so it does not try to persist NavMeshPath instances anywhere.

    #15035
    Gavalakis
    Keymaster

    Hey,

    It seems that the constructor of NavMeshPath apparently has code that can’t run OnAfterDeserialize. I have modified the instance generation so that it try/catches any exceptions (such as this) when constructing an object and attached the changed for you here.

    This will at least prevent the NavMeshPath (or other object construction that throws an exception) from being constructed if not able, but won’t go boom on the rest of the graph.

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

    Attachments:
    You must be logged in to view attached files.
    #15048
    covis
    Participant

    That seemed to do the trick! Thanks for help you all.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.