Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UNET NetworkTransform - changing sendInterval at runtime

Discussion in 'UNet' started by PrimeDerektive, Jul 20, 2017.

  1. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    So I'm working on a multiplayer VR prototype using UNET... I have some interactable objects players can pick up, and I want their transforms (rigidbodies) replicated across the network so when people throw them they are in sync, but when a player picks one up, for sync to stop, because once they're appropriately parented to the grabbing hand and set to kinematic, the hand is already sync'd anyway there's no reason to waste that bandwidth.

    I'm currently doing it (changing sendInterval to 0 on the server when a player requests to grab an object), but I can't tell if it's actually working. Can someone confirm for me this is a valid approach? :)
     
  2. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Change it on the client that's actually sending the updates.
     
  3. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    It's a scene object, so the server owns it no matter who picks it up.
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    do search for the "delta compression" or "delta state compression". The whole idea is - sending delta non zero updates only. Shortly: the state of your system is described by Variable S(t) = S(t0) +Delta(t)
    t0 Server->Client: S(0)
    t1: Server->Client: Delta(t1) (delta based on S(0)
    t2: Server->Client: Delta(t2) (== Delta(t1) + Delta(t2 - t1) or == S(t1) + Delta(t2)) (Delta based on S(0)
    t3: Client->Server: S(0), Delta(t1) received
    Server changed base State to S(1) as client received Delta(1) and started built delta updates on state S(1)
    each delta contains data for changing (from S(1)) objects only..