Steam and Kryonet?

Hello, I am currently in the stage where I want to implement co-op to my game. However I am having some trouble with some of the concepts.

[Notes]
I want to release my game on Steam
I want to have max of 4 players
I don’t want to spend money on servers
Also I cannot find a way to turn on UPNP

From my experience with Kryonet is the Server side has to portforward, which is not what I want. I want the player to be able to host their own server (On their machine), and players can join only if they are friends with the steam user. However I feel like i need to portforward (unless steam uses some sort of upnp)

The only thing I can find online is this https://code.google.com/archive/p/weupnp/
Not sure how I would use it with Kryonet though :confused:

The Steamworks SDK includes a P2P networking interface, which also does NAT translation. Of course this requires Steam, so for potential non-Steam builds you would have to provide an alternative network implementation.

Ah does this mean I don’t have to worry about port forwarding?
Also would i be able to use Kryonet with Steam?
Also does P2P work with multiple users (MAX 4)
One more thing, you said this requires Steam? Is there anyway I could test this without putting my game on Steam yet

Thanks for the response ;D

Unfortunately you can’t test Steam features without getting on Steam, which is a bit of a bugger.
I’d advise not using the Steam network APIs if you can help it and make something that works everywhere.

Cas :slight_smile:

So they say.

I don’t know Kryonet, so I can’t answer that. Essentially the Steam P2P API boils down, after initial connection/negotiation, to two functions, “send message to another Steam user” and “receive message from another Steam user”, which work with byte data. I can’t tell if you can dock Kryonet on top of that.

Sure, but you’ll have to manage yourself what messages are sent to which user(s).

You need to register with the Steamworks partner program, which gives you (your Steam account) developer access, but probably requires you to sign some NDA first. It’s been a while and long before the days of Steam Direct (and I didn’t do the initial registration myself), so I don’t know the current time and effort needed.

Ah okay that makes sense, still in a bit of a mess though. I have just made my game have some sort of multiplayer using Kryonet. My only issue is that I might have to redo the whole multiplayer system when I deploy on Steam…

Thanks for the response, yeah I would love that to be the case, but everywhere I go all i see is people saying they cannot get it working because of port forwarding issues. I really hope the Steam and Kryonet works together… would be great! If not then I guess ill need a wrapper for the Steam version :confused:

Yes, if I had to, I’d try to build some kind of generic interface and treat Steam networking as yet another implementation. Even if only for testing purposes, because it’s a pain already to just test some simple networking functions with multiple Steam accounts.

Don’t be afraid of port forwarding issues… most people can learn how to set it up on their home routers. Failing that though, weupnp will actually work ok. I don’t think you really need Kryonet.

Cas :slight_smile:

I’ve looked into weupnp but I cannot find how to use it… any chance you could direct me? :point:
I’m guessing the Steam implementation would be pretty simple anyway ???

Would be great to hear if you manage to find a solution for your problem. I might be getting there some day as well, if I decide to deploy on steam.