Skip to content

Multiplayer Without Opening Ports- How Does it Work?

Technical question time!

Some of you may remember this from patch V1.2:

[quote]Multiplayer Match-Making (Beta)

A new match-making system has been implemented for multiplayer, removing the need to forward ports to your router when setting up a game. Just click on Multiplayer, Create Game, and give your game a session name and a password if you like. Currently open games are displayed on the Join Games screen, allowing players to quickly pick up and play with people from across the globe.[/quote]

What I'm wondering is: How does this work? How did you manage to get game connections without opening ports? Are you using low-numbered ports that are usually reserved for other things like web browsers and the like? I work with an indie game and I'm massively curious as to how you pulled this off.

Comments

  • elminsterelminster Member, Developer Posts: 16,317
    Might be best to peg someone like @Dee or @Jalily to get an official response.
  • rathlordrathlord Member Posts: 171
    Asked @Dee in a PM but he didn't know. Any idea who handled the netcode?
  • JalilyJalily Member Posts: 4,681
  • rathlordrathlord Member Posts: 171
    Thanks @Jalily maybe @scottbrooks can provide some insight then. Weird question, I know.
  • ScottBrooksScottBrooks Member Posts: 687
    We use http://en.wikipedia.org/wiki/Jingle_(protocol)

    Specifically https://code.google.com/p/libjingle/

    This is the same approach Steam uses, as per https://partner.steamgames.com/documentation/api
    If you search for Peer-to-peer networking there is a brief mention there.

    As far as the integration of libjingle, it's not an easy process. There is a lot of code to write.
  • rathlordrathlord Member Posts: 171
    Huh, thanks @ScottBrooks. It may be out of the scope of what I'm doing then, but I really appreciate you taking the time to let me know.
  • llTyllllTyll Member Posts: 1
    edited March 2014
    @rathlord If you want to build your own networking layer, you'd have to use one of the many NAT Traversal techniques. In my case, I'm using Session Traversal Utilities for NAT (STUN), but there are advantages and disadvantages for each. BGEE is using ICE, according to the link ScottBrooks posted. It's usually much easier to use a networking library that does all of this for you, some common ones are RakNet(Unity uses this), eNet (Although eNet doesn't have NAT punch-through out of the box) and ZeroC Ice. Good luck!
  • FredjoFredjo Member Posts: 477
    llTyll said:

    @rathlord If you want to build your own networking layer, you'd have to use one of the many NAT Traversal techniques. In my case, I'm using Session Traversal Utilities for NAT (STUN), but there are advantages and disadvantages for each. BGEE is using ICE, according to the link ScottBrooks posted. It's usually much easier to use a networking library that does all of this for you, some common ones are RakNet(Unity uses this), eNet (Although eNet doesn't have NAT punch-through out of the box) and ZeroC Ice. Good luck!


    Congratulations for the nerdiest first comment ever :D Love it!
  • rathlordrathlord Member Posts: 171
    @llTyll‌ We're actually using Raknet now, but still require manually opening ports. That may just be down to the way we implemented it, though. I'm not one of the devs (I do tech support) but just looking around on my own to see what was possible since people have trouble with port forwarding.
Sign In or Register to comment.