No announcement yet.

Options for online, real-time multiplayer

  • Filter
  • Time
  • Show
Clear All
new posts

    Options for online, real-time multiplayer

    (Sorry in advance for misusing some of the terms, I'm not a networking expert).

    I am trying to get a picture of the available options for doing online real-time multiplayer on both PC and tablets. Here is what I came-up with so far.

    1. Have one of the players be the server. This requires that they forward UDP traffic on port 7777, either by asking them to edit their router settings, or using UPnP or similar. This will not work on some exotic network configurations and there is no ultimate solution for NAT problems.

    2. Host dedicated server instances. This requires a process running UE for each active game session. Without having made any calculation, I don't see how this can be good in practice considering that each VM can probably run only a few instances simultaneously, and CPU and RAM is still pretty expensive in cloud hosting.

    3. Write your own dedicated server, mimicking UE dedicated server but optimized just for your use case.

    4. Using custom server code or a 3rd party service, open a connection between two players, and route the UE neworking on it. Like 1), one of the players acts as the host, but they don't have to know it nor do they need to fiddle with NAT. As far as I understand, this is what happens when connected through Steam.

    To me, option 4 seems to be the most realistic. It only requires a small amount of server code and server load. It's still not clear to me if this would require the traffic to go through the server once the connection is open, but either way the cost of traffic is probably way below the cost of hosted UE instances.

    Now, unordered questions:
    Is anybody taking this route ? Is there a way to specify what socket to use for networking ? Also I heard there might be restrictions on UDP on mobile platforms. Is it possible to use TCP instead, for instance by implementing a new NetDriver ? Does anybody know what released UE-powered games have used in the past ?

    Again, I'm more looking for a general picture than specific solutions. Thanks in advance

    Option #4 is going to introduce latency to the game and has other side effects that you aren't taking into account. For instance, AI on the host with rendering and networking, might overload the machine depending on what the hardware is. Giving users the ability to host means you can't control what the hardware is with the result being bad hosts affecting your players' experience. Option #2 isn't as clear cut as you make it out to be. You can run multiple dedicated servers per core and with multi-core machines, become quite efficient in hosting large numbers of players. Gears3 for instance hosted > 4 dedicated server instances per logical core, supporting large numbers per machines. With proper tuning, it's possible to support more than a 1000 players per machine, but the game design has a large impact on these numbers.

    Is there a way to specify what socket to use for networking ?
    Yes. Usually, the matchmaking service tells the client what ip/port to connect to.


      Hi joeGraf, thanks for answering.

      With proper tuning, it's possible to support more than a 1000 players per machine
      Interesting. I must say that I originally ruled-out this option thinking that it would be too expensive. But I suppose the machines you used for Gears3 cost quite a bit to host.

      Yes. Usually, the matchmaking service tells the client what ip/port to connect to.
      But that is assuming the port is open right ? I was wondering if is was possible to open a socket from client to a dedicated server, and then run the networking on this socket. As I understand, this is also called NAT punch-through.


        This is what NAT punchthrough is, you don't have to route in game traffic through your matchmaking server, just the initial punchthrough traffic that allows the clients to talk to another from behind their NAT.


          Thanks for the link. So it seems like 4) is really just 1) with NAT punch-through.


            Hey Trethaller,

            I realise I'm a bit late to the party, however, think about the amount of concurrent players you may want to have in each game / map etc and if you will be having a lobby and the use the lobby has.

            One of the things our Clanforge product does during our POC stage, is help size up and spec game server req. and help identify any potential memory leaks and, lobby issues and bad net code. As well as allowing you to manage and report on the server scaling side of things.

            When we work closely with devs, we can help them realise upto 70% saving vs AWS. But I think the real value we add is around removing pain and distraction allowing devs getr back to focusing on their game.

            If your interested in our best practice doc or for more info on our Clanforge product and what it can do,drop me a line.