I have a strange problem with TNet where my router doesn't seem to send or receive UDP packets.
This is really frustrating, I spent a week trying to get this to work, doing a lot of testing and etc... Ultimately, it came down to my router not being able to use UDP the way it is implemented in TNet.
I am making a somewhat 2.5D platform-er racing game where using UDP for quick position update is important, but can't get the damn SendQuickly to work. I have tried using only TCP, but even with noDelay = true; The movement is still jittery.
So, I started out with a new set up and decided to test the example3 scene that came with the package. After running two instances on my machine(connecting via my external IP) and using a program to track packets sent/received on my network. It showed that only TCP is being sent/received and no UDP at all.
However, It shows canUseUDP true on both clients and I have pretty much completely turned off my firewall. I am using the latest version of TNet.. the server message states 3 UPnP ports openedsuccessfully.. I have tried turning on and off mutlicasting - no luck there. I tried assigning my interface manually
UdpProtocol
.defaultNetworkInterface = new IPAddress
(new byte[]{192,
168,
0,
100});
no luck there...
I thought maybe there is a problem with looping back to my external IP, so I signed up for a free amazon ec2 micro... tried running the server there.. with all ports opened.. firewall off andddd still... Only TCP packets being sent with example 3, no UDP.
But here is the strange thing... after attempting many times of running server on amazon ec2 and connecting to it... there few times that it DID send UDP packets instead of TCP :0 As a result, the boxes wee moving much more smoother. But once closing the client connection and then reconnecting.. it goes back to TCP...
Finally I tried disconnecting my cable from my router and plugged it directly into the modem anddd.. what you know.. it worked! - it sends/receives UDP packets... Even when connecting to my server on amazon, it was using UDP - the boxes were moving much more smoother.
Furthermore, I tried running the server on my machine again WITH router, but this time connecting both clients through localhost(127.0.0.1) and yeppp that worked as well...
So, the problem seems to be that my router(DIR-857) is not compatible with how UDP is implemented in TNet. This is a fairly expensive router and I have had no problem with other games online such as Quake.. CS:GO, HON, dota, and many other games...
I seen other people that have reported the same issue. I am really hoping there is a way to get UDP work because there is really not much point in releasing a game if it only works on some routers. I really like TNet and do not want to switch to another network as I did with photon.
If anyone has any suggestions, or perhaps that can point me to a direction would be much appreciated - Thank you!