Riptide icon indicating copy to clipboard operation
Riptide copied to clipboard

"No ack received" Warnings When All Messages Should Be Delivered (On Localhost)

Open termi17385 opened this issue 2 years ago • 10 comments

Currently only using a lan version of the Game.

Having an issue with spawning objects, whenever the player shoots and spawns a projectile I receive a No Ack received warning sometimes it is every projectile sometimes it is just one projectile.

In uncommon cases I'll receive a few no ack warnings then the host will be kicked from the game and either clients will still be on the server or the clients will also be kicked, the host will also not be able to host or join a server without restarting their game first.

Most of the warnings only show up on the host client but sometimes the client with the weaker connection also gets the warnings

Images for the warnings image image

Images for the code image image

termi17385 avatar Jun 24 '22 08:06 termi17385

I've been getting this same issue, but for me it only really happens if the ping on the client is running on the same machine as the server

HideyBoi avatar Jul 19 '22 03:07 HideyBoi

image

mine says that it failed after 0 attempts? it seems to me that it just outright fails to send things sometimes; odd because i thought a localhost connection dropping packets was super super rare...

some news regarding this issue would be greatly appreciated, this has been causing many issues for me

using a player hosted setup btw.

(SERVER): No ack received for internal reliableAutoRelay message after 0 attempt(s), delivery may have failed!
UnityEngine.Debug:LogWarning (object)
RiptideNetworking.Utils.RiptideLogger:Log (RiptideNetworking.Utils.LogType,string,string) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Utils/RiptideLogger.cs:114)
RiptideNetworking.Transports.RudpTransport.PendingMessage:TrySend () (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/PendingMessage.cs:152)
RiptideNetworking.Transports.RudpTransport.PendingMessage:CreateAndSend (RiptideNetworking.Transports.RudpTransport.RudpPeer,uint16,RiptideNetworking.Message,System.Net.IPEndPoint) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/PendingMessage.cs:79)
RiptideNetworking.Transports.RudpTransport.RudpListener:SendReliable (RiptideNetworking.Message,System.Net.IPEndPoint,RiptideNetworking.Transports.RudpTransport.RudpPeer) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/RudpListener.cs:347)
RiptideNetworking.Transports.RudpTransport.RudpServer:SendToAll (RiptideNetworking.Message,uint16,bool) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/RudpServer.cs:275)
RiptideNetworking.Transports.RudpTransport.RudpServer:Handle (RiptideNetworking.Message,System.Net.IPEndPoint,RiptideNetworking.Transports.HeaderType) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/RudpServer.cs:172)
RiptideNetworking.Transports.RudpTransport.RudpListener:ReliableHandle (RiptideNetworking.Transports.HeaderType,uint16,RiptideNetworking.Message,System.Net.IPEndPoint,RiptideNetworking.Transports.RudpTransport.SendLockables) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/RudpListener.cs:224)
RiptideNetworking.Transports.RudpTransport.RudpServer:ReliableHandle (RiptideNetworking.Transports.HeaderType,uint16,RiptideNetworking.Message,System.Net.IPEndPoint) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/RudpServer.cs:211)
RiptideNetworking.Transports.RudpTransport.RudpListener:PrepareToHandle (int,System.Net.IPEndPoint) (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/RudpListener.cs:147)
RiptideNetworking.Transports.RudpTransport.RudpListener:Receive () (at Library/PackageCache/net.tomweiland.riptidenetworking@fe7dae1b73/Runtime/Transports/RudpTransport/RudpListener.cs:124)
System.Threading.ThreadHelper:ThreadStart ()

HideyBoi avatar Jul 29 '22 02:07 HideyBoi

mine says that it failed after 0 attempts? it seems to me that it just outright fails to send things sometimes; odd because i thought a localhost connection dropping packets was super super rare...

It is rare...to the point that I'm actually not sure it's possible to lose packets on localhost. Keep in mind that when you get a warning like that it doesn't mean for sure that the message wasn't delivered—the keyword is that delivery may have failed.

That being said, it giving up without attempting to send it even once is extremely strange and something that I'm fairly certain can only happen if you pass 0 for the Message.Create method's maxSendAttempts parameter. Is it possible that you're doing that somewhere?

tom-weiland avatar Jul 29 '22 08:07 tom-weiland

I'm fairly certain can only happen if you pass 0 for the Message.Create method's maxSendAttempts parameter. Is it possible that you're doing that somewhere?

I'm not. I've checked and cannot find any time that I've ever set the maxSendAttempts parameter.

Keep in mind that when you get a warning like that it doesn't mean for sure that the message wasn't delivered—the keyword is that delivery may have failed.

For me, the packets have been lost almost every time... Sometimes it does get sent, but most of the time it doesn't.

HideyBoi avatar Jul 31 '22 19:07 HideyBoi

I have the same issue with not reciving Ack after attempting 0 times, but for me it is when I send the SendSpawn method in the demo.

TaahDev avatar Sep 04 '22 12:09 TaahDev

for me it is when I send the SendSpawn method in the demo

@TaahDev which demo? What are the exact steps you're taking to cause it? Can you reproduce it consistently?

I'm not sure if all of your situations are related to the same issue, but the main barrier to resolving this is the fact that so far I haven't been able to reproduce it myself. If anyone can provide some steps to (at least somewhat) consistently reproduce the behaviour in one of the demos, that'd be a big help.

Also, I'm assuming you're all using v1.2.0, but I've changed a lot of things since then (all of which will be in v2.0.0) so it's possible that this isn't even a problem anymore on later commits. If anyone would be willing to upgrade their project early to see if it's still a problem, that'd be great (a lot of things have been renamed, so if you update and can't figure out how something changed/where it went, just ask me on Discord).

tom-weiland avatar Sep 06 '22 22:09 tom-weiland

@tom-weiland Here's every detail I can remember:

  • I created a default 3d unity project an downloaded the DLL & XML file straight from the Player Hosted Demo, but since there already was a DLL file it got saved as "RiptideNetworking(1).dll"
  • I dragged the RiptideNetworking(1).dll into Unity with the RiptideNetworking.xml (no (1)) into the unity project
  • I then noticed this mistake and deleted them both and dragged the correct named files into my project (I still think that this was the cause of the problem)
  • I copied all of the scripts from the github hosted player demo into my project and set everything up

Now when a Player hosted and a other one tried to connect, the host player will always receive the "No Ack Received after 0 attempts" message in the console when a different player joins, however the other player can see the host player look & move around. I hope that helps a bit, maybe it was just my fault by using a weirdly named dll at the beginning, but when I cloned the demo off github it worked perfectly.

TaahDev avatar Sep 07 '22 07:09 TaahDev

The name of the dll should be irrelevant.

The one you downloaded from the player-hosted demo (which became RiptideNetworking(1).dll) presumably contains the most recent commits—what about the dll that you already had on your computer? When and from where did you download that? Is that the one that you dragged into the project when you "noticed this mistake" or did you rename the one with the (1) at the end and continue using that?

None of this sounds unusual or incorrect, so unfortunately it doesn't really help me reproduce the problem.

tom-weiland avatar Sep 07 '22 18:09 tom-weiland

The one I had on my computer is the one you can download on the releases tab, and I didn't drag that one in the project, I dragged the newest one in the project, deleted it, renamed it and dragged it back in There is unfortunately nothing more I can tell you about this since it's fixed for me and that's everything I done leading up to this point

TaahDev avatar Sep 07 '22 19:09 TaahDev

I've updated my project and the whole issue seems to have gone away. More testing is probably required, but from the limited testing that I have done, it's completely gone.

HideyBoi avatar Sep 24 '22 18:09 HideyBoi

I have the same Problem, only that I'm using v2. I just finished the Connecting UI for the client and have updated everything so it works with v2 of Riptide. I think the Problem is that the Scripts freeze as soon as i tab out from either Client or Server to start the other one. (If I click back and forth between them the connection remains but if i wait too long it times out)

XeventoHD avatar Oct 19 '22 19:10 XeventoHD

I think the Problem is that the Scripts freeze as soon as i tab out from either Client or Server to start the other one.

Make sure you have the Run in Background setting enabled in both projects. This used to be enabled by default, but I think in newer Unity versions it defaults to off for some reason.

tom-weiland avatar Oct 20 '22 00:10 tom-weiland

Closing this as I can't reproduce it, it's a stale issue, and it may not even be a problem anymore based on the fact that @HideyBoi is no longer experiencing the issue.

If anyone else runs into this, please open a new issue (reference this one) and include steps to reproduce it in one of the demos if possible.

tom-weiland avatar Jul 15 '23 02:07 tom-weiland