You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context:
We're using packed scenes in a game as a way to save the current state for different parts of the game world. But sometimes resources randomly disappear (meshes, collision shapes, materials).
Issue:
It appears that sometimes when saving packed scenes, sub-resources indices are saved in a different order and the resource cache doesn't reflect the change well. So when loading the same scene again (in the same session), some resources can be swapped, leading to missing resources (when a resource of the wrong type is assigned to a mesh, it just silently disappears).
I wasn't able to reproduce the missing resources in a minimal project, but I've reproduced a scenario that leads to shuffled sub resources in a saved packed scene. The missing resources can probably happen only in more complex nested scenes.
Steps to reproduce
Using the minimal repro project:
Run the game. Scene 1 is loaded by default.
Press 2 to save scene 1 and load scene 2.
Press 1 to save scene 2 and load scene 1 again. Keep the game running.
Open the saved Scene2 in [user_data]/Godot/app_userdata/Missing-sub-resource/saves/Scene2.tscn
Observe the order of sub resource indices.
With the game still running from the last session, press 2 to save scene 1 and load scene 2.
Press 1 to save scene 2 and load scene 1 again.
Checked the saved Scene2 in [user_data]/Godot/app_userdata/Missing-sub-resource/saves/Scene2.tscn
Observe the order of sub resource indices has changed.
In order to reset the saves and start the repro again, you need to run the game and press R to delete all the saved scenes, otherwise the issue doesn't happen again.
Godot version
3.3.2.stable, 4.0.dev (0818a46)
System information
Windows 10
Issue description
Context:
We're using packed scenes in a game as a way to save the current state for different parts of the game world. But sometimes resources randomly disappear (meshes, collision shapes, materials).
Issue:
It appears that sometimes when saving packed scenes, sub-resources indices are saved in a different order and the resource cache doesn't reflect the change well. So when loading the same scene again (in the same session), some resources can be swapped, leading to missing resources (when a resource of the wrong type is assigned to a mesh, it just silently disappears).
I wasn't able to reproduce the missing resources in a minimal project, but I've reproduced a scenario that leads to shuffled sub resources in a saved packed scene. The missing resources can probably happen only in more complex nested scenes.
Steps to reproduce
Using the minimal repro project:
2
to save scene 1 and load scene 2.1
to save scene 2 and load scene 1 again. Keep the game running.[user_data]/Godot/app_userdata/Missing-sub-resource/saves/Scene2.tscn
2
to save scene 1 and load scene 2.1
to save scene 2 and load scene 1 again.[user_data]/Godot/app_userdata/Missing-sub-resource/saves/Scene2.tscn
In order to reset the saves and start the repro again, you need to run the game and press
R
to delete all the saved scenes, otherwise the issue doesn't happen again.Minimal reproduction project
3.x project:
missing-sub-resource.zip
4.0 project:
missing-sub-resource-4.0.zip
The text was updated successfully, but these errors were encountered: