Hi everyone,
I want to build a small client-server network for a spaceship game using TCP [to simplify things].
I'm kind of new on game network programming so i searched a bit on the web and it seems to me that
the easiest implementation is quake 3-like network algorithm.
note:a easy-to-program solution is preferable to one with high performance (within limits of course)
I was thinking to let the server manage the REAL state of the game and send information of it to the clients.
Meanwhile,clients only send "controller input data" for example
"client X has pressed button01" that mean he want to move forward etc.
"client X has pressed button02" that mean he want to fire primary weapon and so on.
Thinking about this,since it's my first experience in this kind of programming i've some question that come to mind:
-It should be safe since all the physics is managed on the server side.
-Sending input data without prediction on the client side and waiting for the server response for the new state
could deliver a strong lag on player having high ping: if player X has 150ms of ping,when he press the move button
he will actually start moving 300ms later [client-srv //position computation// srv- client]
-What's the best way to synchronize packets? I was thinking about sending a timestamp withing each packet
but,what will this time is referred to? I can't use local machine time since it could be different and...
will be a time synchronization (to a webserver for example) be reliable with some millisecond precision?
Can you guys please give me some opinions on those points?
Will the "send input to server" system hit so hard on performance?
Thanks in advance.