What is the GDevelop behaviour when an action fails?

Whenever I noticed Gdevelop would not execute my events or actions I played with them until all of a sudden it started working. The longer I do this the more rarely I see this situation. But every now and then it reoccurs, and I realize I can spend more and more time on seemingly small issues just because of some user error or unexpected runtime condition.

My feeling right now is that whenever an action fails GDevelop (or the exported game) stops executing the whole action sequence of an event. Is this right?

Is there something like a logfile available to contain more data about the problem? (e.g. “directory not found” for not taking screenshots) Ideally I’d like to see a verbose message plus a stack trace…

When an action really fails badly it crashes the game (game stuck on the last rendered frame). In that case you can see in the inspector’s (Ctrl-Shift-I) console tab the exact error message. Else it doesn’t affect the other instructions; only that one action with wrong input will not work.

Only now I see that response.

So that means there is neither logging nor error handling possible?

Knowing my programming skills I would prefer something different. How about this?

While running inside the IDE actions could write log messages that get displayed in the IDE (probably the debugger?). After export the game would no longer write log messages and could silently fail. But to get feedback from users it may be useful to have a switch here as well.

For errors exceptions have proven successful in so many languages. How difficult would it be to add exception handling actions into GDevelop?

There is no log file.

The most common error is that people type expressions and name of objects and variables wrong which is not going to throw an error but simply return 0 which is a valid value in most cases and so it won’t crash and won’t throw an error but you don’t get the result you want.

I think it is just not possible to log and handle this kind of errors simply because there is no way to tell it was an error because 0 is a valid value in most cases.

So whenever there is a problem seemingly with no explanation, always look for typos.

When there is a runtime error and crash, freeze, you can always check in the developer console in the preview window and also in the browser what the error message is as arthuro555 mentioned.
The most common problem is that you have removed a resource and the game can not load it or you reference a behavior for an object but you have removed the behavior from the object, maybe typed wrong a scene, layout name.

This type of errors can be more likely logged and I agree it would be nice to have some exception handling in GD, at least display a message if a certain error occurred so players can report it without need to go through a bunch of technical staff to find and report the error. :+1:

This sounds exactly like the reason why I prefer statically typed languages, where a compiler can tell at compile time whether code is good or not.

Maybe a stronger parser (not necessarily a full compiler) could check for such problems?
And actually there is a compiler: It translates game.json into HTML5/JavaScript or else.

This sounds like a very useful generic troubleshooting. We should put that somewhere into the documentation. :ok_hand:

Even today the IDE performs some surprisingly cool stuff. I can imagine it could be extended by what I mentioned above, but this is a project of it’s own so the developers will need help.

Maybe when I’ve had my cup of JavaScript I can opt in to help…