-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Windows release export crashes on scene change #75422
Comments
For clarity, here's the full log of the export run with
Also note that the |
So glad I found this topic was going mental because the game crashed sometimes on scene change and I had no idea why. Can confirm this is happening only during windows export without debug. With debug it all works. And only with scenes with many nodes in my small project with just scene change button it works flawlessly. |
I've also run into this. Only solution I've found is to not use the change scene methods and instead have a master node just manage child node changes. I've also seen this pop up semi often for people in various game dev discord help channels. |
@lorenzo-arena @saipheblue @gmjosack Please upload a minimal reproduction project to make this easier to troubleshoot. |
Spent a while trying to pull things out of a project where I've experienced this but as I remove more functionality it stops crashing and haven't been able to find a decent minimal reproduction. Will continue to attempt to find something. |
I've managed to get something the crashes fairly regularly but not super consistently. This project is setup with a player that can move with arrows and a keybind of Note: I only see crashes in non-debug builds on Windows. Running the project in the editor and Debug builds on windows never crash. |
Some additional context if you're looking into fixing this bug: #79318 (comment) |
Related to:
Didn't test to confirm if it would be a duplicate of any of those. #78988 may fix them / this issue too. |
I continue to see reports about this in the Godot help channels so adding a quick workaround here so people can see it when linked this issue: Having a node that manages scenes for you instead of using the change scene functions seems to be an effective workaround. Add a signal you can access from anywhere. If you don't already have an autoload you can add a new script such as extends Node
signal change_scene(path_to_scene) and add is as an autoload called Make a new scene with a Node as a base called extends Node
func _ready():
Events.change_scene.connect(_change_scene)
func _change_scene(path_to_scene):
for child in get_children():
remove_child(child) # Crashes without explicitly removing from the scene.
child.queue_free()
var new_scene = load(path_to_scene).instantiate()
add_child(new_scene)
Then whenever you need to change scenes you can just use the following code: Events.change_scene.emit("res://path/to/new/scene.tscn") |
This is likely fixed by #78988. The fix will be available for public testing in dev2, or you can compile the current master branch and test that. Let me know if the issue is still relevant after the fix and we can reopen it. |
@gmjosack 's workaround worked. Still a problem with 4.1.1 |
This is still a problem in 4.1.2 for Windows Desktop Release build. |
As mentioned in the above comment, the fix is only in 4.2.dev currently. It hasn't been cherry-picked to 4.1.x yet, but this is planned as per the |
Note that the label doesn't mean it's planned. It's only considered, but since this is a core change, it may be better to leave it be and suggest you update to 4.2 instead. |
Thank you for response. I actually have tried 4.2.dev6 version yesterday i have even bigger issues with it. It doesn't crash on scene changes but it has some issues with animation (in my simple game character has couple of run animation frames, in 4.2.dev6 they are just 1 frame, some character seems like slide without animation), also input keys (they sometimes stuck in pressed state). So i guess i will use 4.1.2 for now and Debug build for Windows platform. |
possibly related to godotengine/godot#75422
Omg this is so exciting. @gmjosack 's workaround seems to have saved my first big project that I worked on for ages. I have never really exported any of my projects so far, so now that I ran into this issue, I felt hopeless about it for the past week or so. I'm super grateful that you posted this workaround here! I'm very shaky about actually believing my eyes that there's no errors in my release build and that it ACTUALLY doesn't crash haha! Thank you so much for posting this, super grateful for you!! :D |
I have the same problem in 4.1.2 for Windows Desktop Release build. Do I understand correctly that this is solved in Godot version 4.2? |
@Benardus Yes, that is correct. |
@Lippanon Please open a new report with as much information as you can provide. A crash can happen for any number of reason, and from your description there is no link to either issue at this time. |
Godot version
4.0.1.stable
System information
Windows 11, Ryzen 3700U Vega 10 iGPU
Issue description
I'm having a lot a problems with the release export of my game on Windows. Running the game from the editor or exporting it as debug doesn't present the issue.
One of the problems seems to be already tracked #70910, but after removing some of the objects in a GridContainer I'm still getting crashes (not always) on scene change. I've enabled file logs and only sometime I get the following lines reported in the log; other times no error is reported.
I've not tried to reproduce the issue in a minimal project but I can try if it's necessary.
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: