I’m using the “ResourceLoader” to load my scenes, for whatever reason, the main thread freezes during loading. This happens regardless of sub threads being set to true or false. Isn’t this not supposed to happen? I’ve asked quite a few people now about it and no ones been able to figure out why it’s happening.
This is the main code to start the load. I made sure that it wasn’t the checking of the threads progressing causing it, as taking out all my code that is in a process function makes no difference. Changing scenes to the loaded one isn’t what is causing it either as I’ve tried taking that out too to see if it made a difference. Been trying to figure this out for days and greatly appreciate any help. I can provide more context and videos if required.
The other half is the getting, you need to make sure you don’t spin lock or block with the get or get status (like using a while loop). And try again in another process call.
Thanks for the suggestions! As i mentioned in the post, having sub threads set to false didn’t make much of a difference with the freezing, so I have to assume its something with the getting status… Will test some things out
As a test, i removed all the code that checks the progress and such and just have a spinning cube to see when its being frozen, it still happens to freeze during the loading of scenes, not as much but it is still very noticeable
Are there other resources loading at this time? I assume the background resource is large, and could form a blockage and bottle-neck on the file I/o request effecting other loading resources that are not being loaded in the background?
I guess just the scene your loading into. I was wondering if there were more than one load happing at the time you start the background loading. Like a player or item or something.
I assume there isn’t since the resource loader is just called during the ready function. The scene contains a bunch of stuff of course, but it’s only technically loading the one scene given
Here’s a before and after. It used to take a very long time to load the scene but I optimized it a bunch thinking it would fix the freezing. But it doesn’t seem to
Hmm okay, are the video’s true to experience? It almost looks like the video card is freezing, because I can see the Nvidia Experience overlay and it also seems to freeze.
The main issue with the freezing is if you click during it, it’ll cause the windows unresponsive box to come up, which makes it really annoying if you do it by accident
Seems I’ll have to live with the freezing for now. Appreciate the help though! Hopefully it’s just some Godot bug that gets fixed in a later version or something