🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Steamworks p2p questions

Started by
2 comments, last by ddengster 6 years, 11 months ago

Hi, I'd like to confirm some things about steamworks networking. For my game, I'm intending to set up only a SteamGameServer only for the host, and all other clients to use SteamMatchmakingServers to find and connect to the host. Tell me if I'm wrong on any of this.

1) Steamworks does not allow you to retrieve ip addresess from a steam UserId. (So you can't use their lobby + your other networking code that uses ip addresses)

2) 'Heartbeat' or 'keep alive' packets to the host are not implemented. (There is a Heartbeat packet to the steam master servers for your game, but I'm talking about host to multiple guests 'keep alive' packets)

3) There is no way to retrieve the latest ping to those connected to the host; it's something you have to implement yourself.

 

 

Advertisement

Item 1 is mostly true, they have done what they can to restrict direct access.  Many games have various practices that still expose addresses.  Hook up voice chat and you can likely see a direct connection either to the player's IP addrss or to a repeater's IP address.

Items 2 and 3 seem a little odd, so perhaps some clarification is needed.

Severs have a heartbeat to their controllers, but it seems like you are asking about using the server acting as a star, and each spoke in the star being told the status of other spokes on the star. You might be asking something else.

Any game can implement their own heartbeats if they want, and many games do.  Track the time since last message from the player, and if exceeds a specific time you can take an appropriate action.  If you want to spread that among other users, the star's hub could send that out to every spoke or to every leaf node.

Details might get more complicated depending on how your game's logical networking works out.  If you have a full star where everyone must connect directly to the star's hub, or if you require a complete mesh where everyone can talk directly to everyone, you can require them to all chat occasionally.  But if your game allows for other layouts where individual clients can act as a forwarder or repeater, you may not hear directly from another node even though messages are passing through. 

If you want to pass any of that information along within the game, it will be your game's code doing that, not the API.

Thanks. I'm trying to keep it simple and have a single server who keeps clients in lockstep and tells them about  other players in the game, so I suppose your thing about a star to many nodes applies. I suppose since steamworks uses connectionless sockets, if one of the spokes crashes without sending a disconnection message I would not know unless I implemented the heartbeat packets.

This topic is closed to new replies.

Advertisement