Join in progress

Hi,

I wonder how people is handling Join in Progress in multiplayer games using UE4.

Imagine the following scenario:

  1. Game starts
  2. Client A joins
  3. Client A picks up an item, which is added to Client A by a NetMulticast function which runs on every connected machine and Attaches the Item to the actor controlled by Client A
  4. Client B joins
  5. Client B sees Client A without the item
  6. Client A drops and picks up item
  7. Client B sees the item in Client A hands

How to handle the item attachment on Join in Progress players?

Another scenario:

  1. Game starts
  2. Client A joins
  3. Client A changes replicated variable value, for example a bool bIsProne to true, any other Client connected receives this and see Client A prone
  4. Client B connects
  5. Client B does not see Client A as prone
  6. Client A un-prones and then prones again
  7. Client B sees client A prone

Any suggestion on how to handle such situations?
Thanks in advance.

RPC functions should only be called for cosmetics really. If you use replication of variables properly, and use the OnRep functionality for any other visual gizmos, there should be no problems. In your first example, if B joins after A has picked up the item, the fact that A has the item should be replicated to B automatically.

This was amazingly helpful. Thanks.
Another question is, when a player joins the game (join in progress) does he receive the replicated values?

Most of your questions can be solved/answered by watching the networking tutorial from Epic.

All replicate values on the server get replicated to the client when he joins, so yes, he will always receive the latest state of the game. If any of the replicated variables change again, they will also be updated on the replicated client.

Thanks to all. :smiley:
Solved.

Didn’ solve my problem: Can Help me here? https://answers.unrealengine.com/que…3637/view.html

Please don’t bump 5+ year old topics that are not related to your question only to get eyes on an Answerhub post.