Forum rules - please read before posting.

Slow load on Android using AC scenes

I noticed load time for AC scenes is very slow on Android.  No issue on windows
I'm using Unity 5.6 and latest AC.


To get to basic problem scene without AC GameEngine object and it loads quickly.

A scene with the GameEngine and just one text objects takes more than 12 seconds to load.   I have older AC game on the Android device and it does not have that issue, but I think the GameEngine wasn't use at that time.


So it seems delay is due to the init of the scripts. 

Any thoughts?

John



Comments

  • Do you have any hotspots or anything else in the scene?
  • No.   Just text that says loading.  Without the AC GameEngine object the scene loads quickly.  I suspect whatever AC does in the Awake methods, etc of those scripts might be heavy for the tablet as no issues on windows laptop.  Anyway I'll have to see if I can code around. 
  • To get around issue I created a non AC scene that just has a image, text and a script to load my first AC scene.  This way the user doesn't get into issue with long blank screen.  

    Always fun trying to get things to work on non PC devices.


  • edited April 2017
    Alright. I do think that 12 seconds is a little too much (I've used AC  on an HTC cell before and I don't recall it taking that long).
    Problem is, it's hard to know how every mobile device is going to react. So yeah, it' always, always
    battle to deal with mobile. lol. Just glad you found a way to mask it.
  • Yes, having an interim "startup" scene is a good idea.

    Also be aware that there are a number of performance tips in the Manual's Section 13.6 - these are especially relevant when building to mobile.
  • Yeah I did try those tips and a number of suggestions on the internet, but still finding scene loading very slow.  Not sure what is going on when the scene is loading but sure slow.   Might be my device so I'll have to do some testing, but if anyone has any tips on how to track down this issue on an AC scene I'd appreciate it. 
  • You can use Unity's Profiler to detect your game's largest script processes.  Unity has an "Autoconnect profiler" feature when building, so you should be able to see these live at the time of the slowdown.

    If you can learn what's causing the slowdown from the Profiler, post your findings here and we may be able to help further.
  • I don't think the starts until scene is loaded?  Or does the autoconnect profiler get around that. The game performs well after the load, just not sure why load of the AC scene is taking 45 seconds. Anyway I'll give the proflier a try tonight.
  • I ended up removing one of the optional player characters and that reduced load time by about 7 seconds.  Not sure why as player not in the scene just in the Settings as a player the user can switch too later in the game.  Doe the fact the extras players defined in the AC settings cause AC to do something even though only one is loaded in the scene?   
  • Removed it as in unset it from the field in the Settings Manager?

    AC won't refer to the prefab in any operations until it needs to switch player, but having the player reference stored in an asset will mean Unity has it's own record of it on startup.  This slowdown will likely be a byproduct of the way Unity handles its referenced assets, in that case.  Is the data associated with the player particularly large?
  • Thanks for the info.
    The players have about 20K vertexs and does perform well once the game gets loaded.  They do have about 41 textures which might be an issue.  I did reduce the size of the materials and used crunch but that didn't make much of a difference. The only extra script is a ragdoll script from the Unity Store. That might be an issue. Anyway I think I'll try using some generic char to see if I can narrow down the issue.  Regards John
  • 41 texures?? you should try using texture atlases instead. This is specially important if your planning to release on mobile. I'd at least try to reduce the texture amount to two or three using atlasing.
  • Thanks I'll check into that.   I just find odd the game plays well, just the scene load is slow.  Mobile certainly is a bit of a challenge.
  •  I did convert to using atlas and reduced meshes but game load is still bad.  Game plays a lot better but load is ugly.  Will try on another device as tablet is older and may have issue.
  • FYI: 
    Finally back a bit more testing.  I removed all players and big improvement so confirmed something to do  with the players. They perform very well once game is running so don't think that's the issue.

    Disabled all non AC scripts on players.   Didn't help so seems just Unity overhead of having multiple players defined and seems to in direct proportion to number of players. ie:  It's taking 7 sec per player defined in the AC settings. I get the impression Unity is doing something with them because it finds them in the resource folder but that is a requirement for AC players I'm kind of stuck for now

     
     
  • Well after a bit more digging with a tool that show references. Found players had references to materials other than the Atlas.  The tool that made the atlas turned off the original mesh renders but I guess it still referred to the original materials.   I deleted those meshes and the materials.  The build was smaller and scene activation was faster.  Still long but about half so going in the right direction.  
  • AC no longer requires that player prefabs be placed in a Resources folder.  The demo game players are kept there because Unity gets fussy if Asset Store files are moved around by the author, but its not necessary for your own to be there.  Is there an old tutorial or something that still mentions this as a requirement?
  • Ok. It was probably something I read in earlier version.  Anyway I finally got things down to an acceptable level when I got rid of the disabled meshes in the characters. A bit strange but happy it works better.  I did put game up on google.  It's called Slap The Bull if you want to take a peek at it.  I will be putting up a Windows version shortly and of course it works a lot better.
    Thanks for your help.
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.