News › Forums › RAIN › General Discussion and Troubleshooting › Aspects mysteriously vanishing and component settings resetting
Tagged: custom classes, Serialization
This topic contains 10 replies, has 5 voices, and was last updated by blockcipher 3 months ago.
-
AuthorPosts
-
March 4, 2022 at 2:18 am #40148
Recently, the aspects on my entities seem to spontaneously disappear without any rhyme or reason. I’ll re-add them, and sometimes they stay for a while, other times they’re gone within a minute. It’s bizarre and very frustrating-it wasn’t happening too much before, but now is happening very frequently and I can’t figure why. Also, sometimes the settings on my AIRig components will mysteriously reset to their defaults — this doesn’t happen nearly as much, although it’s more of a pain to fix. I should probably mention I’m using custom Aspects, Sensors, SensorManager, Navigator, and Motor, though I don’t suspect that has anything to do with it. Has anyone seen these bugs before?
Thank you!March 4, 2022 at 12:09 pm #40158Hmmm, sounds like something is going on with the serialization, or at least that would explain why things would go back to their defaults, or a previous state.
So a few things to check:
- I’ve found that locking the inspector can cause problems with changes being saved properly, so if it is locked, unlock it, and see if the issues remain. If you don’t know what I’m talking about then it probably isn’t the issue.
- Are you getting any console errors or warning from RAIN at all? If there are types it can’t serialize, or something we didn’t foresee, it is possible it wouldn’t save right.
- For any of your custom classes (that inherit from RAIN classes), do you have them marked with a RAINSerializableClass attribute at the top? Currently we require this to be on any classes that need to be serialized (I’m looking into removing it from inherited cases though, as that doesn’t make sense).
If none of these things apply, perhaps you can post your custom aspect code and I can take a look to see if anything might throw it off.
March 4, 2022 at 6:55 pm #401611. The inspector is unlocked
2. No RAIN warnings or exceptions
3. Yes, all are marked with RAINSerializableClassHere is the custom aspect code:
using RAIN.Core; using RAIN.Serialization; using UnityEngine; namespace RAIN.Entities.Aspects { [RAINSerializableClass] [RAINElement("Saurian Aspect")] public class SaurianAspect : RAINAspect { public const string cnstAspectType = "saurian"; public override string AspectType { get { return "saurian"; } } public SaurianAspect() { } public SaurianAspect(string aAspectName) : base(aAspectName) { } } }
March 11, 2022 at 12:51 pm #40169Sorry for the late turn around. Everything you’ve said sounds fine.
Do they happen to be prefabs? That can cause problems if you have custom editors for your RAIN items. Usually that will manifest itself pretty quickly though (generally right when you play and they revert all their settings).
If you aren’t using or overriding a RAIN editor it wouldn’t be that though and I’m out of ideas at the moment .
March 19, 2022 at 8:42 pm #40220Hey Sigil, it stopped for a while but now it’s happening again. Yes, it also appears to affect prefabs, so I have to manually re-enter all my settings each time. Often, once I’ve finished resetting the values for a prefab, it just resets again mysteriously, and is very frustrating. It’s sometimes (but not always) accompanied by Visual Studio asking me to reload the project if that’s helpful at all.
March 19, 2022 at 9:40 pm #40221So it seems to go away after I reset prefabs for my objects when I finish setting their values — the first time I drag them to the appropriate prefab, the values on an AIRig and Entity usually all reset, but the second time they tend to stay and the prefab gets corrected. I repeated this for all of my AI and this general approach seemed to work. This is still very time consuming though.
May 2, 2022 at 10:48 pm #40343Hi, any ideas on this problem? This problem has been extremely frustrating and time-wasting for me. Where is all the component info stored? Is there at least a specific file I can look to back up to roll back on when this happen, if there’s going to be no fix?
May 5, 2022 at 1:58 am #40347I meet the same problem 100% when code has some error!
I think problem is in RAINScriptableObject.
But I can’t debug it because i do not have any source code.- This reply was modified 3 months ago by Shimakaze.
May 9, 2022 at 2:24 pm #40371Having the exact same issue with a custom RAINMotor class. Unfortunately that makes RAIN AI unusable for production builds as the serialization resets randomly. And with Rival Theory focusing their time and attention on Sentio, I doubt there’s going to be a fix for it soon (if ever).
May 9, 2022 at 7:52 pm #40372Yes, I think so.
If this bug can’t be fixed,
this AI package is almost useless since all constructed data will reset in one day.May 10, 2022 at 1:00 am #40373Hopefully it is looked at soon. I’m having problems with it for my custom motor as well.
-
AuthorPosts
You must be logged in to reply to this topic.