0 votes

I just completed my first tower defense game. My game runs fine in the editor that I could play an hour long. Unfortunately, the released game behaves very differently. It just stopped functioning and stopped working error appears after the first wave. The Command prompt (debug) didn't tell me anything.
Please help, this incident really hurts my heart

in Engine by (24 points)

Would it be possible to share that game, or reproduce a smaller project in which the crash happens? Is it random or 100% happening when you do something specific? Usually when those things happen I remove stuff until it stops happening, which helps identifying the place where the crash occurs, eventually nailing down why it happens. It's a good time to investigate this because Godot 3.1 is on its way for release and devs are dedicated fixing bugs right now.

the game is 140mb. Is there any appropriate place to upload it?

About the issue, it is 100% happening on the first 90 seconds. In some cases, the game doesn't crash but all of the turrets just stopped functioning like they are all aiming something that doesn't exist. btw I have set_physics_process()that keep switched 'true' and 'false'. Then I have a dozen of 'export (PackedScene)'.

no clue how this was happened. I'm very lost right now because the editor works fine and didn't show any error and I can play forever on it.

It occurred to me as well that a bad bug occurs in a large project, so the most stupid simple (but also boring) way of dealing with that really is to remove stuff until it works, typically all stuff not needed for the repro (other levels, textures, music, editor plugins...), or to attempt a C++ debugging session in release mode in the hope that it catches something (never done that in release tho). If you want to upload the 140mb project, I'd say zip it and use a file hosting service such as Framadrop (select 7 days expiration, should be enough to share for now), WeTransfer or Google Drive.

You can also try to upgrade your project to Godot 3.1 beta4 and see if the crash still occurs (although it could be interesting to find what is the real cause of the crash).

Here. When you placed the turret, the first symptom is all turret will stop altogether. Then followed by the 'stopped working' error. The game runs fine without placing turret at all.

I tried the game, placed some turrets but thet don't do anything. Then I realized I had to move on top of the turrets to finish them and make them operational: then they started firing. I survived the first wave, then the second had way too many enemies. Retried several times. I had no crash though. Which system are you using?

I had another go, this time using generators too: then I had a crash, where sound first started twitching, then the game closed.

Would it be possible to look at the project or is it closed source?

Hi. I followed your advice, the one you said stupid simple and boring. in addition, I reread and illustrated them all in my mind (so basically I'm was becoming a robot for that moment) one line by one line.

Then I discovered my own programming mistakes that the engine itself ignores it (It even does flawlessly in the editor). It was that the turret was trying to shoot a non-existent, recently queue_freed object, that caused a chain problem:
-) A particle doesn't know where to appear
-) Turret keeps aiming THAT target
-) and so on and so forth

Reworked turret's code and everything works flawlessly.. for real. This is the most terrifying bug I have ever made that I was so close to giving up Godot. This is such a relief that it was my mistake, not Godot.

Thank you very much for your effort. I really appreciate it. Your advice worked for me.

Hmmm, accessing freed nodes should have been raised by the engine I think...
Which line of code caused the issue exactly?
If I try to access a freed node in Godot 3.1 it properly reports Invalid get index 'position' (on base: 'previously freed instance')..
If I try this in Godot 3.0.6, I once got an error, but sometimes it doesn't and freezes without info.

It should in 3.0.6 too. But in this particular case, I don't know why the editor was kind of 'forgiving'.

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 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.