Lazy loading scenes & resources from a server

I’m going to have a game that has many different scenes that can be loaded remotely from a server on demand. I plan to fetch the .tscn files from the server and then use that to immediately start the scene. Each scene will contain several external resources and I’d like to lazy load these as needed.

My initial thought process is to set up empty placeholder resources for each external resource reference in the scene. Then when they’re loaded from the server, we can replace those placeholders with the loaded resources. It’s my understanding that I would need to have placeholder resources or else the scene wouldn’t be able to load since the reference to the external resource path doesn’t yet exist.

Is there a simpler way of handling these placeholders than manually creating resources at runtime, saving them at the expected path, and then replacing them with the real ones?

Additionally, I’d need to consider name collisions as 2 different scenes might have a different player.res resource so I’d have to ensure each resource path is unique if they all have to be loaded into the game’s filesystem.

The ideal solution here would be to allow the scene to be instantiated with missing external resources and simply just not show those resources until they’re loaded in. I’d also ideally like to avoid having to save everything to the game’s filesystem (res://) since it’s just extra work when the resources will already be in memory after being loaded from the server.

Appreciate any advice on how to set this system up.