What is a "cyclic instancing inclusion" and how do I fix it?

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

I’m working through an example (Kids Can Code, Intro to 3D). After creating a scene for a crate, and then a scene for the ground (and then bringing the crate into that scene), then creating a camera and placing it, I’m trying to run it (preview works, but running it doesn’t, as it wants to save the scene first, which gives this error:

This scene can’t be saved because there is a cyclic instancing inclusion.
Please resolve it and then attempt to save again.

Can someone please help me understand A) what that means/what it is, and B) what I do to fix it?


:bust_in_silhouette: Reply From: jgodfrey

Assuming you have two scenes (SceneA and SceneB).

Your problem is likely that both scenes reference each other. So…

In SceneA you have a reference to SceneB
And, in SceneB you have a reference to SceneA

You can’t do that because it’s a cyclic situation. That is, SceneA will include SceneB which will include SceneA which will include SceneB which will include …

You get the point.

Look at the Scene trees of your scenes and eliminate the cyclic reference.

Well, I tried to find out how to debug using a scene tree, and never found it, but I did at least get rid of the problem. The scenes I had were crate and ground. When I looked just now, ground was gone and I had two crate scenes. So I deleted the second one, and the additional crates I’d added using CTRL-D vanished, and so did the ground (or was it floor?). Somewhere in there, while following this tutorial, I must of either missed a step, or maybe duplicated a step. Not sure. Either way, I saved what was left and I’ll take it back up tomorrow.

EDIT (next morning): I know what I did wrong. The video says to instance new crates into the Ground scene. I missed how that was done in the video, and just copied it, and then used ^D to make more. I got it right this morning, instancing each new one, and the scene saved normally. In the process, I also learned more about moving those crates around in all three axis (what’s the plural of axis?) using the arrows for each. Next is adding a camera. That’s where I had a really hard time—the one I added didn’t have any clear camera shape (maybe something I screwed up), so aiming it was trial and error. Being MUCH more careful this morning so I learn it all the right way.

Side question: I’ve heard (and read) so many saying that you should have tons of 2D games under your belt before even attempting 3D. But working with this Kids Can Code Intro to 3D tutorial, it’s so simple. Is that just the tutorial, the lack of a complex 3D environment, or just how much easier Godot 3.2.2 makes it? Just curious.

End of edit :slight_smile:

This is going to sound strange, but this is my second first game. The real first was done in GDevelop 5, and was an Asteroids variant I called Asteroids Mk II. It had a real ship with three guns (one from the nose, two from what in an aircraft would be wings), realistic looking asteroids, multiple levels, etc. Then a major system crash that happened at the same time as all of my many online backups failed. Murphy’s Law of Backups hit with a vengeance. Now, on a new laptop where I can use Godot 3, I’m doing my second first game. It’s based on the tutorial I mentioned as well as another demo called Coin Dash (that one was just the idea for my game). It’s going to be a relatively simple 3D platformer, complete with hazards, where the player has to collect all of the candy on the screen in about 30 seconds while avoiding the hazards. Every time they do so, more candy images are added (I’m thinking 30% more every time). I’m tentatively calling it Candy Grab 3D. The original demo I got the idea from was, for me at least, really fun and addicting. I’m hoping to duplicate that feeling in this game.

Anyways, thanks for the help. I’m not sure HOW it happened, but at least I know more or less what did happen.

JimG | 2020-07-14 23:23