Forum rules - please read before posting.

How to Avoid Mini-Freezes During Auto-Save?

Hi everyone,
I’ve noticed a small freeze or hitch when the game performs an auto-save.
I’ve already enabled the "Save in a separate thread" option in the settings, but it doesn’t seem to fully solve the issue.

Are there any additional steps I can take to optimize the auto-save process and make it feel smoother?
Any advice or best practices would be greatly appreciated!

Thanks in advance!

Comments

  • Nevermind, now its working, however, I’m getting this error in the Editor only:

    InvalidOperationException: EnsureRunningOnMainThread can only be called from the main thread  
    UnityEngine.Object.EnsureRunningOnMainThread () (at <84f0d810adef4e6c8deab33e4ae93f7c>:0)  
    UnityEngine.Object.GetInstanceID () (at <84f0d810adef4e6c8deab33e4ae93f7c>:0)  
    UnityEngine.Object.IsNativeObjectAlive (UnityEngine.Object o) (at <84f0d810adef4e6c8deab33e4ae93f7c>:0)  
    UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) (at <84f0d810adef4e6c8deab33e4ae93f7c>:0)  
    UnityEngine.Object.op_Implicit (UnityEngine.Object exists) (at <84f0d810adef4e6c8deab33e4ae93f7c>:0)  
    AC.SaveSystem.CreateVariablesData (System.Collections.Generic.List`1[T] vars, System.Boolean isOptionsData, AC.VariableLocation location) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1948)  
    AC.RuntimeVariables.SaveMainData (AC.MainData mainData) (at Assets/AdventureCreator/Scripts/Variables/RuntimeVariables.cs:211)  
    AC.SaveOperation.SendSaveToFile () (at Assets/AdventureCreator/Scripts/Save system/SaveOperation.cs:148)  
    System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <ed969b0e627d471da4848289f9c322df>:0)  
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <ed969b0e627d471da4848289f9c322df>:0)  
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <ed969b0e627d471da4848289f9c322df>:0)  
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <ed969b0e627d471da4848289f9c322df>:0)  
    System.Threading.ThreadHelper.ThreadStart () (at <ed969b0e627d471da4848289f9c322df>:0)  
    UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)  
    
  • Thanks for the bug report. What are your AC / Unity versions? I'll attempt a recreation.

  • I'm actually on unity 6000.0.34f1 and AC version is 1.82.3.

  • Thanks. Are you making use of any Global Variables of the type either Game Object or Unity Object?

  • edited January 24

    Yes, I have a GameObject and a Unity object, but I'm not using them for now. I'm keeping them as placeholders to remind myself and later decide whether to implement what I need. They are completely empty and have nothing assigned, empty Link To even.

  • Recreated. This issue will occur if variables of either type are present when saving on a separate thread.

    The "Find references" option in their cog menus can be used to check if they have no external references and are save to temporarily delete. I will address this as part of the next update - apologies for the trouble, and thanks for the bug report.

  • Hi there,

    No problem at all! I'm happy to have been able to help in some way. Thank you for addressing the issue and for your support.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.