Index and count must refer to a location within the buffer.

nanodeath

New member
Not sure what happened, but...BehaviorDesigner's trees seem not to be working at all anymore. I'm getting this error when starting up Unity:

Code:
ArgumentOutOfRangeException: Index and count must refer to a location within the buffer.
Parameter name: bytes
System.Text.UTF8Encoding.GetString (System.Byte[] bytes, System.Int32 index, System.Int32 count) (at <f2e6809acb14476a81f399aeb800f8f2>:0)
BinaryDeserialization.BytesToString (System.Byte[] bytes, System.Int32 dataPosition, System.Int32 dataSize) (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BinaryDeserialization.LoadField (BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.Dictionary`2[TKey,TValue] fieldIndexMap, System.Type fieldType, System.String fieldName, System.Int32 hashPrefix, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Object obj, System.Reflection.FieldInfo fieldInfo) (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BinaryDeserialization.BytesToSharedVariable (BehaviorDesigner.Runtime.FieldSerializationData fieldSerializationData, System.Collections.Generic.Dictionary`2[TKey,TValue] fieldIndexMap, System.Byte[] bytes, System.Int32 dataPosition, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Boolean fromField, System.Int32 hashPrefix) (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BinaryDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BehaviorDesigner.Runtime.Behavior.CheckForSerialization () (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BehaviorDesigner.Runtime.BehaviorManager.EnableBehavior (BehaviorDesigner.Runtime.Behavior behavior) (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BehaviorDesigner.Runtime.Behavior.EnableBehavior () (at <1cb7df59e12f495fa3a64118298c7b21>:0)
BehaviorDesigner.Runtime.Behavior.Start () (at <1cb7df59e12f495fa3a64118298c7b21>:0)

It's the only error. Unity 2018.2.17f1.
 
On the bright side, I didn't have too many changes since my last git commit, and I see if I stash my changes, the tree becomes usable again. I've uploaded the before/after source for the problematic external tree here. What stands out is the byteDataArray field in the non-working version is empty for some reason, but are otherwise pretty similar.
 
What locale are you using? Also, are you able to reproduce the exception from the version that you committed?
 
What locale are you using?

Not sure. en_US?


Also, are you able to reproduce the exception from the version that you committed?

Sure, want me to email you a copy? You can probably repro (kinda) by emptying the byteDataArray field, I bet. I have no idea how it got into that state originally, though.
 
I've added a "not working 2" that I get when removing most of the tasks. Maybe because unityObjects is empty this time?
 
unityObjects being empty is no problem. So you are able to reproduce it from your backup? If you can send me that via PM or email it would be great along with what steps reproduces the issue.
 
Top