Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game crashes in release build if tetrominos are spawned en masse #7

Closed
RailKill opened this issue Aug 22, 2020 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@RailKill
Copy link
Owner

This is likely due to the dangling Variant issue where reference to freed objects are being reassigned: godotengine/godot#38119

The way this game was coded was terribly rushed, with no thought or design to keep track of object references. You will see many null checks because of this, just search the files for is_instance_valid() and you'll see plenty. When something dies in this game, queue_free() is called and it's supposed to be freed from the memory. However, other objects still have reference to that thing, and because that reference is not freed, it thinks the object still exist because other stuff occupied that space in memory.

This was apparent when the speech bubble didn't work correctly when entering a scripted area, because the check for the speech bubble was whether or not it is null. Even though the speech bubble was destroyed, the reference still says that the speech bubble exists - this is because it was assigned to something else. Therefore, the code relating to speech bubble could not execute, because the reference was not pointing to a SpeechBubble object, it was pointing to whatever the hell else is occupying that memory space at that given time.

In the debug build, there seems to be monitoring and checks to prevent this from happening. The goal of this issue is to refactor and ensure all references to itself are properly removed before queue_free() is called.

@RailKill RailKill added the bug Something isn't working label Aug 22, 2020
@RailKill RailKill added this to the Refactor and Redesign milestone Aug 23, 2020
@RailKill
Copy link
Owner Author

tetromino references have been redesigned and optimized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant