I am struggling to synchronize player states across Steam and Xbox using the Epic Online Services (EOS) SDK in a custom C++ engine. What is the most reliable way to handle NAT punchthrough and session relay without incurring massive server costs for a small multiplayer title?
3 answers
The most cost-effective route is utilizing the EOS P2P interface which handles NAT punchthrough and relay servers automatically and for free. When working in C++, ensure you are using the EOS_P2P_SendPacket function with a reliable-ordered flag for critical state data. For a small title, you don't need dedicated servers; the EOS lobby system can act as your matchmaking backend. I implemented this for a 4-player coop game last year and the latency was minimal across regions. Just be sure to handle the "Edge" cases where P2P fails by falling back to the Epic relay servers.
Are there any specific pitfalls when trying to map Steam IDs to Epic Product IDs for persistent cross-progression save files?
I highly recommend looking into the "EOS Plus" plugin if you are on Unreal, but for a custom engine, the SDK's samples are your best friend for C++ headers.
Definitely. The sample code for the P2P NAT traversal saved us weeks of development time. It’s the most robust part of the entire Epic SDK documentation.
Lawrence, the trick is to use the EOS Connect Interface. You link the Steam Auth Session Ticket to an Epic Account ID. Once linked, you use the Epic ID as the primary key in your database. This keeps the progression unified regardless of which store the user launched the game from.