Forum rules - please read before posting.

ActionLists causing slow scene load on older machines

Hey friends! :D

I'm working on some perf issues on older machines as I prepare for release (!). I have a scene that takes ~30 seconds to load on one test machine (that was mid-range 3 years ago), but if I delete all the action lists (there are ~240, because lots of things to examine), it takes ~5 seconds. I'm basically wondering if anyone has thoughts on what would be causing the slow load? Would it be purely just the matter of having that many objects? I'm not well versed in Unity lifecycle and I don't 100% know the AC code yet, but it doesn't look like the ActionList#awake does anything too intensive. I was speculating that there was some operation over all Actions that blew up with a bunch of actions, but I'm not seeing that.

Worth noting, I'm still on 1.52a, because I branched the AC code a fair bit, primarily to fix bugs around varying resolutions (nothing I'd expect to cause perf issues, just tweaking pixel positions and the like), so I've been hesitant to merge back into the mainline when everything else has been working great.

Cheers, and thanks yall!
Adam

Comments

  • If you find bugs with AC, it's always better to report them here so that they can be fixed officially.  The latest release fixed various issues with menu scaling and also boosted performance in a few key areas.

    My own testing shows a similar slowdown - but it doesn't appear to be related to the code itself, as disabling the ActionList's Awake function and removing AC's GameEngine / MainCamera has no effect.  Disabling the Hierarchy icons in the Settings Manager, however, does at least improve performance in the Editor.

    240 ActionLists seems quite an excess.  I would recommend looking into ActionList parameters, if you haven't already.  Parameters are a way of recycling the same set of Actions to perform the same set of tasks slightly differently - for example, walking somewhere, turning, and moving something to the inventory.  It may be that many of your interactions can rely on parameters to reduce the number of ActionLists needed.

    The other thing you can do is move your ActionLists to asset files, to reduce the number of GameObjects in your scene file.  A Cutscene can be converted to an asset file via the cog icon in it's Inspector.
  • I did report them officially, and we had a discussion about whether or not they could be fixed without breaking back compatibility in how menus worked, and we concluded that I should just fix things for me while you thought more about to what extent things could be safely fixed in general. :)

    ActionLists parameters seem pretty cool, but how do they reduce the number of ActionLists? Even if I have 5 very similar ActionLists, and I replace them with 5 ActionLists containing a call to a parameterized ActionList, I haven't reduced the number of ActionLists? Seems like the number of Actions could be reduced though.

    I'll try converting to asset files. Thanks so much for the ideas, Chris!
  • 240 ActionLists being considered quite an excess makes me wonder if I've approached something very wrong. If you consider a building with a dozen rooms and dozen items to examine in each room, you're at 144 ActionLists before adding anything else. Should I be structuring things very differently?
  • Apologies - I forgot our previous discussion.

    Just for management's sake, I'd recommend placing each room in a different scene if you can.  You can use the Scene: Add or remove Action to load in different rooms without changing scene if you want seamless transitions between them.

    My testing showed that the number of Actions present in each ActionList also had an effect - I think it's more the total number of Actions present, in which case parameterising would indeed make a difference.  Also know that you can also set your Hotspots to make use of ActionList assets, as opposed to scene-based Interactions, when the Player interacts with them.
  • I think I've finally figured out the core problem, and it's not the number of objects: the "Play movie clip" action gums up the scene. In my scene, I have 10 action lists that containing a movie clip action. When I unassign the movie clip from each of those, the overall scene load goes does to 7 seconds.

    I'm still unsure why this action causes problems. It doesn't seem like any of its code is running. (I was worried that AssignValues was running, and loading the MovieTexture or something, but logs suggest that's not so) Perhaps just having the field with an assigned video is enough to cause an issue for Unity.








  • I think it could be - it's likely to do with Unity wanting to load the video in advance.  Moving these Actions to ActionList asset files should cause Unity to only load them when told to play.
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.