Announcement

Collapse
No announcement yet.

Best way to Replicate Head Tracking / Gun Tracking

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Best way to Replicate Head Tracking / Gun Tracking

    Is there any more efficient way to replicate head or gun angle tracking to all clients on a multiplayer game than to just multicast the angle on the event tick?

    Currently I have it set up such that, on the event tick, I am multicasting my head tracking angle without the reliable checkbox checked. If I am a client, I set my own head tracking angle locally, and then unreliably instruct the server to unreliably multicast to all other clients, which then receive the information and set my head tracking angle. If I am the server, I set my own head tracking angle locally, and then unreliably multicast my head tracking angle to all clients.

    I really don't like having to do this. Would multicasting on the event tick cause a lot of network traffic, even if it isn't reliable? I tried to find a better way to do this, but I'm not quite sure how. What does setting the character mesh to replicate actually do? I was hoping that if I set the character mesh to replicate, then maybe UE4 would, behind the scenes, more efficiently replicate the mesh's head tracking position to clients, but that didn't seem to work.

    Any advice on improving this would be appreciated.

    #2
    As a client, instruct the server about your new head angle.
    On the server, update a replicated variable that will go out to all non-owners.

    Unless I'm missing something, that should work fine.
    Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

    Comment


      #3
      Ohhhh that is a good idea. I can't believe I didn't think of that. I'm going to implement this. We have two separate areas in our project where we are multicasting on event tick, and I've seen some network saturation issues during multiplayer tests. Hoping this is a good fix.

      Comment

      Working...
      X