News Forums RAIN General Discussion and Troubleshooting Aspects mysteriously vanishing and component settings resetting

This topic contains 10 replies, has 5 voices, and was last updated by  blockcipher 3 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #40148

    Saurian
    Participant

    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!

    #40158

    Sigil
    Keymaster

    Hmmm, 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:

    1. 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.
    2. 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.
    3. 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.

    #40161

    Saurian
    Participant

    1. The inspector is unlocked
    2. No RAIN warnings or exceptions
    3. Yes, all are marked with RAINSerializableClass

    Here 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) {
    		}
    	}
    }
    #40169

    Sigil
    Keymaster

    Sorry 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 .

    #40220

    Saurian
    Participant

    Hey 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.

    #40221

    Saurian
    Participant

    So 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.

    #40343

    Saurian
    Participant

    Hi, 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?

    #40347

    Shimakaze
    Participant

    I 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.
    #40371

    ck
    Participant

    Having 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).

    #40372

    Shimakaze
    Participant

    Yes, 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.

    #40373

    blockcipher
    Participant

    Hopefully it is looked at soon. I’m having problems with it for my custom motor as well.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.