When instancing scenes in code, it can be annoying to use file paths to load specific scenes. Changing the file name or location requires fixing all of the file path strings. A common way around this is exporting the PackedScene var and setting it in the editor. However, this still leads to some annoyances in certain circumstances (script is tied to an object only created at runtime, could forget to set the export var on some nodes, etc)
I wish there was a registry of named scenes that could be instanced similar to class_name. Like you could declare a scene as NamedScene then create it with NamedScene.instantiate(). Do you think this is a good or bad idea?
Because the file paths are only defined in this script, they will be easy to change later if you need to. It may not be automatic but its quick and simple.
Using the code above is as simple as writing SceneRegistry.SCENE_01 to get the path, or SceneRegistry.PS_SCENE_01 to get the PackedScene object.
With Resource, you can export the packed scene like a variable, which will basically fix all your moving around issues.
Then, on your GameManager node or whatever you have to manage, you export a variable of the Resource type you have created, and boom… you have it there… just like you need.
I agree and this is my current method. It’s not a lot of effort, but it is just one extra thing to manage. Especially when the list of scenes gets very long.