2-3sec wait to actually posses a pawn on client only in packaged build

Hello, I’m trying to have all of my players to spawn at the same time on a map after a server travel.

To do this I count how many players have loaded the map in the PostLogin event of the gamemode and when they are all here I start an event in the gamemode to spawn and posses them.

I works fine in PIE and standalone, but in a packaged build, the server spawns rather instantly but all the clients takes 2 to 3 secs to spawn afterwards. I suppose it’s the time for replication since posses function is server side. But my question is how do I make everyone spawn at the same time then ? How do I know when a player controller have actually possessed their pawns ?

2 Likes

You have to start thinking about individual client load times and latency. Clients do not instantly load a map like in PIE. It’s read from drive, decompressed, processed, loaded to memory. This takes time. Hardware and software on each client has a direct impact on this.

Solution is to have the clients report back to the controller when they are ready. Controller can call an RPC event on the server-side controller which can communicate with the GM.

2 Likes

In my head OnPostLogin was fired when the client had loaded the map. But now that I think about it, it just makes no sense since gamemode is only server side. Thanks for the help !

2 Likes

OnPostLogin is when the GM has created the controller and Server has copy.

You still have replication delay (server tick interval), latency delay (50% ping) and client initializing and running begin play.

Same applies to character and possession.

1 Like