By Kevsoft on May 20, 2019 at 9:05 AM
  1. Kevsoft

    Kevsoft XLiveless Dev
    Staff Member Administrator

    Oct 24, 2017
    Likes Received:
    Trophy Points:
    Hello fellow AOEO players!

    In the last couple of weeks we have been looking into how we could improve the connectivity between players. Given that all multiplayer games with the BANG Engine (AOM/AOE3/AOEO) are based on peer-to-peer the only way to currently play with each other is with the help of UPnP, port-forwarding or via a private VPN-System like Hamachi. Unfortunately UPnP doesn't always work and port-forwarding is a hassle to set up, especially for those who are not really tech-savvy.

    We decided to look into how other platforms like Voobly, GameRanger or AOE3 work and deal with this issue. To give an understanding why those platform offer better connectivity than we do, we have to look what techniques/technologies are possible:

    • Manual port-forwarding (Can be used with Celeste)
    • UPnP (Can be used with Celeste)
    • Relay-Server
    • NAT-Punchthrough (Coming up!)

    Manual port-forwarding
    Port-forwarding is the most complicated to setup but also the most reliable way to get people connected. If you port-forward you are basically saying the router: "Hey, map my external ip with the port 1000 to my internal-ip (my computer) with the port 1000". So if someone tries to connect on Port 1000 it will reach your computer.

    There are some problems though: First of all it is a hassle to set it up and secondly not everyone has admin access to the router. Especially if your outside of your Home-LAN (like Mobile Networks, Public WiFis, ect...). Those people then have to rely on UPnP or if that fails they have to use Hamachi which locks them inside a VPN-System.

    UPnP is a technology that allows applications to request temporary port-forwarding-mappings for application, basically as if your application would configure the router. Also this technology is not the best solution as the ports may already be reserved for other applications or other computers and that UPnP might be disabled completely or not available on the router you are logged in to.

    A relay server is basically a server that stands out as a middleman between the game connections. It is basically how Hamachi or VPN in general are working internally, but a Relay-Server is more application/service-specific. It would allow players to connect to each others regardless on what network/router they are behind as the relay server is a public server that just redirects the messages. So why haven't we implemented such a service?

    Well, first of all running such a service would mean extra cost for us. It would require running another public server that would probably eat lots of networking resources. The second reason is also in the interest of the players: latency. Having a server in between would mean extra latency between the players. To have a relay service with low latency guarantee it would require us to not only to setup one relay server but having to setup multiple ones around the world.

    Coming up: NAT-Punchthrough
    NAT-Punchthrough is a bit complicated to explain as it exploits a mechanism in the router that is widely used in P2P-Networking. Basically we send a networking request from UDP 1000 to our Celeste server. When the request is sent, your router will add a NAT-Entry. See it like a "callback-number", because obviously there must be a way that the Celeste service can send a response. Now we can tell other clients about this "callback-number" as they can also use this to send information to the other client. These NAT-Entries are temporary and only open between 30 seconds and 10 minutes from the last networking request sent (depending on the router), so these requests to the Celeste service has to be done just right before a multiplayer session is opened. If you're interested in this technique you can read about it here:

    The advantages with this technique is clear:
    1. Multiplayer games can be played even if the player doesn't have admin access to the router or if UPnP is disabled.
    2. Multiplayer games can be played even if the port 1000-1005 is blocked by the router.
    3. Multiplayer games can be played with the other ones having UPnP enabled or if they have manual port-forwarding active. So it doesn't matter if your co-op partner doesn't use NAT-Punchthrough.
    Possible disadvantages:
    1. It is harder to find out why a connection has failed. (Did the NAT-Punchthrough-Request was too early? Was it too late? Did the router block it?)
    2. It is not guaranteed to work, but the success rate is very very high across router manufactures.

    Coming with this update, NAT-Punchthrough will be enabled by default as the advantages outweighs the disadvantages. In the launcher you will still be able to switch back to UPnP/Manual-Mode in case NAT-Punchthrough doesn't work.

    How reliable is this technique?
    According to the paper about NAT-Punchthrough the success rate is roughly at 80%. It might be even higher, given that the paper was written back in 2005. In any case you can always switch back to other modes (WAN/LAN/Hamachi).

    What about players behind the same Network. Do I need to play in LAN-Mode?
    We haven't tested it yet, but in theory it should work. If, for example, the external port 1000 is already used by a player behind the same LAN-Network, then the router will assign you a different one and map it to your local port on your local ip address. If anyone can confirm that it works or doesn't work, then let us know.

    HELP! It doesn't work :(
    Beware! When you first try out this new network mode, the windows firewall will alert you if you want to allow a new connection. Because of this request your first connection attempt might fail. Even if your first connection attempt doesn't work you should attempt a second one as your fellow players you're playing with might have to accept this firewall request as well.

    What cases have been tested?
    * 1v1 Arena
    * 1v2 Arena (required a 2nd connection attempt)
    * 2v2 Arena
    * 1v1 Sparta
    * 2v2 Sparta (required a 2nd connection attempt)

    I hope that with this new technique we sort out most of the connection issues. We will hope that we can optimize it in the future and sort out any issue that might come along the way.

    Thank you for reading and happy battling!

    - Celeste Development Team


Discussion in 'News' started by Kevsoft, May 20, 2019.

    1. WiriWout

      WiriWout PvP Balance Team Member
      Staff Member

      Nov 10, 2017
      Likes Received:
      Trophy Points:
      If this turns out to work as well as stated here it will be amazing. Thanks a lot for your efforts!
      Ardeshir likes this.
    2. Exclusive0r

      Exclusive0r Hippikon

      Nov 5, 2018
      Likes Received:
      Trophy Points:
      Certainly sounds great to get more co op's going too ...
      Now I was thinking about this, but my angle was from Celeste Launcher and using Freelan open source

      Open-source How else would you trust a software ?
      Freelan is free software, released under the GPLv3 license. By "free", we both mean free as in "free beer" and free as in "freedom". You will never pay a dime to download, use or update the software: everything comes for free, forever.

      You can easily access the source code and make sure what happens to your data. We believe this is paramount when dealing with security software: if the source-code is closed to your eyes, how can you be sure that it does what it claims ? How can you be sure it contains no security flaws ?

      Being free software means you can use freelan's code in your own free project to create awesome stuff ! Do whatever you want, and share it with others in turn !
      But now I read this it's like well let's try it :)
    3. CrimsonCantab

      CrimsonCantab Woad Raider

      Sep 14, 2018
      Likes Received:
      Trophy Points:
      THIS. IS. HUGE!

      Connectivity Issues are the largest portion of the barrier-to-entry for new players trying out PvP, especially with 2v2. I agree that NAT Punch-through is the biggest bang-for-your-buck in terms of what options there are out there that we have not used yet.

      Good work, devs!
      Ardeshir and WiriWout like this.
    4. Ardeshir

      Ardeshir Immortal

      Apr 8, 2019
      Likes Received:
      Trophy Points:
      Taking a second attempt to get a 2v2 lobby going is going to be much much better than not being able to 2v2 even after everybody has forwarded ports, and having to use hamachi-LAN anyway. Thanks for looking into and trying this folks!
    5. Kenji03

      Kenji03 Champion

      Jul 17, 2018
      Likes Received:
      Trophy Points:
      Thank you for this, this is the kind of Quality of Life updates I came back to AOEO hoping to find -- keep up the good work!
    6. ThorkellMoon

      ThorkellMoon Villager

      Dec 2, 2018
      Likes Received:
      Trophy Points:
      Just wanted to give this a thumbs-up as someone who has multiple players in the same household. Looking forward to testing this out!
    7. TheSpaniard

      TheSpaniard Champion

      Jan 15, 2019
      Likes Received:
      Trophy Points:
      I know i'm late to the party, but.... now that this has been live for almost a month, do we have any data/statistics on improved connectivity? Or even anecdotal evidence of how this has improved connectivity? Any further information or updates?
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice