Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow people to host their own multiplayer without port forwarding?

There's lots of games on Steam nowadays (Table Top Simulator, SpeedRunners) that allows people to host their own online multiplayer matches/games without the need for port forwarding.

One thing I thought of of how they do it is they simply have one server that processes all the matches as separate threads.

But then I'm starting to wonder about getting bottle necked.

I then heard these games simply somehow allow TCP to be holepunched through their NAT, getting past the need for port forwarding.

But how in say, C++ using winsock, would one do this? Or GameMaker: Studio? Or just any game in general? How do you allow people to play without port forwarding? What's the process?

I see so many games on Steam do it nowadays it must not be too complicated.

like image 781
Ran Shorowitz Avatar asked Oct 11 '25 14:10

Ran Shorowitz


1 Answers

As this question is explicitely related to steam, I think it's worth mentioning the steamworks API, especially SteamNetworking. It allows peer-to-peer connection relaying through steam servers:

https://partner.steamgames.com/doc/api/ISteamNetworking

bool AllowP2PPacketRelay( bool bAllow );

Allow or disallow P2P connections to fall back to being relayed through the Steam servers if a direct connection or NAT-traversal cannot be established.

like image 58
Sebastian Avatar answered Oct 14 '25 06:10

Sebastian