More features
Networking
Sending data between players over Steam's relay network.
Steam's networking carries data between players without either of them needing a public IP. Traffic can route through Steam's relay network, which hides player IP addresses and gets through NAT that direct connections cannot.
What this is, and what it is not
This is a message channel you drive yourself. You open a connection, send bytes, and handle what arrives. It sits alongside Unreal's replication rather than replacing it.
It is not how your replicated actors travel. That is the engine's net driver, chosen in config, and nothing on this page touches it.
| This page | The net driver | |
|---|---|---|
| Carries | Bytes and strings you send by hand | Replicated actors, RPCs, everything Unreal does for you |
| You use it by | Calling nodes | Configuring it once, then not thinking about it |
| Set up in | Blueprint | DefaultEngine.ini |
Both can route through Steam's relay, which is what makes them easy to confuse. If what you want is players connecting to a host at all, you want the net driver, covered in playing over the internet. Come back here when you need a side channel Unreal's replication is a poor fit for: a lobby chat, a file transfer, a voice stream.
Hosting and connecting
| Node | What it does |
|---|---|
| Start Listening P2P | Accept peer to peer connections |
| Connect To Peer | Connect to a host by Steam ID |
| Start Listening IP | Accept ordinary IP connections, for a dedicated server or LAN |
| Connect To Address | Connect by address, for example 1.2.3.4:27015 |
| Stop Listening | Stop accepting new connections. Existing ones stay open. |
Prefer the P2P nodes for player hosted games. The IP nodes listen on a real socket, so player addresses are visible to each other and NAT traversal becomes your problem instead of Steam's.
A typical host flow
- Start Listening P2P
- On On Incoming Connection, call Accept Connection, or Close Connection to refuse
- On On Connected, the peer is usable
- Send Bytes or Send String, and handle On Message Received
A client just calls Connect To Peer with the host's Steam ID and waits for On Connected.
Relay readiness
Relay access is requested automatically at startup and takes a few seconds to become ready. Get Relay Status reports progress. Connections started before it is Current simply take longer rather than failing.
Ping without connecting
Get Local Ping Location returns an opaque token describing where this machine sits in Steam's relay network. It is not geography and not an IP address, which is what makes it safe to publish.
Put it in your lobby data and any other player can estimate their ping to you without either of you connecting first:
- Estimate Ping To Location from this machine to a published location.
- Estimate Ping Between Locations between two published locations, neither of which needs to be you.
That is how a lobby browser sorts by latency honestly. Check Is Ping Data Ready first, since Steam needs a few seconds after startup to measure.
Connection lanes
One connection normally means one queue, so a large reliable message blocks everything behind it until it finishes.
Configure Connection Lanes splits a connection into independent priority queues, so a 4 MB asset transfer stops delaying the position updates travelling beside it. Send Bytes On Lane chooses the queue.
Lower priority numbers send first. Lanes sharing a priority split bandwidth by weight.
Configure lanes right after the connection opens and before sending anything. Steam will not shrink the lane count afterwards.