Hi! A few fays ago I opened this question. As I noted there, I was trying to make a simple game in which a player could host a session and another player could join such session, but I couldn’t get it to work. Finally I solved the issue by unblocking some ports of my router. But now I have a question regarding network ports and EOS.
As I said, I couldn’t get my game to work until I unblocked the ports listed on How to troubleshoot connection issues - Technical Support, but until then I had been able to play Fortnite and Fall Guys just fine. My question then is: Why is that? Why could I play other EOS games but not mine? The company I’m working for is specially worried about whether or not people will be able to play our game without unblocking these ports. What are other considerations I should take into account regarding networking ports?
You need to look into implementing networking UPnP. As it pertains to networking, UPnP allows an application to request that the router open and close ports. The caveat of course is that the end user has to have UPnP enabled on their router. It’s worth noting that this is enabled by default on most consumer routers for this exact reason. Otherwise, none of the titles you mentioned would be able to communicate properly.
UPnP should only be used on LAN never on WAN which is a big hack causing plenty of security issues.
Games normally use NAT hole punching techniques like STUN ( Session Traversal Utilities for NAT) which requires a STUN server.
Game services like Steam already provide this feature out of the box and AFAIK EOS also provide this.
The thing is, I’m seeing on many sites/forum threads that EOS already implements NAT hole punching or another network technique to achieve the same goal. Still, I couldn’t host a game on my PC (in the test game I mentioned on my 1st post) until I unblocked those ports. Despite being using the PC I frequently use for gaming and having faced 0 issues running all kind of online games all these years.
And then, the test game didn’t work on my office’s PCs either, which is something that puzzled my boss and he asked me to find more info about it, because we can’t trust our future players will be willing to fiddle with their routers and ISPs if necessary.
I’m not sure if I ran into a bug or if I did something wrong with my game/I should have done something more (UPnP, Nat hole-punching, whatever). Then again, people tell me EOS is supposed to handle these things by itself. I’m also 90% sure my office just has some ports blocked, because when I’m there I can’t access my friends’ list on the Epic Launcher.
So that’s what I’m looking for: more info. Is it a bug? is EOS supposed to handle it by itself? should I be able to forward ports on my players’ computers…?
That’s specific to EOS and seems like what you’re after. It’s my experience that this sort of stuff is not entirely free, you definitely have to set it up properly. The link above seems to provide some guidance on the subject.
I was under the impression that LAN was what we were talking about here, did I misunderstand that? It’s my understanding that UPnP and NAT hole punching are aiming at a common goal, where UPnP requires that the user has the feature enabled on their router (which most do by default) and NAT hole punching requires a middle-man/service. Am I wrong on that? I ask because I will shortly be in the same predicament and I want to make sure I have it right.
EDIT:…of course saying it out loud, I’d imagine you don’t want to rely on the user’s router configuration and thus UPnP can be seen as unreliable.
No, no, no LAN, I’m supposed to make an online game, like, over the internet around the world. Not a LAN game.
And about the link that you showed me before, I’ve looked at it, but my company told me they don’t wan’t me to use C++. In fact they’re even considering to buy some plugins that would allow us to do most of the networking job using only Blueprints.
Ok, I think we’re just talking past each other with respect to LAN/WAN. When I say LAN I’m talking about everything behind the WAN which includes your router. I’m not implying that this is a LAN only setup where 2 players are connecting over the same router. I’m simply saying that you need to open a hole through your LAN so someone on the outside can connect in from the WAN. There are 2 main ways of doing this automatically and that is UPnP and as @GarnerP57 suggested, NAT hole punching. NAT hole punching appears to be the most fool proof as it doesn’t require that the user have UPnP enabled on their router. The downside is that you have to make use of a middle-man/service. EOS is acting as that middle-man/service which will attempt to punch a hole through your LAN, opening it up for connections from the WAN.
It would seem EOS does support this but it doesn’t seem to be out of the box and blueprint friendly. So if you’re stuck with only blueprint you are likely going to have to look elsewhere or into a plugin that exposes it to blueprint for you. Best of luck!!
Hey folks, I am following up here since I ran into something similar. The P2P interface seems like the trick here. If you want to run your game client as a listen server and have it work over EOS, then you need to programmatically open ports from the game client; Steam and other platforms do this for you automatically. Otherwise, players will have to manually open ports on their router, which is no fun.
If you intend to use EOS’ P2P socket functionality for player hosted matches, verify or add the following line to the [/Script/OnlineSubsystemEOS.NetDriverEOS] section: bIsUsingP2PSockets=true
So yeah, NAT punchthru via EOS only occurs if you have the P2P interface enabled. Unfortunately, there is a bug in 4.27.2 that was fixed in UE5 in which the bIsUsingP2PSockets does not work and fails to initialize.
Here’s a screenshot from a post explaining this in UDN:
Here’s a link to the patch in UE5. I will be trying to integrate that patch into my 4.27.2 engine, but it looks like it will be difficult to integrate smoothly.
To be more clear, the Nat Punchthrough stuff is NOT implemented in EOS OSS plugin right now.
It IS implemented in the EOS SDK but it is not implemented in the plugin for EOS you can get for free in the plugin list.
So your options are to manually utilize the EOS SDK stuff or to use 3rd party $130 EOS plugin from redpoint (haven’t tried it myself but they claim it works):
You could also just use the steam subsystem instead which based on others post DOES have NAT punchthrough stuff built in. However, that requires a steam app ID which costs $100. However that app id also lets you publish to steam.
I wasted a ton of time thinking the EOS plugin has NAT stuff built in hope I can save people some time by being more explicit.
Correct - EOS leverages relay servers automatically if NAT punchthrough fails.
While the P2P Interface will attempt NAT-traversal, it is not always possible to receive incoming connections when one or more peers has a restrictive NAT. In these cases a relay is required, which will be used automatically in case of NAT-traversal failure.