Hi all,
I have been trying to create a realtime 3D multiplayer physics game (using Node.js/CannonJS). So far, it works 'smooth' (tested it with 2 players only though :P ) although I feel that there are still many things that can be improved.
My current implementation:
- The client side loop runs at 60 ticks (including physics). It however only sends input data (whether a key W/A/S/D is pressed 10 times per second to the server.
- The server side runs (at least smoothly) on 10 ticks per second (including physics)
- The server sends 10 times a second to all clients the position and velocity of all objects. (Velocity is the reason why these objects are moving smoothly rather than abruptly 10 times a second)
- The client adjusts receives this information and applied it to the objects.
My concerns/questions:
- I find 10 ticks still a bit too much. Especially since I am planning (or my goal) is to run multiple games on a single server. My goal is that a single game should have 8 people. Is 10 ticks server side too much? Or can I even put it to 20/30 ticks? A strange question: how can I determine this? What are most games doing in this case? (if they either run multiple game instances or just a single one). I don't think my server (1GHz, 512 MB RAM) can keep up with 30 ticks for let's say 10 game instances.
- I am not directly executing commands on the client side. For some strange reason that I have yet to solve, the client then is not smooth enough. I understand that for a realtime multiplayer game these commands need to be executed on the client side directly?
- How can I simulate other players the best to test the network latency and smoothness of the game? How can this be done without having to get actual people that test the game?
Thanks!