NPE when loading task through Editor after upgrade

thiagolr

New member
I'm trying to edit my behavior after upgrading both Unity and Behavior Designer from a very old version (from around May 2018).

Behavior Designer: 1.6.3
Unity Version: 2019.2.17f1

Code:
NullReferenceException: Object reference not set to an instance of an object
BinaryDeserialization.LoadTask (BehaviorDesigner.Runtime.TaskSerializationData taskSerializationData, BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.List`1[BehaviorDesigner.Runtime.Tasks.Task]& taskList, BehaviorDesigner.Runtime.BehaviorSource& behaviorSource) (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BinaryDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BehaviorDesigner.Runtime.BehaviorSource.GetAllVariables () (at <20126bbe51eb4fb0864ac4163de1de6e>:0)
BehaviorDesigner.Editor.ExternalBehaviorInspector.DrawInspectorGUI (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean fromInspector, System.Boolean& showVariables) (at <16f31d5e691e49bb8277da3cfa8e17e2>:0)
BehaviorDesigner.Editor.ExternalBehaviorInspector.OnInspectorGUI () (at <16f31d5e691e49bb8277da3cfa8e17e2>:0)
UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

1578832154912.png
 

Justin

Administrator
Staff member
What version of Behavior Designer was that tree created with? Depending on how old it is you may need to use an older version of Behavior Designer to open it. Do you have a prior version in source control that you can try?
 

thiagolr

New member
This was already happening with the older version (from around May 2018), the issue started when I upgraded the Unity version to the latest. Then when the issue started I upgraded to Behavior Designer latest version.

This is the error from the old Behavior Tree version:

Code:
NullReferenceException: Object reference not set to an instance of an object
BinaryDeserialization.LoadTask (BehaviorDesigner.Runtime.TaskSerializationData taskSerializationData, BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.List`1[BehaviorDesigner.Runtime.Tasks.Task]& taskList, BehaviorDesigner.Runtime.BehaviorSource& behaviorSource) (at <7ca38c0abe114e0fb0b2748158885a58>:0)
BinaryDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <7ca38c0abe114e0fb0b2748158885a58>:0)
BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <7ca38c0abe114e0fb0b2748158885a58>:0)
BehaviorDesigner.Editor.GraphDesigner.Load (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior, UnityEngine.Vector2 nodePosition) (at <4227664a44a44d05890c4625b6ae7313>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.LoadBehavior (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Boolean loadPrevBehavior, System.Boolean inspectorLoad) (at <4227664a44a44d05890c4625b6ae7313>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.UpdateTree (System.Boolean firstLoad) (at <4227664a44a44d05890c4625b6ae7313>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.OnSelectionChange () (at <4227664a44a44d05890c4625b6ae7313>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
UnityEditor.HostView.OnSelectionChange () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:239)
 

Justin

Administrator
Staff member
What version of BD did you upgrade from? I'm guessing that when you updated Unity BD didn't support .net 4 and that's the default now for Unity. If you send me your tree I can try to salvage it, but the runtime source is also available if you want to take a closer look.

 

Justin

Administrator
Staff member
Ah, 1.5.8 is extremely old and the serialization has changed a lot since then. Unfortunately I can't recover those with the current version. I wish that the Asset Store had a way to download prior versions but if you incrementally update from 1.5.8 to later versions it should work. If you send an email to support@opsive.com I can send you links to some of the prior versions.
 

thiagolr

New member
I just sent an e-mail to you!

I'm on the Unity latest version and with BD 1.5.8. You are suggesting to upgrade incrementally from this state, is that it? Or do I need to rollback the Unity version as well?
 
Top