Search Unity

Resolved What Does Reliable Do?

Discussion in 'Netcode for GameObjects' started by MrBigly, Feb 13, 2023.

  1. MrBigly

    MrBigly

    Joined:
    Oct 30, 2017
    Posts:
    221
    I was looking through the Netcode for GameObjects and saw the following code. But I am not certain how Reliable is actually implemented. I have been looking through the code and I am expecting to see something like a message ACK handshaking or something along that line, but in a UDP packet. Is my expectation correct? Or are messages made reliable in some other way?


    Code (CSharp):
    1. namespace Unity.Netcode
    2. {
    3.     /// <summary>
    4.     /// Delivery methods
    5.     /// </summary>
    6.     public enum NetworkDelivery
    7.     {
    8.         /// <summary>
    9.         /// Unreliable message
    10.         /// </summary>
    11.         Unreliable,
    12.  
    13.         /// <summary>
    14.         /// Unreliable with sequencing
    15.         /// </summary>
    16.         UnreliableSequenced,
    17.  
    18.         /// <summary>
    19.         /// Reliable message
    20.         /// </summary>
    21.         Reliable,
    22.  
    23.         /// <summary>
    24.         /// Reliable message where messages are guaranteed to be in the right order
    25.         /// </summary>
    26.         ReliableSequenced,
    27.  
    28.         /// <summary>
    29.         /// A reliable message with guaranteed order with fragmentation support
    30.         /// </summary>
    31.         ReliableFragmentedSequenced
    32.     }
    33. }
    34.  
     
  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    MrBigly likes this.
  3. MrBigly

    MrBigly

    Joined:
    Oct 30, 2017
    Posts:
    221
    I didn't see the answer in them and was looking at the code recently. Thanks, I will study the docs,
     
  4. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    It should be noted that the different delivery properties (reliable, sequenced, etc) are implemented by the transports, so you will not find the relevant code in the NGO codebase. For example, in the default transport (UnityTransport), this is all implemented by a different package:
    com.unity.transport
    .
     
    RikuTheFuffs likes this.
  5. MrBigly

    MrBigly

    Joined:
    Oct 30, 2017
    Posts:
    221
    That seems odd seeing that NetworkDelivery is an enum set defined in Netcode assembly. I assume that this is a wrapper that is translated as it works its way down into Transport...


    edit - that actually makes sense if you want Netcode to work over other transport layers. Is that the case?
     
    Last edited: Feb 20, 2023
  6. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Yes, NGO can work over different transport layers, which is why the details of how the delivery properties are implemented is left to the transport. See here for a few transports provided by the community.
     
    MrBigly likes this.