Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Error k_EResultLimitExceeded #15

Open
BatteryAcid opened this issue Jun 9, 2024 · 16 comments
Open

Send Error k_EResultLimitExceeded #15

BatteryAcid opened this issue Jun 9, 2024 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@BatteryAcid
Copy link

Receiving this error:

USER WARNING: Send Error (Unreliable, won't retry): k_EResultLimitExceeded at: SteamConnection::_send_pending (steam-multiplayer-peer\steam_connection.cpp:25)

This seems to happen with frequently replicated properties, like position of a Node2D.

Game still plays, but not sure why this is happening, any insight would be much appreciated!

Source of message in code: https://github.com/expressobits/steam-multiplayer-peer/blob/main/steam-multiplayer-peer/steam_connection.cpp#L25C1-L26C1

@BatteryAcid
Copy link
Author

I wasn't able to replicate this using the demo-bomber project, so I'll be investigating further. But if you do have any insight as to why this message shows up, that could help me narrow it down.
Thanks!

@BatteryAcid
Copy link
Author

BatteryAcid commented Jun 11, 2024

I dug into this for two days now with no luck - I'm not able to reproduce with the demo bomber project. I'm attaching my project in case anyone wants to take a look.

Relevant files

  • game_manager
  • steam_manager
  • multiplayer_controller
  • multiplayer_input

This seems to be related to the MultiplayerSynchronizer. I was able to reduce this error in one scenario where I restructured how some properties are synched, like didn't really need them, but ultimately it persisted.

Another case that it doesn't show is when I Host on a much older laptop, and then join as client on my newer PC. However, if I host on my new gaming PC it always shows this error on the host side. Client side never gets this error.

Technically I'm not even sure this is a problem, as it just shows as a Warning, so please let me know if this is just an oversight with logging...

Any feedback would be appreciated! Thanks


Setup

  • Run host (as editor or windows build) on one PC, and another build on a separate computer PC (broken on MacOS at the moment)
  • Launch game, hit Use Steam
  • Hit Host P2P on one computer
  • On the client PC, Hit List Lobbies -> Click on the lobby

You should see the warnings spammed on the host within about 30 seconds.


Project Source

@BatteryAcid
Copy link
Author

BatteryAcid commented Jun 11, 2024

Found some docs on when this is thrown:

k_ESteamNetworkingConfig_SendBufferSize: Upper limit of buffered pending bytes to be sent, if this is reached SendMessage will return k_EResultLimitExceeded

@BatteryAcid
Copy link
Author

BatteryAcid commented Jun 12, 2024

While I don't see this as a legitimate fix (as it didn't change anything), I still wanted to try setting the k_ESteamNetworkingConfig_SendBufferSize to a higher value to see if it prevented the buffer error.

I tried both methods:

Method 1

Steam.setGlobalConfigValueInt32(Steam.NETWORKING_CONFIG_SEND_BUFFER_SIZE, 1024)

Method 2

Passing options array to create_host

  • 9 maps to the config name: "k_ESteamNetworkingConfig_SendBufferSize"
  • 1 is the option type I wish to change: int32
  • 1024 is the buffer size
var options = [[9,1,1024]] 
var error = multiplayer_peer.create_host(0, options)

No luck.

@Truc4
Copy link

Truc4 commented Jun 13, 2024

I also get this warning spammed sometimes, consistently when I have more than 2 players connected. I do not use multiplayer synchronizer as I have custom netcode, but I do send a lot of unreliable packets for my net sync. I would love to know if it is an issue with the plugin or with how I am using it, (or a steam limitation I am not considering) My game works perfect using Enet peer

@BatteryAcid
Copy link
Author

As per a suggestion from @miatribe in my Discord, I tried using different buffer sizes:

  • 0, 1048576, and 2097152

As it's likely the values are in bytes, not kilobytes, but still same warning message spam. Again, I don't think increasing buffer size is the solution, but curious to see if it impacted result.

@scriptsengineer scriptsengineer self-assigned this Jun 15, 2024
@scriptsengineer scriptsengineer added the bug Something isn't working label Jun 15, 2024
@scriptsengineer
Copy link
Member

In version 0.1.1 I left easy-to-change options for the peer, one of which solves this problem.
Basically the problem happens because we are sending too much data, overflowing the default steam buffer, but to change this buffer now in version 0.1.1 just add this code before create_client or create_host

peer = SteamMultiplayerPeer.new()
peer.set_config(SteamPeerConfig.NETWORKING_CONFIG_SEND_BUFFER_SIZE, 524288)
peer.create_host(0)

@BatteryAcid
Copy link
Author

I pulled down the latest version, upgraded to Godot 4.2.2, added the set_config call (before create_host/client) as stated above, and I'm still getting the error.

Screenshot 2024-08-12 102041

If needed, I can also upload my demo project, let me know! Thanks

@scriptsengineer
Copy link
Member

This value I set is Steam's own default, increase its size.

@BatteryAcid
Copy link
Author

Updated project.
All the configs are in steam_manager.gd, in functions _create_host and connect_socket.
Instructions for running are the same as my comment above.

NOTE: I commented out the jump functionality a while back for testing, the warning shows up without moving or doing anything. Takes about 10 seconds before it starts.

@dev-bre
Copy link

dev-bre commented Sep 27, 2024

has this issue been solved? I am getting the same issue and it usually happens when the amount of data to sync gets bigger.

@scriptsengineer
Copy link
Member

scriptsengineer commented Sep 27, 2024

has this issue been solved? I am getting the same issue and it usually happens when the amount of data to sync gets bigger.

Apparently no, have you tried changing this option?

In version 0.1.1 I left easy-to-change options for the peer, one of which solves this problem. Basically the problem happens because we are sending too much data, overflowing the default steam buffer, but to change this buffer now in version 0.1.1 just add this code before create_client or create_host

peer = SteamMultiplayerPeer.new()
peer.set_config(SteamPeerConfig.NETWORKING_CONFIG_SEND_BUFFER_SIZE, 524288)
peer.create_host(0)

@dev-bre
Copy link

dev-bre commented Sep 27, 2024

I tried up to 2097152 but I still see those warnings showing up. Looks like I am sending too many rpc and steam doesn't like that probably? I see that those warnings actually have an impact at runtime. It's weird because it is not clear what is causing the issue.

@scriptsengineer
Copy link
Member

Is it the sender or the receiver who has these log warnings?

@dev-bre
Copy link

dev-bre commented Sep 27, 2024

it was on both. apparently as I changed the replication setting of pretty much all MultiuplayerSynchronizer nodes I put in the main scene from Always to OnChange... things started to work much better and I am not seeing the warnings anymore. I still think the library should be aware of the issue and be able to give a better message to know what is causing the issue itself. I will keep testing this on my side, but so far I am not seeing the error anymore.

@scriptsengineer
Copy link
Member

Yes, I understand, I was in doubt about removing the error, but the logic makes sense to have the error, since it will be a lost packet when this "warn" occurs, in my game I admit to sending updates only with event changes and I end up having little data sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants