Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Networking: feedback and questions

Discussion in 'Connected Games' started by BHouse, Sep 13, 2018.

  1. BHouse

    BHouse

    Unity Technologies

    Joined:
    Jan 10, 2018
    Posts:
    71
    dzamani likes this.
  2. ksakins

    ksakins

    Joined:
    Aug 29, 2015
    Posts:
    16
    @BHouse Would you be able to provide any insight into the current development efforts of the new DOTS Netcode? And by that I mean, are they piloting the project based on any input at all from current game developers, or is it solely an in-house project at this point and developers will get their first look in the fall?

    I for one would advocate at least for the former approach, getting developers involved as early in the process as possible. Whether that means a lot of input or limiting input, I think it's the way to ensure that you won't turn away a good majority of those looking forward to using a networking solution coming from Unity.

    One thing that I've appreciated from open source projects like Mirror is that the community is strong, and discussions with the developers on Discord has (at least for me) been pleasant and very helpful. Having the same sort of community involvement at the Unity level I think would be a major step forward.
     
    ModLunar likes this.
  3. KuantikoStudio

    KuantikoStudio

    Joined:
    Apr 2, 2019
    Posts:
    5
    Hello,

    We are developing a multiplayer application based on the new networking system (https://github.com/Unity-Technologies/multiplayer).

    We already have a working server conected with multiple clients, but we are having some problems with package loss.
    Is there any example of any implementation of package reliability/acknowledgement?

    Just to clarify: What I would like to find is an example of how to get ride of package loss, so for example when the server send a command to all clients and some of them do not receive it correctly, the server resend the command when necessary.
     
  4. BHouse

    BHouse

    Unity Technologies

    Joined:
    Jan 10, 2018
    Posts:
    71
    Good question! You can find information about the Reliability pipeline here:
    https://github.com/Unity-Technologi...y.transport/Documentation~/pipelines-usage.md

    Please let us know if this doesn't solve what you need.
     
  5. KuantikoStudio

    KuantikoStudio

    Joined:
    Apr 2, 2019
    Posts:
    5
    Thank you for your fast answer!

    We are already using the reliability pipeline, but I'm not sure if we are doing it correctly.

    This is our server code:
    Code (CSharp):
    1.         public void StartServer(int port, int maxConnections)
    2.         {
    3.             Debug.Log("Starting server, port: " + port);
    4.             _serverDriver = new UdpNetworkDriver(new ReliableUtility.Parameters { WindowSize = 32 });
    5.             _pipeline = _serverDriver.CreatePipeline(typeof(ReliableSequencedPipelineStage));
    6.             NetworkEndPoint endpoint = new NetworkEndPoint();
    7.             endpoint = NetworkEndPoint.Parse(IPAddress.Any.ToString(), (ushort)port);
    8.  
    9.             if (_serverDriver.Bind(endpoint) != 0)
    10.                 Debug.Log("Failed to bind to port " + port);
    11.             else
    12.             {
    13.                 _serverDriver.Listen();
    14.                 Debug.Log("Server started successfully");
    15.  
    16.                 ServerStarted?.Invoke();
    17.             }
    18.  
    19.             _clientConnections = new NativeList<NetworkConnection>(maxConnections, Allocator.Persistent);
    20.             _driverStarted = true;
    21.         }
    And client code:
    Code (CSharp):
    1.         public void StartClient()
    2.         {
    3.             if (_driverStarted)
    4.             {
    5.                 Debug.Log("Client driver already started");
    6.                 return;
    7.             }
    8.  
    9.             Debug.Log("Starting client");
    10.             _clientDriver = new UdpNetworkDriver(new ReliableUtility.Parameters { WindowSize = 32 });
    11.             _pipeline = _clientDriver.CreatePipeline(typeof(ReliableSequencedPipelineStage));
    12.             _serverConnection = default;
    13.             _driverStarted = true;
    14.         }
    Is it OK?

    We are testing our product and what I want to know is if we are doing it right (programming-side).

    Another interesting thing would be to know if we are losing packages for debuging purposes. Is it possible track somehow?

    Regards,
    Andrés Y.
     
  6. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    268
    The code seems fine, and you just use _pipeline when sending to make it go through the reliability. The soaker project has an example of how you can extract statistics from the reliability pipeline buffers, see GatherReliabilityStats in the tools part. You could see there if you're actually sending the amount of packets you expect through there. Stats are kept in the reliability buffer (see Statistics) but it's a bit of a process to extract it, but the soaker example should give you the idea. When using the pipeline you should be aware it's not suitable to sending a lot of traffic, more like events and commands (where there aren't more than 32 packets in flight at the same time). This could explain packet loss happening when too much is being sent through the pipeline.
     
  7. gamefox87

    gamefox87

    Joined:
    Aug 19, 2016
    Posts:
    22
  8. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    509
    Hi, Is there any ETA for packet pre-fragmentation for large chunk of data? (equivalent to LLAPI's QosType.XXXFragmented)
     
  9. sophiepeithos

    sophiepeithos

    Joined:
    Sep 10, 2014
    Posts:
    54
    hello, will the fps sample receive updates with multiplayer's new reliable udp and client prediction feature?
     
  10. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    268
    It does not, we have fixes for it in an upstream branch which will be merged in with the next push. There were some API changes and some package dependency versions need to be bumped.

    No, sorry :(

    There is no commitment to do it right now, but no final decision has been made either way, so it's a "maybe".
     
  11. gamefox87

    gamefox87

    Joined:
    Aug 19, 2016
    Posts:
    22
    Will the networking system be ready by October of this year? I only see one branch for that repo.
     
  12. KuantikoStudio

    KuantikoStudio

    Joined:
    Apr 2, 2019
    Posts:
    5
    Hello,

    I'm still having a lot of problems with package loss. I'm working on a project where we have 1 server and multiple clients over a WiFi local network and I'm experiencing so many problems with package never reaching the endpoints.

    I'm already working with the reliability pipeline (as I shown in my previous message), but I think it is not enough.

    Is there any other way to ensure packages will reach to server/clients?

    And another (related) question, is there any way to work with TCP instead of UDP?

    Regards,
    Andrés Y.
     
  13. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    509
    @larus If Unity does not support pre-fragmentation for Unity Transport soon, can you provide documentation about pipelines to Unity users? It seems that the only way for implementing fragmentation is using pipelines, but there is no useful documentation.

    https://github.com/Unity-Technologi...y.transport/Documentation~/pipelines-usage.md

    This is only introduction about Untiy's builtin pipeline, not for creating custom pipelines. Of course, the source code can be resources, but official documentation can boost up developer's understanding I think.

    Thanks.
     
  14. KuantikoStudio

    KuantikoStudio

    Joined:
    Apr 2, 2019
    Posts:
    5
    After reading again your message, I realised that I was using the reliability pipeline for every communication but I have to use it only for specifics events.

    Now I'm tring to implement two different pipelines (reliable and unreliable), but since then the app no longer runs OK and I suspect that it's caused because I'm doing something wrong when using both pipelines from the same driver.

    This is my code now for server start:
    Code (CSharp):
    1.         public void StartServer(int port, int maxConnections)
    2.         {
    3.             Debug.Log("Starting server, port: " + port);
    4.             _serverDriver = new UdpNetworkDriver(new ReliableUtility.Parameters { WindowSize = 32 });
    5.             _reliablePipeline = _serverDriver.CreatePipeline(typeof(ReliableSequencedPipelineStage));
    6.             _pipeline = _serverDriver.CreatePipeline(typeof(UnreliableSequencedPipelineStage));
    7.             NetworkEndPoint endpoint = new NetworkEndPoint();
    8.             endpoint = NetworkEndPoint.Parse(IPAddress.Any.ToString(), (ushort)port);
    9.  
    10.             if (_serverDriver.Bind(endpoint) != 0)
    11.                 Debug.Log("Failed to bind to port " + port);
    12.             else
    13.             {
    14.                 _serverDriver.Listen();
    15.                 Debug.Log("Server started successfully");
    16.  
    17.                 ServerStarted?.Invoke();
    18.             }
    19.  
    20.             _clientConnections = new NativeList<NetworkConnection>(maxConnections, Allocator.Persistent);
    21.             _driverStarted = true;
    22.         }
    And this is what I do to send with or without the reliability pipeline:
    Code (CSharp):
    1.                         if (clientWriter.isReliable)
    2.                             _serverDriver.Send(_reliablePipeline, _clientConnections[i], clientWriter.writer);
    3.                         else
    4.                             _serverDriver.Send(_pipeline, _clientConnections[i], clientWriter.writer);
    What I'm doing wrong?

    Is there any example of using more than one pipeline at the same time?

    Thank you.
     
  15. nek1113

    nek1113

    Joined:
    Apr 10, 2019
    Posts:
    12
    will pricing be based on concurrent players ? or server resources used? (cpu ram etc), will it be scalable?Will I be able to host client-servers on player machines (with the LLAPI)?
     
    Last edited: Sep 27, 2019
  16. andykais

    andykais

    Joined:
    Oct 15, 2019
    Posts:
    1
    Hi all, is it possible to hit the Server Query Protocol with an external service? We are working on our own intelligent server scaling system which needs to know information about the player count inside a game server.
     
  17. tinnystudios

    tinnystudios

    Joined:
    Oct 27, 2016
    Posts:
    5
    Hey guys, just tried out the sample scenes from GitHub. All works very well on PC.

    But running NetCube on android, the moving cube from another device (PC) appears choppy.

    Is there a setting I have to change?
     
  18. SantiagoCalle

    SantiagoCalle

    Joined:
    Nov 27, 2016
    Posts:
    1
    Hi everyone. When will the new complete network system be available?
    Is this the link for the alpha version or final version:
    https://github.com/Unity-Technologies/multiplayer

    Will applications based on old networks continue to work? For example, those that have been developed using unity 2018.1

    Is photon 2 a recommended alternative?

    Thanks! :)
     
    bb8_1 and aFeesh like this.
  19. aFeesh

    aFeesh

    Joined:
    Feb 12, 2015
    Posts:
    28
    bb8_1 likes this.
  20. bb8_1

    bb8_1

    Joined:
    Jan 20, 2019
    Posts:
    17
    @timjohansson @larus @Joachim_Ante What happend to the NetCode project is it abandoned or postponed or you guys still work on it? No news from the devs for quite a while.
     
    Joe-Censored likes this.
  21. timjohansson

    timjohansson

    Unity Technologies

    Joined:
    Jul 13, 2016
    Posts:
    166
    We are still working on it and it is still an important part of dots. We have been working on a few larger features which were on development branches. We are preparing to release a new version shortly after the next entities release.
     
  22. bb8_1

    bb8_1

    Joined:
    Jan 20, 2019
    Posts:
    17
    GerardSimpson likes this.
  23. Jimmy_Lin

    Jimmy_Lin

    Joined:
    May 8, 2015
    Posts:
    10
    lookforward to the new features..
     
    bb8_1 likes this.
  24. WAYN_Group

    WAYN_Group

    Joined:
    Mar 16, 2019
    Posts:
    342
    @timjohansson Thank for the news, what about a dedicated subforum with the next release ? (requestesd by many)

    Question remains when is the next entities release :p

    Edit : did not realize I was in the connected game forum wich seem to contains lot of netcode related post. Still connected game is more than just netcode if I'm not mistaken, so a subforom if possible referenced both by the connected game and dots forum would be great IMO.
     
    bb8_1 likes this.
  25. BHouse

    BHouse

    Unity Technologies

    Joined:
    Jan 10, 2018
    Posts:
    71
    >> cross-posting in several sticky threads; please pardon the repeated message<<

    We understand many of you would like to create multiplayer games / multi-user projects and are challenged by Unity's current state of netcode. We also acknowledge the netcode and workflow requirements can vary based on the projects you're building.

    So, to help us understand how to best to support you, please share your thoughts in the survey below. The survey only takes about 10 minutes, and your feedback will help inform future product decisions. Click here to take the survey by June 8.
     
    Joe-Censored and bb8_1 like this.
  26. bb8_1

    bb8_1

    Joined:
    Jan 20, 2019
    Posts:
    17
    Pls take the survey and ask among other things you are interested in for special NetCode subforum, discord server and more tutorials video especially - thx in advance
     
unityunity