Answer the question
In order to leave comments, you need to log in
How to increase the fps of a client-server application in real time?
Interested in real-time applications after digging into PyGame. The question arose on the example of the game (I myself do not climb into game dev yet, so the question is abstract). When creating a game with multiple clients, it would be logical to take the following steps:
1) Make a move on the client, immediately sending it to the server.
2) The server will process the move and return the information to the client for further rendering.
3) Actually, drawing itself on the client.
In the case of games, FPS is an important factor. Even if we assume that the client should give out 30fps, then you need to redraw the picture 30 times. It turns out 1 frame in 33ms. This means that for each turn, there is only 33ms to send the packet, process it by the server, get it back for rendering and over again. Isn't there too little time? Here, of course, WebSocket technology can help, but it is not so old, but it was done before this protocol.
Do I understand the procedure for exchanging information with the server correctly? Are there other options?
Answer the question
In order to leave comments, you need to log in
From agar.io sources:
setInterval(moveloop, 1000 / 60);
setInterval(sendUpdates, 1000 / 40);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question