Best Way to Debug Error?

NodeCanvas Forums General Discussion Best Way to Debug Error?

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15449
    bonyyousuf
    Participant

    Many times I get an error that a BBParameter is missing or some other bug has caused an exception from inside node canvas. These error messages are so vague that it is difficult to understand what is causing them. Following is an example of such an error. I was missing a required field from a conditional task and the error msg gave me no such helpful indication on what that conditional task was or which node it was happening from. I suggest two things for debugging such problem.

     

    1. Please print out the task name from which an error is thrown. For example it was my own custom task “CanSeeGameObject” was throwing this error. It would have been a lot helpful if I knew the classname/taskname of this from the error msg.

    2. There should be a way to pause Unity playmode like “Debug.Break()” whenever an error is thrown from nodecanvas. And upon selecting the graph there should be an indication of which node threw that error.

     

    Thanks

     

     

     

     

     

    (Execution Error): A required BBParameter field value named ‘targetObjects’ is not set.

    UnityEngine.Logger:Log (UnityEngine.LogType,string,object,UnityEngine.Object)

    ParadoxNotion.Services.Logger:ForwardToUnity (UnityEngine.LogType,object,string,object) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/Logger.cs:116)

    ParadoxNotion.Services.Logger:Internal_Log (UnityEngine.LogType,object,string,object) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/Logger.cs:108)

    ParadoxNotion.Services.Logger:LogError (object,string,object) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/Logger.cs:61)

    NodeCanvas.Framework.Task:Error (string,string) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/Task.cs:313)

    NodeCanvas.Framework.Task:InitializeFieldAttributes (UnityEngine.Component) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/Task.cs:290)

    NodeCanvas.Framework.Task:Initialize (UnityEngine.Component) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/Task.cs:254)

    NodeCanvas.Framework.Task:Set (UnityEngine.Component,NodeCanvas.Framework.IBlackboard) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/Task.cs:236)

    NodeCanvas.Framework.ConditionTask:Enable (UnityEngine.Component,NodeCanvas.Framework.IBlackboard) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/ConditionTask.cs:46)

    NodeCanvas.Framework.ConditionList:OnEnable () (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/ConditionList.cs:69)

    NodeCanvas.Framework.ConditionTask:Enable (UnityEngine.Component,NodeCanvas.Framework.IBlackboard) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/ConditionTask.cs:48)

    NodeCanvas.StateMachines.FSMConnection:EnableCondition (UnityEngine.Component,NodeCanvas.Framework.IBlackboard) (at Assets/Standard Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSMConnection.cs:34)

    NodeCanvas.StateMachines.FSMState:OnExecute (UnityEngine.Component,NodeCanvas.Framework.IBlackboard) (at Assets/Standard Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSMState.cs:85)

    NodeCanvas.Framework.Node:Execute (UnityEngine.Component,NodeCanvas.Framework.IBlackboard) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Node.cs:293)

    NodeCanvas.StateMachines.FSM:EnterState (NodeCanvas.StateMachines.FSMState,NodeCanvas.StateMachines.FSM/TransitionCallMode) (at Assets/Standard Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSM.cs:164)

    NodeCanvas.StateMachines.FSM:OnGraphStarted () (at Assets/Standard Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSM.cs:71)

    NodeCanvas.Framework.Graph:StartGraph (UnityEngine.Component,NodeCanvas.Framework.IBlackboard,NodeCanvas.Framework.Graph/UpdateMode,System.Action1<bool>) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Graph.cs:570)

    NodeCanvas.Framework.GraphOwner:StartBehaviour (NodeCanvas.Framework.Graph/UpdateMode,System.Action1<bool>) (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/GraphOwner.cs:214)

    NodeCanvas.Framework.GraphOwner:StartBehaviour () (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/GraphOwner.cs:207)

    NodeCanvas.Framework.GraphOwner:OnEnable () (at Assets/Standard Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/GraphOwner.cs:360)

    MightyImposter.Character.Controllers.NpcController:<Spawn>b__10_2 () (at Assets/Scripts/Character/Controllers/NpcController.cs:53)

    MEC.Timing/<_DelayedCall>d__150:MoveNext () (at Assets/Plugins/Trinary Software/Timing.cs:2182)

    MEC.Timing:Update () (at Assets/Plugins/Trinary Software/Timing.cs:316)

     

     

    #15453
    bonyyousuf
    Participant

    I’ve modified the line number 290 of task.cs as such. Now it’s much better

    return Error(string.Format(“A required BBParameter field value named ‘{0}’ is not set for {1} on {2}.”, field.Name, name, agent.name));

    #15457
    Gavalakis
    Keymaster

    Hello,

    The answer is to simply use the Graph Console 🙂

    All graph-related logs are logged in the Graph Console and all logs in the Graph Console can be clicked which will automatically open up the related graph and focus/select the related node to that specific log, which makes it super easy to locate the source of the log 🙂

    Let me know if that works for you.

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

    #15460
    bonyyousuf
    Participant

    I didn’t know about it. Thanks man 🙂

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