Chykary / FizzySteamworks

A transport for Mirror using Steam / Steamworks.NET
283 stars 32 forks source link

UseNextGenSteamNetworking: bandwidth is lower than stated? #17

Closed NikitaNikita1 closed 2 years ago

NikitaNikita1 commented 3 years ago

Hi, I recently updated the version and ran into a problem: in the old version, I could transfer up to 1 MB of data per second. But in the new version, if I leave "UseNextGenSteamNetworking" enabled by default, I can only send 1 MBit per second. If I overshoot this size, I get an error:

Send issue: k_EResultLimitExceeded
In:
Assets/Mirror/Runtime/Transport/FizzySteamworks/NextCommon.cs:23
Assets/Mirror/Runtime/Transport/FizzySteamworks/NextServer.cs:161
Assets/Mirror/Runtime/Transport/FizzySteamworks/FizzySteamworks.cs:209
Assets/Mirror/Runtime/NetworkConnectionToClient.cs:118
Assets/Mirror/Runtime/NetworkConnectionToClient.cs:171
Assets/Mirror/Runtime/NetworkServer.cs:1529
Assets/Mirror/Runtime/NetworkServer.cs:1559
Assets/Mirror/Runtime/NetworkLoop.cs:188)
...

*However, GetMaxPacketSize returns 512 1024 which is half a megabyte.** Is this the expected behavior? Has the new API reduced the maximum transfer rate by 8 times? If my game uses more than one megabit, do I need to stay on legacy p2p?

Thx.

Chykary commented 3 years ago

Hello,

the MaxPacketSize is just the size for a single packet. It was faulty previously and would have caused a disconnect.

NikitaNikita1 commented 3 years ago

Hello,

the MaxPacketSize is just the size for a single packet. It was faulty previously and would have caused a disconnect.

That is, the maximum packet size is larger than the maximum channel bandwidth? Is it possible to somehow find out the actual maximum bandwidth not on practical tests? Or are there no constants for this?

Chykary commented 3 years ago

Hello, there's a Steam config value that one can use to clamp the bandwidth: k_ESteamNetworkingConfig_SendRateMax. However, it is 0 by default, which means no limit.

So I am currently not sure what could limit your bandwidth.

joecons97 commented 2 years ago

@NikitaNikita1 Did you ever fix this? This seems to have started out of nowhere for me recently

NikitaNikita1 commented 2 years ago

@NikitaNikita1 Did you ever fix this? This seems to have started out of nowhere for me recently

No. What I noticed after a lot of testing is that it looks like using the newer version of the (direct) connection of Steamworks has a 1 megabit limit, while the old (p2p) version allowed 1 megabyte to be transferred. I researched this in early summer but it doesn't seem to have changed.

joecons97 commented 2 years ago

@NikitaNikita1 Did you ever fix this? This seems to have started out of nowhere for me recently

No. What I noticed after a lot of testing is that it looks like using the newer version of the (direct) connection of Steamworks has a 1 megabit limit, while the old (p2p) version allowed 1 megabyte to be transferred. I researched this in early summer but it doesn't seem to have changed.

I've switched back to the legacy solution for now. I guess this would be more of a question of Steam support then.

Thanks for replying :)

Chykary commented 2 years ago

The topic seems to be related to Steam API features/limitations and isn't something impacted by the transport. :-)