Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Is there a way to join player in other network without lan connection with him?

Discussion in 'Multiplayer' started by Xyloven, Aug 14, 2022.

  1. Xyloven

    Xyloven

    Joined:
    Feb 22, 2021
    Posts:
    8
    If i can, then how to do it?
     
  2. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    AFAIK LAN connection doesnt work with different networks.

    If you want to connect with someone on other network you can:

    -Port forward: Open a port on you router so it doesnt block connections on that port.
    -Host a dedicated server on Azure, AWS, Google Cloud… and both players connect to that server.
    -Use a relay like Steam, Photon, Epic or Unity.
     
  3. Xyloven

    Xyloven

    Joined:
    Feb 22, 2021
    Posts:
    8
    what do you mean by "unity"?
     
  4. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Unity relay
     
  5. Xyloven

    Xyloven

    Joined:
    Feb 22, 2021
    Posts:
    8
    Is there a free way to do non-lan connection?
     
  6. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Port forwarding is completely free

    Hosting a server can be free (with limits):
    -With Azure and AWS you have some free hours every month (depending on the region and how much cores the server has)
    -Google cloud offers a free cluster

    About relays:
    -Steam costs a one time fee (100$) which includes launching your game on steam. But you can use app id 480, which is a free app id for developers to test (if you use this keep in mind that there are a lot more devs doing it, and your lobbies can appear on their lobby list and vice versa)
    -Photon Realtime has 20 free CCU, and you have to pay as you get more.
    -EOS is free, but a nightmare to use.
    -I dont know about Unity Relay, but I think its free until you get X number of CCU.

    This relays can be considered too low level (I dont know about unity) and a little bit hard to use, so there are some transports for networking solutions that act like wrappers for them:
    -Mirror has a Steam and Epic transport.
    -Photon PUN, bolt and fusion are built on top of realtime.
    -Fish-Net has a Steam transport and a Epic transport will come soon, and I think that a Photon realtime transport is planned.
    -Netcode for gameobjects has a Steam transport and a Photon realtime transport.
    -Riptide has a Steam transport.
     
  7. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    I think it uses Photon PUN, but it will be a better idea to use fusion.