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