Guys, as I told you probably 100 times by now. I'm making a multiplayer paintball game.
I've just finished with setting up the sending of my position and rotation to all other connected clients and I tested it on my PC( I've loaded both a server and a client on my PC ) and when I move forward in the server app, the same forward movement is made on the client app, cool. Everything works perfectly fine.
But when I send the client version of my game to a friend of mine who is in another country, he says that my movement is very laggy, and the game is not playable. I'm wondering why the packets are sent so slowly. I'm using RakNet and RakPeerInterface class which is based on UDP, so it's not a TCP problem and I don't know what to do.
2nd bonus question:
Ok, TCP guarantees the arrival of every packet and while this is good for some applications, it causes slowdown in games, because if one packet is dropped, the router waits for the same packet to be resent and this messes things up, OK.
But then in this link here:http://www.raknet.net/raknet/manual/introduction.html There is this sentence:
"At the lowest level, RakNet's peer to peer class, RakPeerInterface provides a layer over UDP packets that handle these problems transparently, allowing the programmer to focus on the game rather than worrying about the engine."
So actually RakNet provides a layer over UDP packets that provides the functions a normal TCP would have. Everything is messed up in my head because of this.
Why would someone use UDP and write code to add TCP functionality ( right order, reliable packets ) instead of just using TCP. Of course there should be a very logical reason, and I know I'm missing something. Do you have any suggestions why this may be?