Since the update, running the game in the unity editor is very, very slow. The frame rate is much lower to begin with, but it drops over time even when I don't do anything in-game (no walking or pathfinding). This seems to happen in all scenes. No issues whatsoever if I run a build though - it still plays very smoothly.
Here is a screenshot of the profiler before the update (no matter what I do in-game, it remains pretty steady):
This is after the update, about a minute after starting the game:
And this is after about three minutes:
I'm not sure what other profiler info would be useful to provide you, Chris. Please do advise.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
It seems that it's the CPU usage under "Other" (everything else looks OK).
Before the update:
After the update (after I allowed it to "build up" for about 30 seconds):
Also getting lengthy editor loops now:
Sorry for the trouble. I'll need a few more details:
In the Profiler, switch the "Timeline" setting on the lower-left to Hierarchy or Raw Hierarchy, and enable Deep Profile at the top. Hopefully, that should give us more specific info about what's causing this.
The huge drop happened when I stopped the scene and then started it again. It eventually built up to the previous high levels again as I left it running.
Chris, I've just created a clean project, imported only the new version of AC, assigned the 2d managers and ran the park scene. It's still happening, so I don't think it's an issue with the rest of my project.
Thanks for the details, I will look into this.
It appears related to the display of icons in the Hierarchy - though nothing was changed to this in v1.73.
Try disabling them in Edit -> Project settings -> Adventure Creator.
Unfortunately it is still happening in my project (but it seemed under control under the clean project with AC only?). Also, just out of curiosity, I tried to upgrade my project to unity 2020.2.4f1, and the the upgrade itself went very smoothly, but sadly the slow editor issue is still there.
So, without hierarchy icons enabled, the issue is now only occuring in your main project?
Is there anything else present that may be contributing? It may be worth duplicating the project, and deleting things until the issue goes away to see which one is causing this. I'm keen to get to the bottom of this, but I can't think of anything specifically with this latest release that should cause such an issue.
The following hierarchy shots, from two different scenes, are Unity 2020.2.4f1, though the same behaviour occurs in 2020.2.1f1, with hierarchy icons disabled:
OK, Chris, so I've narrowed it down to an old install of Anima2D. I was using version 1.1.4, but updating to the latest (1.1.8) didn't help. So to recap:
AC 1.72.4 + Anima2D 1.1.4 = works fine
AC 1.73.0 with hierarchy icons ON = broken
AC 1.73.0 with hierarchy icons OFF = works fine
AC 1.73.0 with hierarchy icons OFF + Anima2D 1.1.4 = broken
AC 1.73.0 with hierarchy icons OFF + Anima2D 1.1.8 = broken
Anima2D animations don't actually need to be in the scene for this to happen. Just having the folder in the project is enough to cause lag.
I realise Anima2D is no longer supported by Unity, but I have some animations that depend on it, and it still worked perfectly until I updated AC to 1.73.0. Is there anything we can do to fix this?
It'd be worth checking if MartynEm is also using Anima2D.
What's the state of having Anima2D in the project by itself? AC doesn't reference Anima2D in any of its code, so I can't really picture why having both present would cause an issue.
Before a fix can be found, we'll need to narrow down the exact cause. It's likely coming from an Anima2D Editor script. Backing up first, try removing Anima2D's Editor scripts in turn.
No Anima2D over here I'm afraid.
What is the impact of disabling hierarchy icons, @MartynEm? Both in your main project, and a fresh one, and in which version of Unity?
Profiler shots above are with hierarchy icons off, Unity 2020.2.4f.
I'm updating several packages used in my project right now, including Unity 2D animation and Burst, the latter of which rescued my project from framerate oblivion when I installed it a few months ago.
Assuming that process doesn't shed any light on my problem, I'll try some further profiler runs with hierarchy icons on, and check a clean project too - results later today.
Thank you. Please let's only deal with Hierarchy Icons off, though - I've got a means of improving that, so we can eliminate that from being a cause now.
Please also see if closing any tabs makes a difference.
Unity Editor tabs, like animator, timeline etc?
Up-to-date packages showed no significant improvement. It's interesting that @Rairun 's issue results in constant high profiler load where as mine is very regular spikes. Interesting in a way that I can't even begin to figure out that is!
A clean project, running the 2D demo; icons on:
runs around 60-70fps.
With icons off, around 130-150fps:
So while the hierarchy icons off fix helps the demo significantly, it has little to no effect on my project.
Assuming yes, Editor tabs: Closing animator, animation, timeline and audio mixer - all of which were open for previous profiler shots == no appreciable difference in performance.
Any and all: Scene and AC Game Editor included.
How do the spikes compare with the previous AC release? Regular spikes may be more of a Unity-standard behaviour.
One other boost: comment out the SceneView.RepaintAll (); statement in SceneManager.cs. That too will be optimised in v1.73.1.
You can switch from Playmode to Editor at the top-left of the Profiler window to profile the Editor.
OK, so I get the increasingly high regular load when Hierarchy Icons are on. When they are off, I get increasingly high spikes which slowly become more frequent and then eventually merge.
All the screenshots below were taken with the Hierarchy Icons OFF.
Before updating:
After updating:
After updating and deleting Anima2D:
After updating and deleting all packages and custom scripts except AC:
Anima2D has a lot of editor scripts, and it's hard to delete them little by little without getting compile errors.