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

C# scenes with NodePaths randomly fail to load correctly (instead replaced with null) #93083

Open
hhyyrylainen opened this issue Jun 12, 2024 · 0 comments

Comments

@hhyyrylainen
Copy link

Tested versions

  • Reproducible in 4.2.2.stable.mono
  • Not reproducible in 3.5

System information

Most likely Windows 10 with Vulkan Forward+ renderer and a cyrillic locale (only players have seen this issue)

Issue description

It seems that Godot 4 randomly fails to load NodePath export variables for C# scripts when instantiating scenes. The scenes in question load fine thousands of times, but very rarely it seems like they don't load correctly after playing some time.

I know this is basically probably unsolvable but I want to report this problem anyway as I've received multiple reports from players of my game that they have gotten this issue. I've opened a meta tracking issue in my repo about this: Revolutionary-Games/Thrive#5209

There's a chance that this is not in the end an engine issue, but all the info so far I have about this is that for some reason an instantiated C# class just has some export properties set to null when loading. Way earlier in the process from porting from Godot 3 to 4 I noticed 2 scenes that were much much more likely to have this issue present in them and I switched them to using direct node references. That seems to be a working workaround for this as I've not received any reports where those two scenes. So that leads me to believe there is some rare bug in the engine related to NodePath variable handling in scene instantiation.

I have not switched everything over to using direct node references as it would be a lot of work to convert over hundreds of scenes. Once that is eventually done, this issue should no longer really be relevant to Thrive anymore.

Steps to reproduce

  • Have a scene with a C# script attached to the root node
  • Add an [Export] variable of NodePath type
  • Add a valid path to that variable
  • Load the scene thousands of times and hope to somehow trigger the issue... (I know this step is not really feasible, also this is the reason why I haven't managed to narrow down this issue at all)

Minimal reproduction project (MRP)

I think it speaks to the rarity of the issue that the Godot 4 version of Thrive has been downloaded thousands of times but I have received less than 5 reports of this problem.

So even if I tried for hours it would be unlikely I would be able to make a MRP.

Version of Thrive that definitely has this issue in it is: https://github.com/Revolutionary-Games/Thrive/tree/v0.6.6 (I added some workarounds in later patches so this issue may no longer be able to be triggered as I switched a few more scenes to use node references instead of paths).

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

No branches or pull requests

2 participants