Search Unity

Reliable ordered concept ?

Discussion in 'FPS.Sample Game' started by Hootlook, Apr 3, 2021.

  1. Hootlook

    Hootlook

    Joined:
    Oct 27, 2018
    Posts:
    15
    After looking at the NetworkConnection i was left puzzled by two things

    - How do peers knows how to unpack NetworkEvents ?
    In my implementation i have an Id for each events on both machines that i send with the data so the other side knows how to unpack the events but in FPS Sample the only thing done is to add received events never seen before in a list but i'm not sure how this can help so how does it works ?

    - Is there a concept of reliable ordered messages in FPS Sample it seemed at first that packets were only reliable leaving the ordering to the consumer systems (or not) but for something like the chat ? i don't see any traces of ordering, the chat seems to consume data as it comes so what ? is there a possibility to have your chat messages in the wrong order ?
     
  2. Hootlook

    Hootlook

    Joined:
    Oct 27, 2018
    Posts:
    15
    I answere to one of my two questions

    It seems that NetworkEvents are meant to be sent in two ways, one is a "setup" event where it sends an Id and a NetworkSchema which tells the peer how to reconstruct the data and the second way is all the other cases where it just sends the Id, containsSchema bool, and the data since now the peer has the schema