News › Forums › Troubleshooting › Corruption Errors of AIRig
Tagged: AIRig error corrupt
This topic contains 4 replies, has 2 voices, and was last updated by CodersExpo 7 months ago.
-
AuthorPosts
-
June 5, 2022 at 9:11 pm #27011
I’m not encountering errors with my AIRig, that crop up when the game is Run and then irreversibly corrupt my AIRig properties. It will reset everything in the rig back to the default settings (removing all Senses, animations, etc.). The errors I see in the console are first a few of these:
ArgumentException: Object type UnityEngine.Transform cannot be converted to target type: UnityEngine.CharacterController Parameter name: val System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoField.cs:133) System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150) RAIN.Serialization.FieldSerializer.DeserializeClassFromElement (RAIN.Serialization.ObjectElement aParent, System.Object aObject) RAIN.Serialization.FieldSerializer.DeserializeReferenceFromElement (Int32 aRefIndex, System.Type aType, System.Object aValue, System.Object& aResult) RAIN.Serialization.FieldSerializer.DeserializeTypeFromElement (RAIN.Serialization.ObjectElement aElement, System.Type aType, System.Object aValue, System.Object& aResult) RAIN.Serialization.FieldSerializer.DeserializeFieldFromElement (RAIN.Serialization.ObjectElement aParent, System.String aFieldName, System.Type aFieldType, System.Object aFieldValue, System.Object& aFieldResult) RAIN.Serialization.FieldSerializer.DeserializeClassFromElement (RAIN.Serialization.ObjectElement aParent, System.Object aObject) RAIN.Serialization.FieldSerializer.DeserializeReferenceFromElement (Int32 aRefIndex, System.Type aType, System.Object aValue, System.Object& aResult) RAIN.Serialization.FieldSerializer.DeserializeTypeFromElement (RAIN.Serialization.ObjectElement aElement, System.Type aType, System.Object aValue, System.Object& aResult) RAIN.Serialization.FieldSerializer.DeserializeFieldFromElement (RAIN.Serialization.ObjectElement aParent, System.String aFieldName, System.Type aFieldType, System.Object aFieldValue, System.Object& aFieldResult) RAIN.Serialization.FieldSerializer.DeserializeClassFromElement (RAIN.Serialization.ObjectElement aParent, System.Object aObject) RAIN.Serialization.FieldSerializer.DeserializeRAINObject (System.Object aComponent) RAIN.Core.RAINComponent.UpdateSerialization () RAIN.Core.RAINComponent.Awake () RAIN.Core.AIRig.Awake ()
Followed by a bunch of these:
Argument is out of range. Parameter name: index at System.Collections.Generic.List`1[System.Object].CheckIndex (Int32 index) [0x00013] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:419 at System.Collections.Generic.List`1[System.Object].set_Item (Int32 index, System.Object value) [0x00000] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:637 at RAIN.Serialization.FieldSerializer.RemoveReference (Int32 aRefIndex) [0x00000] in <filename unknown>:0 at RAIN.Serialization.FieldSerializer.RemoveFieldElement (RAIN.Serialization.ObjectElement aParent, RAIN.Serialization.ObjectElement aChild) [0x00000] in <filename unknown>:0 at RAIN.Serialization.FieldSerializer.SetArrayCount (RAIN.Serialization.ObjectElement aElement, IList aList, Int32 aCount, IList& aResult) [0x00000] in <filename unknown>:0 at RAIN.Serialization.FieldWalker.SetArrayCount (Int32 aCount) [0x00000] in <filename unknown>:0 at RAIN.Serialization.FieldWalker.ValidateElements () [0x00000] in <filename unknown>:0 at RAIN.Serialization.FieldWalker.FirstChild () [0x00000] in <filename unknown>:0 at RAIN.Serialization.FieldWalkerList.FirstChild () [0x00000] in <filename unknown>:0 at RAINEditor.Perception.RAINBasicSensesEditor.DrawInspector (System.String aLabel, RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.TypeEditors.RAINTypeEditor.DrawFieldForInspector (RAINEditor.Core.RAINComponentEditor aEditor, System.String aLabel, RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.TypeEditors.RAINTypeEditor.DrawFieldForInspector (RAINEditor.Core.RAINComponentEditor aEditor, RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.TypeEditors.RAINTypeEditor.DrawFieldForInspector (RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.Core.AIEditor.DrawInspector (System.String aLabel, RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.TypeEditors.RAINTypeEditor.DrawFieldForInspector (RAINEditor.Core.RAINComponentEditor aEditor, System.String aLabel, RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.TypeEditors.RAINTypeEditor.DrawFieldForInspector (RAINEditor.Core.RAINComponentEditor aEditor, RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.Core.AIRigEditor.DrawComponentForInspector (RAIN.Serialization.FieldWalkerList aWalker) [0x00000] in <filename unknown>:0 at RAINEditor.Core.RAINComponentEditor.OnInspectorGUI () [0x00000] in <filename unknown>:0 UnityEngine.Debug:LogError(Object) RAINEditor.Core.RAINComponentEditor:OnInspectorGUI() UnityEditor.DockArea:OnGUI()
Sometimes I can revert the prefab, and it will work until I make further modifications, but I now have some prefabs that will trigger these errors immediately upon being reverted (and so I have essentially lost all the data in those AIRigs).
I will attempt to dig into the serialization data inside the prefab to see if I can see anything, but this is a major problem if my AI’s will be so vulnerable to corruption and loss of hours of work.
Any help you can give would be appreciated. ThanksJune 5, 2022 at 9:28 pm #27015Well, my problem stemmed from the fact that my CharacterController had been accidentally deleted from my character’s root GameObject. It was user error for sure, but it would probably be good if the RAIN deserialization logic would be a little more robust for these edge-cases, so that it doesn’t throw away the entirety of the AIRig data.
June 5, 2022 at 9:31 pm #27016So what exactly are the steps you’re doing before this occurs. I assume you have a model that you set AI up and then make it a prefab and it then fails. Is that correct?
June 5, 2022 at 9:37 pm #27018Those are the steps, but also along the way the CharacterController was removed from the root GO, but the AIRig was still referencing that CC (or at least the transform of that root GO). The deserializer probably just needs to do some sanity checks with that CC reference, to make sure the component really exists and is a CC. And if not, then it will revert to BasicMotor, but continue deserializing without major error/corruption of the remaining data.
June 5, 2022 at 10:33 pm #27024I agree a more graceful recovery and message would be nice. I think the problem is when the AIRig is being de-serialized the error is thrown up the stack rather than continuing. Thus all your settings are there but just can’t be de-serialized because of the error not allowing the process to continue.
Question is can the process continue without that component being de-serialized properly. The AIRig initialization process may have a number of other steps that depend on the expected component type. Another good question for the Rival Theory team.
-
AuthorPosts
You must be logged in to reply to this topic.