I’ve had a handful of players tell me of an issue (and even send me a video showing) where my game will stall for ~40-50 seconds after the Unity logos, and before the first frame. Windows shows the game as not responding, but if they wait long enough, it will load. This seems to be a rather rare issue as I have thousands of players who have not reported an issue.
I’ve put in timestamps in all the Start & Initializing functions, and based on the log I had sent to me, the loading stall is before they start functions are being called, somewhere in the internals of the Unity startup. I suspect it has to be related to some of the startup Unity is doing based on the resources I have in the game. I have no idea how to further troubleshoot this as I have no access to drop in logging prior to my code being called.
Are there any suggestions in to what could be the cause of this? Or how I could potentially troubleshoot this further to track down the source?
The starting scene is minimal, mostly UI and code based management for the game. The title screen contents are “additively loaded” (after this loading issue).
I’m building on 2020.3.20f1 (This has been a rarely reported issue for months on prior LTS versions). If you want - I have a free demo on steam where you can see if it loads quickly or suffers from this issue for you - Exodus Borealis on Steam
I’ve had a few players not wait for the load to complete, leave a bad review saying the game doesn’t run and get a refund. I really need to resolve this issue. Thanks for any help!
Firstly, cute looking game! Anthros and tower defence, I dig! Wishlisted the game for later.
I downloaded the demo to see what I encountered, and only encountered about a 1-2 seconds pause before the main menu loaded in.
I was hoping to also download the demo on my woefully inadequate and old Windows Surface Pro 2, buuut I forgot I had broken the charging cable.
What I was planning to test was to see if hardware speed was a factor in this. Have you noticed any correlation between the long load times and slower hardware?
Admittedly the only reason I know of that could cause this is if you have too much going on in your Resources folders. Word is that on slower hardware, having a lot going on in your Resources folders can cause a bit of a long hitch in your start up time, as the Resources build file needs to be deserialized before the first scene is loaded.
No, I’ve found no strong correlation with hardware. In fact, most that have reported it have rather capable gaming machines. I have a rather dated laptop I also test the game on, and while it runs a bit slow, the startup time is just fine.
The odd thing about this problem is it seems to be binary, it’s either the few second load, or 50+ seconds. I just had follow-up from the most recent person that the issue was fixed and it loaded in a few seconds with what I had done, only to report that it was back to the 1 minute delay after restarting his computer.
My only possible lead I have thought up is my music files were set to "Decompress On Load ", I had them referenced in my music manager so I thought it could be Unity trying to decompress all those on startup. I updated them to all be streaming, but alas that doesn’t seem to be a solution. I’m still quite stuck on how to troubleshoot, making blind guesses on what could be the problem is rather ineffective
It’s hard to guess without testing things first hand (I know, then it wouldn’t be guessing, anyway…), but I would poke around virus and malware protection. It awfully sounds that something is slowing down operation in certain circumstances.
Also monitoring memory is a good idea, if you’re running out of memory while you’re expanding your game, it takes awfully lot of time to swap onto disk.
Again, I may be wrong, please use your best judgement how feasible are these in your situation.
Further follow-up: I made a “start up scene” that does has a blank canvas and does nothing but put a time stamp in the log file and additively starts my primarily logic scene in the first update frame… After sending that out to the person having the issue, the startup scene runs, puts in a time stamp, starts the LoadSceneAsync, and then 55 seconds pass before the first Start() is called from my scene objects. So the time is being taken up in the scene loading.
So something in my primary scene is taking forever to load in very specific situations (that I can’t debug). There are management objects that have references to small scriptable objects, materials, sounds, music, a camera + cinemachine objects, a few model prefabs, vfx graph, some meshes, particle systems, UItoolkit documents, ugg it could be anything.
Is there anyway to log unity load times for elements in a scene? Clearly finding what element being loaded is the source is the key to problem solving the issue.
I guess I’m going to clone my project and divide all the game objects into different scenes and sequentially load them and log the times… And send this off to the guy who is having this problem to help track this down.
I would think there would be SOME way of logging what is being done in a scene load.
Do you have any loops? If so, place your Debug.Log statements there with a timestamp. Unfortunately it can be hard to get device logs from a customer. If you are in email contact with one of the affected customers, perhaps you could send them a custom build that writes the debug output to the UI. Hmm. after reading further, it seems this is happening before any Debug.Log statements could be written. Sorry I don’t have other suggestions. Other than send out a custom build with no loading of sound files, etc. Or profiling locally, but you mentioned you can’t reproduce
That is correct, the problem is there is no external code being executed, it’s all just waiting for the SceneManager.LoadSceneAsync() to return, so no place I can put a Debug.Log. So, whatever unity is doing behind the scenes to load all the game objects in the scene is where is slowness is occurring. I’ll just make a custom build that has each of the scene gameobjects being loaded in isolation with timestamp loads, and go from there, hopefully that will then give me an idea of what type of loading is the root of the problem, and then I can actually then troubleshoot the actual problem.
Some follow up. After dividing up all managers into their own scene to individually add and timestamp. It appears that any of my managers with prefabs of textured models were the slow ones to load. It just appears that these rare people are loading from disk over 20x slower than the rest. This is very odd. I verified no anti virus software is running other than windows defender. According to the few people, they don’t really have this slow loading issue with other games.
On a side note, I tried using addressables and they loaded significantly slower for myself (who isn’t having the base slow load problem). I quickly gave up and went back to traditional scene loading as I didn’t need a new performance problem to deal with.
I think I can reproduce it after downloading it to a mechanical HDD (rather than an SSD). I do get a spinny circle in the middle, but it takes like 20-25 seconds to reach the main menu. And then the main menu seems to be stuttering for a good while afterwards. During that time, the disk gets absolutely hammered. How much data (in megabytes) are you trying to load at startup? Are you testing on an SSD locally?
EDIT: that bizarrely only happened the first time I launched it. Next launches were instant (and without almost any disk usage).
That is exactly the same report I got from one of the users, really slow the first time, then faster on a second attempt. Then after restarting, the next load would be quite slow. My 7 year old lap top that I use for testing has a 7200 RPM Stata III drive, and I’ve not observed this slow loading on it, not sure it’s the HDD vs SSD. Hmmm.
I’m loading roughly 200 mb of textures/models/everything to get to the title screen. Then after getting to the title screen i continue to back load another 500 mb. When it is all done, it has a task manager reported memory footprint of 850 mb. This updated method of only partially loading to get to the title screen has improved the ~55 second load time to the ~24 second time, you were seeing.
Hey @skowroshima - sorry to revive and old thread, but I’m dealing with this exact issue on a build from Unity 2017. Did you ever find a solution for this?