Godot game window hanging for 30+ seconds after starting the game

Hi,

I have just started the Godot course on 2.5 RPG game. It all went well, trying this engine after dipping into Unity & Unreal is a breeze. Such a light weight clean engine.
However yesterday at some point I started to experience an issue when I start up the game. It’s still at the early stages of the course (state machines) so the game is tiny, simple, and my PC is a pretty high end PC with RTX4090 so I doubt that it is a hardware problem.

What happens is that every time I start the game, the game window appears, and after about 5 seconds it behaves like it’s crashing

Then it hangs like that for about 30 seconds, and finally the game runs without any problem. Interestingly it does the same thing if I try to Quit to Projects List, or when I start up the engine. It always hangs for a while then opens properly.

I deleted the temp files in %appdata%, checked task manager, profilers everything I could think of, but no clue why it’s happening. Any advice?

Although this could readily be any number of things (not that it’s a frequent problem mind you), my chips are on some sort of corrupted import of assets. A few things to check:

  • If you create a new, blank project, that should open correctly. This would almost certainly rule out any new problems with your current installation of the engine. And if for some reason it still hangs with a brand new project, I’d suggest deleting Godot and reinstalling from scratch, but I doubt that will be the issue.
  • The latest lesson you can remember where everything worked fine would be useful to note down. One at a time, try deleting course assets from the project (if you used any custom-made assets so far, be sure you back them up first) back toward that point and commenting out any code that uses them. Chances are pretty good that at some point, this will isolate the problem, and then you’ll at least know what to target.
  • There also might be something to do with caching interference going on here, as Godot isn’t always perfect when it comes to updating cached references and other info in its projects. I don’t know too much about fixing that directly, but in consideration of it, you can also try migrating your progress into a new, properly-working project and see if you encounter the issue again.

It likely isn’t down to what you’ve coded because unless you ended up in a call_deferred() loop, Godot will actually throw an error if you exceed the default max stack size of 1024. That, and this isn’t an infinite loop anyway, since eventually it works ok.

Good hunting! Let us know if you find anything =)

just wondering, is that the steam version of Godot or direct from their site?

there has been some occasions in the past where some USB perhipherals have strangely caused godot to look like its hanging in the past from the steam version.

might be worth trying to unplug any non essential USB devices, just to test.

is that the C# version of godot? my .net version does appear to hang for a few seconds at launch.

do you get the same behaviour if you start a new project and just a blank scene with say a test sprite in it?

not seen it personally before, but worth trying a few things just to rule them out.

1 Like

Is that in relation to just the Steam version? I did find something like that where that topic’s OP solved his issue, but I didn’t mention it because I thought it wasn’t relevant. Might as well add it now =)

https://www.reddit.com/r/godot/comments/fg625s/godot_lags_and_hangs_on_launch_windows_10/

not sure if its solely steam, but that was a couple steam ones that i heard about in the past

Thanks a lot for all the ideas. Embarrassing, but after restarting my PC the issue was gone. It’s not something I do often since I work as an ML engineer I have too much stuff open to restart my PC after I finish the day. But I thought I try it and it’s gone now. Weird.

I guess I still don’t know what caused it though, but hey if restarting helps I can do that. For reference, it is the .Net version, downloaded from Godot not from steam, and haven’t touched the USB devices, just a restart.
The last lesson was the State Machine maybe 3rd lesson.

Anyway, unless it happens more often than every week, I’m not too bothered, but again thanks a lot for the help folks!

2 Likes

Well hey, if the fix is that simple, that’s even better! Nothing to be embarrassed about.

Enjoy the course!

1 Like

Awesome, glad it’s working :+1:

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms