Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How are you networking your game?

Discussion in 'Multiplayer' started by tommohawkaction, Sep 2, 2018.

?

What do you use?

  1. UNET

    40.0%
  2. LLAPI

    13.3%
  3. Steam Matchmaking API

    26.7%
  4. Raknet

    6.7%
  5. Photon

    20.0%
  6. Other (Please say in the comments)

    26.7%
Multiple votes are allowed.
  1. tommohawkaction

    tommohawkaction

    Joined:
    May 20, 2017
    Posts:
    27
    Hello there,

    As it states in the title, I was wondering what API if any, are you using to network your game?

    Currently I am using a mix between Steam Matchmaking API (Using P2P and Steams lobby system)
    and LLAPI. I use LLAPI for testing in the editor (Two clients) so that I don't have to have another computer on Steam ready to test, and I use Steam matchmaking API for the release version.

    I also send messages using Packets which I serialize/deserialize when writing/reading, I don't use RPCs or anything like that, as im unaware how to implement that with the current system I'm using.

    Thanks!
     
  2. NearAutomata

    NearAutomata

    Joined:
    May 23, 2018
    Posts:
    51
    I haven't started on the Networking yet since I wanted to wait on the new solution coming with 2018.3 but I stumbled upon something called Mirror which looks really promising. If you happen to prefer UDP over TCP LiteNetLib might be worth a look as well.

    In the next weeks I will be experimenting with Mirror first and hopefully the new official solution will be released for testing by then.
     
  3. tommohawkaction

    tommohawkaction

    Joined:
    May 20, 2017
    Posts:
    27
    Am I correct in saying, you need both UDP and TCP for games.
    for example Player movement done using UDP
    and changing scene would use TCP?

    Will look at both of them, cheers!
     
  4. NearAutomata

    NearAutomata

    Joined:
    May 23, 2018
    Posts:
    51
    IIRC certain big MMOs, especially World of Warcraft, dropped UDP entirely in favor of TCP. Unfortunately I am not an expert on networking so I don't know which combination of protocols is used for what in particular.
     
  5. tommohawkaction

    tommohawkaction

    Joined:
    May 20, 2017
    Posts:
    27
    Ah, its just im trying to make a 2d game where you can push blocks and that seems to be a harder task then what meets the eye.

    Heres my reference about TCP and why its bad to use
    https://www.gdcvault.com/play/1022195/Physics-for-Game-Programmers-Networking
    Click on [TCP @ 100ms Round Trip and 1% Packet Loss] or go to 7:29
     
  6. NearAutomata

    NearAutomata

    Joined:
    May 23, 2018
    Posts:
    51
    Nowadays the internet and connections are more reliable in general. The RTT to the other side of the world usually is about 150ms.

    Of course, it definitely depends on your use case. Something that relies heavily on physics or something that has to be accurate in real-time such as a FPS will still benefit from UDP. Coming back to my MMO example, the game won't break since a delayed message is not as bad as no message at all.
     
  7. tommohawkaction

    tommohawkaction

    Joined:
    May 20, 2017
    Posts:
    27
    Ah yeah that makes sense. Have you ever tried networking physics, there doesn't seem to be much on the topic. Just wondered how games like Human fall flat and Gang beasts managed to pull it off. Been trying to figure it out for a good few months now
     
  8. NearAutomata

    NearAutomata

    Joined:
    May 23, 2018
    Posts:
    51
    Unfortunately I am not doing Physics myself, but you can still refer to Glenn Fiedlers blog (the guy in the GDC talk you just linked moments ago).
     
  9. tommohawkaction

    tommohawkaction

    Joined:
    May 20, 2017
    Posts:
    27
    Yeah been looking through that for some time, I always get stuck at one point and thats depending if the server has authority over every players position or the client sends position to server both have different issues

    [Server having authority issue]
    Latency -> To fix this issue you use client side prediction which is basically hard in the Unity engine for physics, as we are stuck with the same issue as Client having authority over the position

    [Client having authority over the position]
    When colliding with other networked ridgidbodies it doesn't feel right and has a lot of jitter as you are hitting them in the past so when you get an update from the server it will ping them back to a previous place in the past

    Maybe im doing it wrong?
     
  10. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    There's a reason that UDP is the most common protocol for realtimer sensitive gamrs. TCP works for some games but UDP is by far the most common
     
    Joe-Censored and tommohawkaction like this.
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Nothing this second, but in the market for one. Just need the right offering.
     
  12. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Developed my game for Unet, but ran into reliability issues and now I'm nearing completion of my own in house UDP networking API.
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds like you used a lot of coding and algorithms.
     
    TwoTen and Joe-Censored like this.