Hi, multiplayer games usually have problems when both (or more) players have nat (Network address translation - Wikipedia). Does UE4 have any built-in nat punch? If UE4 don’t have such, do you have any idea how combine steam’s networking with UE4?
The Steam networking API is a simple set of functions to let the game send data directly between two Steam users. To make connections from behind home NAT’s, it uses the libjingle NAT-punching library or, if no direct connection can be made, through the Steam relay servers.
See the documentation page about Steam peer-to-peer networking.
On the page Steam Networking (Steamworks Documentation) some steam functions to handle networking, but as i know UE4 handle network by itself. Is here any way combine steam’s nat punch (libjingle NAT-punching library or through the Steam relay servers) and UE4 network handling?
Check out the Shooter Game to see the generic implementation of Steam using Epic’s OnlineSubsystem which auto detects the right online system to used based on platform.
For Windows it is Steam.
See Shooter Game files:
Online/ShooterGameSession.cpp
config file, DefaultEngine.ini
To see how to use steam via UE4’s OnlineSubsystem!
I’ve hosted real multiplayer games for my own c++ projects using Steam with both Epic staff and many developers so can I assure you everything is fully operational.
UE4 uses Steam’s NAT traversal powers perfectly well when you use the OnlineSubsystem as is demonstrated in ShooterGameSession.cpp .
ShooterGameSystem? If you just mean the SteamOnlineSubsystem, it’s perfectly fine, you have to pay to put your game ON Steam, however if that’s what you mean.
I just want to be able to make two players be able to play without forcing them to open ports or use any other 3rd party software.
So if I’m not mistaken the steam plugin can do that right?
The online sub system doesn’t handle actual hosting, you still have to host it. Steam is for things such as saving cloud data, friends lists, achievements, etc. You choose a server (digital ocean, whatever) to host on, and then you forward the ports on that server. As long as your game is being ran as a dedicated server and your users aren’t hosting the games you’re fine. Only the person who is getting the connections (the current “server”) has to port forward.
UPNP Plugin is only partial solution for routers who have that feature turned on. NAT punch is much more universal solution that would work even UPNP will not.
You can check your router by downloading this tool: http://upnp-wizard.findmysoft.com/download/