I’m looking to add a peer to peer solution and bundle the RS with the build.
Looking at the docs, it looks like there is no out-of-the-box supported method to connect to someone directly using IP address. Is that correct?
I see there is a steam integration, but my first instinct is to not use any 3rd party service for the relay since that’s kind of the point of using peer to peer, at least in our case.
Is a direct IP connection not really compatible with how coherence works, or is this maybe something that might be supported by coherence in the future?
Mostly just trying to gauge my options here. Thank you.
Hey, it’s certainly possible to just connect to a known IP if that IP is reachable. At the end of the day the coherence client just needs a valid RoomData host, which can be constructed by hand: RoomHostData
But in most real world cases you will need a relay in order to actually connect between peers due to NAT punch-through and resolving real-world networks. Check out the note on the Steam relay page, specifically the note about the final result of the relay often being a direct connection between two hosts (e.g. data is not flowing through Steam)
Although the diagram above shows that traffic is routed via Steam servers, it is often the case that traffic can flow directly between player and host machines without actually making the extra hop via the Steam servers.
This technique is commonly referred to as “hole punching” or “NAT Punch-through” and greatly reduces latency, however, it is not supported on all networks due to firewall restrictions.
Steam’s networking service will first attempt a NAT punch-through and then automatically fall back to relayed communication if the punch-through failed.
Thank you for that, makes sense. I’m really just looking for the simplest solution possible for now and will build upon it later, and what you’ve suggested is very simple.
In the end, we will use Steam Relay almost certainly; that just takes a few extra steps.
There is a caveat when running a local replication server but not using the Steam Relay model:
you have to run the replication server with the additional option: “–local-ip-override HOST_IP_ADDRESS ” to make sure the replication server is binding to the right public IP on the host machine.
You’ll also have to do port forwarding if the clients are on different networks. UDP and TCP ports are different for rooms and worlds but you can get the ports if you use the copy button for the appropriate setting via the HUB: