Advertisement

Client movement help

Started by April 09, 2004 11:08 PM
1 comment, last by Addict 20 years, 10 months ago
Alright I have my basis up for my network but I was wondering how I should go about sending client requests to the server. Should I send a packet with thier keyboard state every frame so that the server knows what the client is pressing for that frame, or should I cut it down a bit and send a queue of presses every so often? I know its bad to let the client dictate to the server its position and/or velocity, so what would be the best way to let the server know what a client is requesting? mmm...Coffee. Nectar of the Gods!
mmm...Coffee.Nectar of the Gods!
Me, for exemple, to handle the player movement, I send a packet when the player press a movement key ( for exemple, one of the arrows key ), this packet contains the direction the player is going. Then, only when the player release the arrow key he pressed, I send another packet saying that the player has released the key
Advertisement
Are you using TCP to make sure that the server gets these messages?

Since I'm doing UDP I would either need to set up an ack system so that I know that the server recieved the release/press command. It seems to me that it would be more beneficial to send the entire state of the inputs every 20ms to the server...

I can't be sure though and I'd like my design to be complete before I actually implement the final version...I already have a few prototypes that I'm not quite satisfied with

mmm...Coffee.
Nectar of the Gods!

[edited by - Addict on April 9, 2004 12:45:17 AM]
mmm...Coffee.Nectar of the Gods!

This topic is closed to new replies.

Advertisement