Corrupted Entire Behavior tree, seems irreversible

Fashtas

New member
Lucky this was only experimenting but I'd rather not lose months of work when a tree becomes entirely corrupted.
These are the steps I took as best as I can remember, only happened moments ago so hopefully it was as it happened.

I can't work out where the Tree file is stored to try and edit it manually (assuming you can) - I assume there is an empty "NAME" or something in it now causing the issues

I had a tree node "Log" called "LOG6" (Or TODO6, not sure, can't see it any more since its corrupt)
Duplicated it using Ctrl-D
Selected the new node, moved it, linked it to the node above, and selected it
Opened inspector
Selected the name, clicked Backspace and then 8

My intention was to delete the 6 of the LOG6 to change it to LOG8, what I didn't notice (I think) selecting the name highlighted the entire thing and the Backspace deleted EVERYTHING not just the 6, so I looked up and saw it said 8 not LOGr8
So I did an UNDO (Ctrl-Z) which then corrupted the Tree

At this point the Console started throwing up errors as seen below.
The Node I was editing vanished and but the link between it and the node above remained

There is a screen shot taken below, this is what it looks like when loaded now, initially it was just the node I edited that was missing and I took a screen shot using the button in Behavior Designer but I discovered that did not actually save anything. Likewise I cannot "export" the prefab, works up to the point you press SAVE then doesn't do anything.

C#:
IndexOutOfRangeException: Index was outside the bounds of the array.
BehaviorDesigner.Editor.BehaviorDesignerUtility.GetTaskGUIStyle (System.Int32 colorIndex) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.NodeDesigner.DrawNode (UnityEngine.Vector2 offset, System.Boolean drawSelected, System.Boolean disabled) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.GraphDesigner.DrawNodeChildren (BehaviorDesigner.Editor.NodeDesigner nodeDesigner, UnityEngine.Vector2 offset, System.Boolean disabledNode) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.GraphDesigner.DrawNodeChildren (BehaviorDesigner.Editor.NodeDesigner nodeDesigner, UnityEngine.Vector2 offset, System.Boolean disabledNode) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.GraphDesigner.DrawNodeChildren (BehaviorDesigner.Editor.NodeDesigner nodeDesigner, UnityEngine.Vector2 offset, System.Boolean disabledNode) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.GraphDesigner.DrawNodeChildren (BehaviorDesigner.Editor.NodeDesigner nodeDesigner, UnityEngine.Vector2 offset, System.Boolean disabledNode) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.GraphDesigner.DrawNodeChildren (BehaviorDesigner.Editor.NodeDesigner nodeDesigner, UnityEngine.Vector2 offset, System.Boolean disabledNode) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.GraphDesigner.DrawNodeChildren (BehaviorDesigner.Editor.NodeDesigner nodeDesigner, UnityEngine.Vector2 offset, System.Boolean disabledNode) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.GraphDesigner.DrawNodes (UnityEngine.Vector2 mousePosition, UnityEngine.Vector2 offset) (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.DrawGraphArea () (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.Draw () (at <4b28e19850d5443cb0dab9a889df4542>:0)
BehaviorDesigner.Editor.BehaviorDesignerWindow.OnGUI () (at <4b28e19850d5443cb0dab9a889df4542>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>: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 <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEditor.DockArea.OldOnGUI () (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
 

Attachments

  • Annotation 2020-06-24 113117.png
    Annotation 2020-06-24 113117.png
    44 KB · Views: 4
That's no good, sorry you hit that. I just tried to reproduce it but when I undo it undid successfully. One thing that you may want to do is to use JSON serialization instead of binary - this generally works better with the serialization system. This doesn't look like it's directly the cause but it may help.

In any case if you're able to repro it I can take a closer look. If you want to send that tree and related tasks to support@opsive.com I can also see if I can recover it.
 
Thanks for the reply

I've switched over to JSON but I have no idea where the Behavior Tree files are stored to send the corrupt one to you. I added the BT component to a GameObject and just edited that. Shows up in editor, that's about it :)
 
Top