+2 votes

I started a project whit godot since a couple of month. I have a problem I can't solve. My game crash, I don't know why?
There is no help or indication from the engine.
Anyone know why a game can crash? Commons Problems that I can check, like infinity loop or access to the wrong memory?

For more indication:
The game crash always at the same moment of the game but not every time.
It crash when it meet a yield() after I reload the scene with the method from the tutorial: Singletons
The fist load work every time.

in Engine by (21 points)

2 Answers

0 votes
Best answer

I fixed the problem. Apparently I didn't make a good use of the function: "process". A "fixed_process" was more efficient.

by (21 points)
edited by
Can you please share with us how use of _process instead of _fixedprocessed can cause engine to crash? It is good to know things that I definitively should avoid in some of my future projects ;).
Yes, it would be good to know how a crash could happen because of this.
Currently, I don't know why.
I just know that I set "false" the process of a node. After the game didn't crash anymore. So I changed for a _fixed_process and the result was the same.
+1 vote

The game can completely crash even in the debugger for several reasons. Not only the reasons you suggested, but also for things like severe Out Of Bounds errors. The best way I've found to determine what it is is to run Godot through a terminal window. Ignore the normal errors it my generate, and trace back the errors after you run the game in debugger and it crashes. This will allow you to scroll up the errors to see what in the engine broke and a good bit of the time what line of what script caused the failure to cascade into a crash.

by (223 points)
Thanks, but here is the result:

shit?: No error
ERROR: read: Server disconnected!

   At: platform/windows/stream_peer_winsock.cpp:210

I guess I have to look deeper into my code.
I think for windows, there may be something else you may need to get the terminal to do that, but I don't remember what. Using an Ubuntu Linux variant, all I need to do is run the terminal and every minor error gets printed to that terminal window. Sorry I can't be of more help with a windows system but I try to deal with that platform as little as possible these days.
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.