+2 votes

Hi :)!
The game works perfectly fine from the editor and when export debug is enable.
But, when I export with this option disabled, my game crashes at a very specific moment.

The problem is that I can't get any output from the exe file... even the log files are very strange as the output is corrupted and in the wrong order (compared to debug mode). Also the most important ones are missing (I mean my print() messages)

Game FPS: 1
Game FPS: 32
Loading resource: res://scenes/mode-menu.tscn
Loading resource: res://postprocess-effects/CRTeffect_layer.tscn
Loading resource: res://scripts/mode-menu.gdc
Game FPS: 59
Loading resource: res://scenes/Team-deathmatch.tscn
Loading resource: res://classes/subMarine.gdc
Loading resource: res://classes/torpedo.gdc
Loading resource: res://classes/weapon.gdc
[...]
Loading resource: res://VirtualJoystick/Joystick.tscn
Loading resource: res://VirtualJoystick/joystick_background.png
Loading resource: res://VirtualJoystick/joystick_handle.png
Loading r

So i've identified that the game crashes when ether the player or the AI dies.
After LOTS of tests I suspect to have found the problem (and of course it's at the worst place :') )
I use queue_free() to delete ai and player nodes. I have mutliple check like that everywhere in my code

if player != null:
    # do player related things

So for me, the exe code doesn't execute in the same way than with the editor and causes this queue_free() to mess something, do you think that it will solve the problem if instead of deleting nodes I "disable" them to respawn somewhere else ?

Or is it something obvious that I have missed ?

I mean, it's frustrating that it works on debug but not on release as I may have to modify all the game now ^^

EDIT:
I cleaned ALL my code of all those != null check. It basically uses signals and boolean variables
Now it works

in Engine by (84 points)
edited by

I'm gonna wait for an answer, too, hopefully. I'm having an almost identical problem. In that an enemy node is freed while in the area2d of a projectile node. I think it has to do with null pointers and I even have a check for it, but it's not throwing any errors out that I can use. It works fine in debug and editor mode. Just not in release build.

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.