Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclic scene preloading can cause 'Failed to instantiate scene state of "" ' error #102073

Open
MrBlockers opened this issue Jan 27, 2025 · 0 comments

Comments

@MrBlockers
Copy link
Contributor

Tested versions

Reproducible in v4.4.beta1.official [d33da79]

System information

Godot v4.4.beta1 - Windows 10 (build 19045) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 32.0.15.6636) - AMD Ryzen 7 3700X 8-Core Processor (16 threads)

Issue description

See attached MRP. It seems when there is a cyclic dependency of scenes (with scripts) that are preloading (either by path or UID) each other, it is possible to cause one of the preloads to silently fail and return an invalid PackedScene (empty path). Strangely in the MRP, by rearranging the preloads of the two cyclic scenes from the root scene, the issue is resolved. In either case, removing the cyclic reference also stops the error from happening.

I looked over the other issues in #80877 and didn't see any that immediately stuck out to me as being the same issue. The closest one I could find is #77090

Steps to reproduce

  1. Open the MRP and check 'a.gd' comment header
  2. Per the comments, try running with the provided configuration and note that instantiating 'B.tscn' fails in 'C.gd', but not in 'A.gd' and an error is thrown. The instance ID's of the two preloaded packed scenes are different
  3. Then try swapping the preloads (again per the comments) in 'A.gd' and run again. Note that the error does not happen, and instance ID's of the two packed scenes are the same.
  4. Finally, swap back to original configuration, and remove the preload of 'C.tscn' from 'B.gd' (breaking the cyclic dependency) and note that the issue is resolved, same as in step 3

Minimal reproduction project (MRP)

mrp_preload_fail.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant