[1.0.0-pre.15] Streaming ghost entity prefab

Currently when server try to spawn a ghost entity and if client haven’t load ghost entity prefab into subscene, you will get invalid ghost error and the game will fail to work properly. I think this limitation need to change to make unity user life easier and also enable large scale game that will always need to stream in and out ghost entity prefab super fast. You will need to do a lot of ugly if check if still having this limitation

We support this scenario already. And can be fixed using the Loading flag on the GhostCollectionPrefab.
The server will never send ghosts for which the client hasn’t ack that he loaded the associated prefab.
We don’t show how to use this in our samples. But one that show how to do that will be available in the near future.

If you want to expand more on what are you actually want from that feature or your intended use case (at the moment) is always appreciated.

Basically I want as auto as possible that dots netcode automatically handle it for me. At server I spawn a ghost entity but at client I haven load the corresponding ghost prefab entity yet, client won’t get invalid ghost error and then stop working properly. Instead client will wait until corresponding ghost prefab entity loaded then ghost entity will spawn at client. So this entire process is automatically handled by dots netcode that I dun need to write any single line of code to make it work.

I guess it’s not supported at 1.0.0-pre.15 release yet?

It is already somewhat working like this, the only missing piece is that the handling of the loading logic is left to user, since we don’t know from were you want to load that prefab (Addressable?, Subscene ?).
Also there are many options about how to implement this feature too (even without addressable).

Having something completely automatic still requires some intervention from you. Even supposing there is an event that is telling you a prefab (with some GUID) need to be loaded, we need user intervention for that.
Sure, it can be as simple as method that schedule a job that load the resource (or another form of resource management). you
But I see more value in having you guys handling the resource management the way you want, instead of imposing our way to do it.
We are automating quite a lot with prespawned ghost, for the good and for the bad. And yet, we also let you write you own custom logic for them (you need to opt out ours via define). Because, you know, for the 1e6 cases you handled, for sure there is the one you need that it isn’t :smile:

It’s confirmed by content management team that addressable is not the official way to load things at ecs project and 1.0 release already removed runtime entity conversation. So should load prefab entity from subscene. I will submit a bug report to shows u how it looks like and this simple netcode project already will make editor really easy to keep crashing. Seems like official not yet battle tested with dots netcode.

So since official proper way is to use subscene then I think dots netcode should implement automatic solution based on subscene. And also same with prespawn ghost u mentioned, official can provide opt out define for unity user to do customization if required but I think it’s not really necessary since the only proper way to load is via subscene. No point to customize this part for hard way and also make it slower to load. I will say currently the only official way for ecs project everything is loaded using subscene by design.

@CMarastoni Alright. You can take a look at IN-32120. Actually nothing really special. Currently with this repro at client if u change logic flow to send GoInGameRequest RPC first before stream in ghost entity prefab and server spawn a ghost, u will get invalid ghost error. I would like official to solve this limitation that at client even ghost entity prefab is not yet stream in, it will not log error and wait until ghost entity prefab stream in and then finally spawn ghost entity.