Forum rules - please read before posting.

Optimization Pass

Hello everyone,

We are currently in the optimization pass phase of our game before release. I was wondering if there are any specific steps that need to or can be taken to optimize anything in AC or the set up of our project for release. We are specifically targeting mobile. The game is 2D and it isn't fairly intensive. Most of the game is walking / talking and item interactions.

Thanks in advance!

Comments

  • Additionally I am curious as to how to properly save and clean up the AC instance through code. In my specific situation I am transitioning from an AC game to a mini-game that has been built not using AC in a separate scene. I want to make sure I am saving the state and completely cleaning up AC when we switch to the mini-game for maximum memory optimization. Our target platform is mobile so this is a very crucial step for the game.
  • I'm afraid I can't offer much advice myself - AC will destroy objects itself with it's own OnDestroy() functions, so if you're switching to a non-AC scene then things should be removed automatically.  If there are some tricks I'm missing, please let me know.
  • You might look into DontDestroyOnLoad for your objects.
  • @ChrisIceBox So the first thing I tried was just simply switching scenes. I quickly realized that the PersistentEngine GameObject (as so obviously named) sticks around. So in my script I destroy the PersistentEngine GameObject first then I destroy my player character. That got rid of all the errors but left me with this one error. Any ideas on what this could be or if there is a proper way to destroy the PersistentEngine object that I don't know of?

    MissingReferenceException: The object of type 'FollowSortingMap' has been destroyed but you are still trying to access it.
  • You'll need to post the full error - that log should also contain script names with line numbers.
  • @ChrisIceBox

    MissingReferenceException: The object of type 'FollowSortingMap' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    AC.SortingMap.SortByScreenPosition (AC.FollowSortingMap o1, AC.FollowSortingMap o2) (at Assets/AdventureCreator/Scripts/Navigation/SortingMap.cs:105)
    System.Array.qsort[FollowSortingMap] (AC.FollowSortingMap[] array, Int32 low0, Int32 high0, System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Array.cs:1772)
    System.Array.Sort[FollowSortingMap] (AC.FollowSortingMap[] array, Int32 length, System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Array.cs:1699)
    Rethrow as InvalidOperationException: Comparison threw an exception.
    System.Array.Sort[FollowSortingMap] (AC.FollowSortingMap[] array, Int32 length, System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Array.cs:1702)
    System.Collections.Generic.List`1[AC.FollowSortingMap].Sort (System.Comparison`1 comparison) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:579)
    AC.SortingMap.UpdateSimilarFollowers (AC.FollowSortingMap follower) (at Assets/AdventureCreator/Scripts/Navigation/SortingMap.cs:87)
    AC.FollowSortingMap.UpdateRenderers () (at Assets/AdventureCreator/Scripts/Navigation/FollowSortingMap.cs:201)
    AC.FollowSortingMap.LateUpdate () (at Assets/AdventureCreator/Scripts/Navigation/FollowSortingMap.cs:74)

  • Double clicking on it leads me to this function in the script SortingMap.cs

    private static int SortByScreenPosition (FollowSortingMap o1, FollowSortingMap o2)
    {
    return Camera.main.WorldToScreenPoint (o1.transform.position).y.CompareTo (Camera.main.WorldToScreenPoint (o2.transform.position).y);
    }
  • Thanks - I think I have an idea what might be causing this, and will try to solve it just in time for the v1.46 update.
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.