Scene becomes "corrupt" and will not load in editor, but can still be played normally

Godot Version

4.22

Question

Lately, one specific scene in my game will become “corrupt” after working on it for a bit, and (although not immediately) it will always become corrupt again a short time after I back it up from GitHub. A weird thing, though, is that if I launch the game, it will successfully load the scene like normal. Another odd factor is that I can manually copy the scene file in file explorer with a new name, and it will successfully open in the Godot editor. Combined with the errors I’m seeing (referencing dependencies), I guess this means something isn’t receiving what is expected and the whole thing collapses?

I’m a 13 year old gamedev and I am completely lost on the concepts regarding what’s happening behind the scenes in the engine. All the related discussions I could find here and on GitHub (like this one) talk about things I frankly do not understand. I’m trying, but I really need someone to help me understand why this is happening.

In the church scene, a monster can find you, which sends the player to the jumpscare, and then the game over screen, which then heads back to the church to give the player another chance. I get that this relationship between all the scenes is causing some problem to occur, but I just don’t understand why.

Any and all help is greatly appreciated!

Screenshot 2024-08-13 195131


Screenshot 2024-08-13 135547

Go to your file-manager and open the church.tscn-file in a texteditor. There you have to find the corrupted-dependency. I suggest to do a backup of that file before that, but i guess you already have a bunch of backups

See, here’s the weird thing - there is no corrupt dependency that I can find. I searched through the script in Notepad ++, but I didn’t see anything out of the ordinary.

I admit maybe I’m just not understanding what to look for. Is there something I should be looking for specifically to tell that it’s been corrupted?

at the top of the script are the external-resources. You have to make sure the paths are correct and that inside the nodes in the scene they reference the correct external-resources from above. If you need help you can paste the scene-file here

[ext_resource type=“Script” path=“res://church.gd” id=“1_sttxj”]
[ext_resource type=“Texture2D” uid=“uid://bac6rymiqfkiy” path=“res://wood_texture_church.jpg” id=“2_gd5lt”]
[ext_resource type=“PackedScene” uid=“uid://cktf0btiippkh” path=“res://player.tscn” id=“3_6x8hv”]
[ext_resource type=“Material” uid=“uid://corp5ubupxy7c” path=“res://ChurchMaterial.tres” id=“4_6iq2f”]
[ext_resource type=“Texture2D” uid=“uid://cpmw2ydh84tm3” path=“res://church-door.jpg” id=“5_eqew0”]
[ext_resource type=“Material” uid=“uid://cgm0u2e7kl721” path=“res://ChurchAreaTexture.tres” id=“6_gkjhu”]
[ext_resource type=“PackedScene” uid=“uid://ccaff8eprbngf” path=“res://crucifix.tscn” id=“7_jppp3”]
[ext_resource type=“PackedScene” uid=“uid://cfuaalnl81dq3” path=“res://altar.tscn” id=“8_t3643”]
[ext_resource type=“PackedScene” uid=“uid://c1ihclx2mxy5m” path=“res://church_rug.tscn” id=“9_duxv6”]
[ext_resource type=“PackedScene” uid=“uid://dewnrlyy42ah7” path=“res://pillar.tscn” id=“10_1oyl5”]
[ext_resource type=“PackedScene” uid=“uid://bbmoqyk2cshn5” path=“res://bed.tscn” id=“10_klmxb”]
[ext_resource type=“PackedScene” uid=“uid://c6125lnv6gip5” path=“res://pew.tscn” id=“10_me5xv”]
[ext_resource type=“PackedScene” uid=“uid://df5aolp6c1nmq” path=“res://drawer.tscn” id=“11_1uah4”]
[ext_resource type=“Texture2D” uid=“uid://ovcfdqye5h5i” path=“res://BloodyCloth.jpg” id=“12_1kvvr”]
[ext_resource type=“PackedScene” uid=“uid://bmeudhtrujrvl” path=“res://pentagram.tscn” id=“12_arh5o”]
[ext_resource type=“Script” path=“res://SanctifyArea.gd” id=“13_jfywp”]
[ext_resource type=“PackedScene” uid=“uid://e7ybssmd7op2” path=“res://bookshelf.tscn” id=“15_bnjyp”]
[ext_resource type=“FontFile” uid=“uid://c4h57mxwu6wr8” path=“res://GreyQo-Regular.ttf” id=“17_1gkor”]
[ext_resource type=“Script” path=“res://SanctifyArea2.gd” id=“19_1qjfk”]
[ext_resource type=“PackedScene” uid=“uid://c3sv47pnfe8ox” path=“res://monster-first-seen.tscn” id=“19_o5eiv”]
[ext_resource type=“AudioStream” uid=“uid://c1d4sy6cd4bms” path=“res://Sound Effects/deep-strange-whoosh-183845.mp3” id=“20_7ldo1”]
[ext_resource type=“PackedScene” uid=“uid://5ih78ntjcpkr” path=“res://monster.tscn” id=“21_w4ili”]
[ext_resource type=“Material” uid=“uid://bmeki0gt03xnx” path=“res://GoreTexture.tres” id=“22_e1j3o”]
[ext_resource type=“Script” path=“res://CrawlArea.gd” id=“23_5wike”]
[ext_resource type=“Script” path=“res://CrawlCamera.gd” id=“23_qltbv”]
[ext_resource type=“PackedScene” uid=“uid://bhvsgxo4wfh04” path=“res://spider_head.tscn” id=“23_svs7j”]
[ext_resource type=“AudioStream” uid=“uid://ngnm43rom78f” path=“res://Sound Effects/jumpscare_sound-39630.mp3” id=“25_6at21”]
[ext_resource type=“PackedScene” uid=“uid://ywa8248ebdb6” path=“res://game_over_screen.tscn” id=“25_8l8px”]
[ext_resource type=“PackedScene” uid=“uid://dne5siok6keq2” path=“res://hell_area.tscn” id=“25_owqox”]
[ext_resource type=“AudioStream” uid=“uid://8c3vubgpt2jq” path=“res://Sound Effects/ChurchAmbience.mp3” id=“28_sgbcp”]
[ext_resource type=“AudioStream” uid=“uid://cktdhti34dy34” path=“res://Sound Effects/TunnelWalk.mp3” id=“29_7p8gg”]

Sometimes when you push or pull from a repository that’s not properly setup (like github, gitlab), it can happen that files are not correctly saved and tracked. This can happen especially when you pull while your godot project is still open. Or if your godot editor handles whitespaces differently than your repository.
Could I ask you to go into your github, download all the files that are noted to be “corrupt” by your Godot editor, and then replace your local files with them.
Make sure before you replace the files:

  • close all scenes in your godot editor
  • close all scripts in your godot editor
  • close godot editor
  • replace the files

In many cases, Godot really hates it when you use PackedScenes for things such as @export variables. I just thought Godot 4.22 fixed those behaviors.