Godot will no longer open my game?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By miss_bisque

I was on the brink of finishing a game and then decided to take a break. Made sure everything was working and pushed my most recent changes to github. One month later I come to open up my game and it will not open. Godot seems to just freeze once I open the game I would like to open, even though it doesn’t crash when I try to open a different game.

I get the following errors when I try to load the game, none of them seem like they would make Godot crash…I should still be able to get in there and edit. But Godot is stuck and won’t open

ERROR: _load_data: Condition "!f" is true. Returned: ERR_CANT_OPEN
   At: scene/resources/texture.cpp:502
ERROR: Failed loading resource: res://.import/bowl.png-db6f57ab3692867dcfd5d1a34709a9e6.stex. Make sure resources have been imported by opening the project in the editor at least once.
   At: core/io/resource_loader.cpp:278
ERROR: Failed loading resource: res://Sprites/Objects/bowl.png. Make sure resources have been imported by opening the project in the editor at least once.
   At: core/io/resource_loader.cpp:278
SCRIPT ERROR: GDScript::reload: Parse Error: Can't preload resource at path: res://Sprites/Objects/bowl.png
          At: res://Scripts/Global.gd:9
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
   At: modules/gdscript/gdscript.cpp:599
ERROR: Script does not inherit a Node: res://Scripts/Global.gd.
   At: editor/editor_autoload_settings.cpp:357
ERROR: Another resource is loaded from path 'res://Fonts/TrulyMadlyDpad-a72o.ttf' (possible cyclic resource inclusion).
   At: core/resource.cpp:82

Things i’ve tried: deleting my project folder and re-cloning from GitHub, deleting Godot and reinstalling, restarting my computer, reverting to a previous state in GitHub that the game worked in just fine.

Any suggestions here? I’m at a loss for what to do!! Hope someone can help!

Here’s my GitHub link if that helps… GitHub - resquenazi/Object_Discrimination_Video_Game

I’m guessing you also checking out slightly older versions of game, using git log and git checkout <some_version_hash>. Did you get the same problem?

CharlesMerriam | 2021-02-01 07:46

yeah I discovered the point in my previous version where godot will finally load the game…it seems to be that a .gitignore file was created and was ignoring certain files like default_env.tres. Its still not working but I might be getting close. Any suggestions?

miss_bisque | 2021-02-01 17:47

*.stex files are just the png plus the header files pushed together. I would regenerate them. You could quickly experiment by destroying your entire .import directory and that should cause it to regenerate.

Is Globals.gd (line 9) your script?

CharlesMerriam | 2021-02-05 05:25

Thanks for your help everyone. I ended up being able to find a previous version in my git log history that worked. I believe at some point, the default_env.tres file began to be ignored by a.gitignore that I don’t recall ever creating. Its all a bit of a mystery but I was able to go look at each commit after the glitched one and manually make the changes on a new git branch. I think the moral of the story is to check your commits and make sure no .gitignore files are being created, otherwise git will ignore important changes being made to your game.

miss_bisque | 2021-02-08 17:41

:bust_in_silhouette: Reply From: Lopy

Here are a few leads, they are independent from one another.

Forcefully reimporting everything

Warning: Make a backup first!
miss_bisque mentioned having the project under git, but if someone else finds this answer, make at least one copy of your project folder somewhere safe before trying this.

Delete .import/
Run the following command in the root of the project folder (containing project.godot).
    find . -path *.import -delete
Open the project inside the Editor and wait for the imports to finish.

If the Editor fails to reimport a specific file and goes into an import death-loop, you can selectively restore a .import by copy pasting it, or with git by doing a git restore <filepath>

Recreating a project.godot

Create a new project inside the project selector, close the Editor, then copy everything to the new project except the project.godot. If it works again, you can manually put in all the information back. Note that project.godots are fairly readable, meaning you can read the corrupt one to know what to enter back graphically.

Git specific

Knowing the exact version which caused the issue to start, you can look though every file that changed.
Do a git checkout <good version's hash>, check that it works, and then, for every file that changes in the following commit, do a git checkout <first bad version's hash> -- <file's path> and check it it breakes the project. (You can go faster by putting folder paths, and then restarting with entries in the incriminated folder).
You should end up with the exact file that caused the issue.