#Non [Ghost]Rooms with nested Ghosts instantiation at runtime.

1 messages · Page 1 of 1 (latest)

solemn crest
#

In my current project I am instantiating a bunch of rooms at runtime, these rooms have multiple entities inside, some of those entities need to be client synced. THe rooms themselves are not GHOSTS, they are static objects generated according to the seed on both server and client.

The problem I am having is that these rooms have other entities inside (the rooms are manually build prefabs, and the nested entities are in multiple levels deep) all these entities should be synced and instantiated with the room at runtime.

How should I handle this scenario? I need the generation to work on both client and server side and sending the whole world seems to be a waste - since the world is quite large.

solemn crest
#

After a bit more testing, it seems they do not disapear but are instead being moved in world space and not respecting the hierarchy.

I am fine with them being in worldspace, as long as the position is the correct one. Any suggestions on how to accomplish this?

keen tiger
#

The room prefabs will be present on both the client and the server builds, so you could send an RPC from the server to clients to spawn these rooms when it's needed. This way, the only message you send is "Spawn this room", and then you just need to get the correct room on the client and spawn that.

Now if some of the rooms contains entities that should be continuously synced, those entities then needs to be ghosts. The way you usually set these up in multiplayer games is not to have the entity there directly, but a "spawner" that spawns the ghost in its location whenever that entity is created.