Cyclical references killed my entire project

So Godot does not like circular references. If your main scene is part of a circular reference it corrupts the project and makes the scene un-openable.
The Godot dev’s say this is not a bug. But it sure feels like one.

Don’t try and test your scene by having Scene A load Scene B which then loads Scene A.
[4.0 RC 1] Can’t switch to packed scene that was started in using change_scene_to_packed #72921**

Trying to manually load new scenes to toggle back and forth between two scenes fails #83079**

A better method is described in this article.

2 Likes

Probably considered an unhandled exception more than a bug. Thanks for posting this =)

Fortunately, I don’t think your project is sunk for good. .tscn is short for “text-based scene;” if Godot won’t open your scene to let you fix the error, open the file in Notepad or something and you can comment/fix the offending lines there.

Hopefully you already knew about this and your own project is actually fine now, but if this note helps other people too, even better.

2 Likes

@BH67
Thanks for taking the time to explain this - much appreciated. It was not mentioned in the posts I linked, or in any of the documentation I read. I hope this helps others in the future.

@GameDevTV - if you are updating this course. Please consider adding a note about cyclical references preventing Godot from starting a project would be valuable. This error caused me to delete my project because I didn’t know how to fix it, causing me to lose 2 weeks of effort and motivation to complete the course.

2 Likes

Ohhhh man. That’s brutal. I hope you come back to it sometime soon, as it’s a solid course that you had some awful luck with (I’m pretty sure it was Kaan who explains the text-based scene thing - either him, or Bram in the 3D course. Maybe both). If you run into critical problems like that again, don’t be afraid to leverage the community either; there are people here who are more than happy to help you succeed =)

1 Like

I just thought of something; these days, there are some pretty sophisticated ways to recover lost files. If you’ll pardon the expression, you have nothing to lose at this point; why not have a look through this and see if there’s anything that might help you recover the project:

And if you’re not on Windows, more relevant results are a search away.

Thanks BH67, I did recover the files, but editing the scene files did not work. Just resulted in parsing errors. This is a known problem in Godot, hence the reason I posted links to the Godot Github and to a work around using a main background scene that manages smaller scenes.

Yes, you are right, the GameDevTV courses are quite good. I appreciate the effort that has gone into them.

Thanks for the assistance.

1 Like

@BH67 - thanks for the insight. I got it to work.
For those who follow, I ended up doing the following steps for each scene in my project, try the scene (failed), and edit it in notepad++, try again. (I did not have to close Godot)

Cyclical scenes - debugging…

  1. The load_steps parameter is equal to the total amount of resources (internal and external) plus one (for the file itself). If the file has no resources, load_steps is omitted.
    [gd_scene load_steps=9 format=3 uid=“uid://dvw6o6awi5qa8”]

  2. Find the offending scene and note the UID number
    … id=“2_3k727”

  3. Delete all instances of this UID (delete the * lines below)

  • [ext_resource type=“PackedScene” uid=“uid://dassgucjmy1v5” path=“res://Levels/levelC.tscn” id=“2_3k727”]

    [node name=“LevelA” type=“Node2D”]
    script = ExtResource(“1_7708q”)
  • next_level = ExtResource(“2_3k727”)
  1. Reduce the load_steps by the number of resources deleted (1 in this case)
    [gd_scene load_steps=8 format=3 uid=“uid://dvw6o6awi5qa8”]
1 Like

th-4225872452
Congratulations! That’s fantastic! ^v^

Definitely bookmarking this in case I ever encounter corrupted files or whatnot.

1 Like

Privacy & Terms