#Corrupt scene after Godot crashes
1 messages · Page 1 of 1 (latest)
For future reference, this is most often caused by a file's imported variant differing from what's on disk. The word "corrupt" is a lot scarier than what has actually happened, and a reboot will fix this 9/10 times.
Actually it seems to be coming back every time i reboot godot or I have to kill it when it freezes.
Now its happing on a different scene.
This might be a deeper problem. Are any other programs on the same hard disk having any weird issues? Games not loading savefiles, inability to validate logins, etc?
Nope everything seems fine. Just godot. I've been coping with Godot freezing when I save scenes, happens 10% of the time when I save. I've got used to it but maybe its related to the problem idk.
I have to open the task manager and kill it everytime. This might mess with the files if not closed correctly I'm asssuming.
Which version of Godot are you using?
4.2.2.stable flathub
Hmm.
If you have another hard drive, I'd try moving Godot and your projects to it for the time being. See if these issues still persist. Also, not a bad idea to run a malware scan.
I'm on linux so malware scans is not on my list. I am using the flathub version of Godot though, maybe i could try switching to the steam version.
is it talking about line 19?
Ok. I went and edited the scene file on a text editor and detached the script manually. It seems like the script ID was wrong. I re-attached the script in godot and now it has a new ID.
I can now work on my game. But I still have the issue of Godot freezing when loading at times. That is a way deeper problem and I should make a separate post about that instead.
Does the .gd file exist?
Is there any way I can clean the godot cache?
ye
You could delete/move .godot. Probably better to move than delete.
Strongly recommend using git or some other source control. It's never to late to start.
Yeah i was going to upload it after I finished this scene
What I would do from here is open the scene file in a text editor and see if there is obvious corruption in it: the error message might be telling the truth.
Done that. If I detatch/delete the script from the root node it will open fine
#1258922288720515244 message
Ah and then you can re-attach it, but whatever "it" is happened again.
Then I open godot and attach it again, and when I reopen godot it says its corrupt again
Perhaps there is something about the .gd file it doesn't like, but which isn't immediately visible. Maybe a bad text encoding. I would try replacing the script with a blank one and then, assuming that works, manually move the code back in until it breaks or, hopefully, doesn't.
yeah let me try that
ok that seemed to work. Let me see what is "corrupting" the scene
aaaaand it froze...
ok so the problem is this line
Is it possible that's causing a preload cycle? i.e. does loading title.tscn cause gameplay.tscn to be preloaded? I'm not sure if that would cause a problem, but it's what sprung to mind.
Im preloading scenes in every menu before the transition. maybe there is a cyclic reference if I do this on compile time?
There is no gameplay loading on the title script
do you think they're chained and reference indirectly?!
It's possible. It could be one of the other scenes you're preloading eventually hits a preload cycle. But I don't actually know if preload cycles are expected to not work. I think you'd just get a clear error message about it if that were the case.
I would try changing the preload that triggers the failure to a load, though, to see if it helps.
Maybe godot doesnt register indirect preload cycle references, only direct between 2 scripts
Could easily be.
I might go back storing the paths and chaning scene at runtime isntead. I had that system before but I found this one kinda cleaner.
I'll use change_scene_to_file instead of change_scene_to_packed