Good evening,
Today I wrote a simple pong via server and client. Everything works just fine, but with the code so far, it causes a lot of lag... I am pretty sure, that I send too much or too often... I use TcpSockets and thats what I have so far:
The server updates the ball and sends the position to the two clients, each client updates his pad individually and sends the position to the server, which sends it on to the other client.
Somewhere I read, to limit the packets to 30, is this the solution and if it is, what is the best way to do this?
Should I use Udp instead of Tcp (I hope and don't think so)?
But my main question is: What do I need to send?
Is it right to send the position from the ball and the two pads each frame? Should I also update the ball on the clients and only check the position with the server sometimes?
I hope you know what I mean
Greetings, Geheim!