Search Unity

Peer to peer online game

Discussion in 'Multiplayer' started by alcolicake, Nov 18, 2020.

  1. alcolicake

    alcolicake

    Joined:
    Nov 18, 2020
    Posts:
    3
    Hello! Sorry if I am in the wrong section, hope to be in the right one.
    Im trying to understand how p2p works in a multiplayer game (1vs1) with lobby.
    If i am not wrong I noticed that if the owner of the lobby has a low upload rate, he will have some advantages and his opponent will have a really slow game. Am I right?
    I would like to understand what can influence the game if I am hosting the lobby (only low upload rate of the owner? Download doesnt make any difference)?
    What about if Im going to play as opponent and not as owner of the lobby. Is there something about me that can make my opponent suffer even if he is the owner of the lobby?
    In this specific case im talking about efootball Pes.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The answers to your questions would depend on how the networking system is designed for the game. As far as Unity, which available networking API which is chosen (if any) will have a big impact.
     
  3. alcolicake

    alcolicake

    Joined:
    Nov 18, 2020
    Posts:
    3
    Mmm, can you be more specific please?
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    There are many available networking systems for Unity. Unity themselves have deprecated the previous built in solution, and its replacement is in a public alpha state. So there's really no first party supported solution right now. Here's some information on available networking options though:

    https://forum.unity.com/threads/wha...of-available-network-solutions-assets.609088/
    https://forum.unity.com/threads/choosing-the-right-netcode-for-your-game.966593/

    It works differently for each lobby implementation based depending on which networking system you are using.
    This doesn't sounds like you're actually talking about a lobby anymore, but host/client in game performance. Whether the host has an advantage would depend on the design of your game. For example, if you design your game so the clients calculate things like bullet impacts, as many FPS games seem to do, then the host wouldn't necessarily have an advantage in that specific instance (you'll see this kind of thing where even though you're the host, you run behind cover, but still get shot and teleported back to where you were just before getting behind cover - that's because your position as known by the client who fired the bullet was used for deciding whether you were hit or not).

    As far as upload vs download rate, the host not only needs to upload to all clients but download from all of them as well. Again it all depends on the design of your game whether limited bandwidth or latency issues give an advantage to the host or not. I don't know if efootball refers to a specific game or just talking generally about games for that sport.

    Different network API's have different approaches. Photon Cloud for example, usually one of the clients acts as a host. Where other network implementations you might instead go with a dedicated server, leaving no client acting as a host so you don't need to be concerned about host advantage in your design.
     
  5. alcolicake

    alcolicake

    Joined:
    Nov 18, 2020
    Posts:
    3
    Thank you so much for your answer, so you're telling me i need to know more about specific game.. It's pretty hard about that, but thank you anyway..
     
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'm telling you if you have specific questions about how a networking system works, you need to be specific about which networking system you're referring to. After you've chosen one, you then can look into how that specific networking system implements all this stuff (or if it doesn't, and you need to implement the functionality on top of the networking system yourself). There's a dozen or more different networking API's to choose from, and they all have their own unique twist on how this stuff typically works.

    If you just stick to generalizations on networking, then the answer pretty much always will be "it depends on how you implement it", which is really a non-answer so not particularly helpful.