Hi,
I was after peoples thoughts and ideas on the best way to approach the movement and animation of proxy objects (representation of other players on a persons client) when using an authoritative server.
Currently I send inputs from the player to the server at around 15 fps. The input is sampled every frame and where more than one input falls into this gap they are sent in the same packet.
The server sends out the state of the server at 15fps. For proxies this includes the position it is now at, the direction it is now facing and any keys pressed between the last send and this one, such as crouch, fire etc.
On a client the proxies are displayed with a delay of around 100ms. This allows enough buffer for glitches in the network. Movement and rotation are interpolated between the two frames that bound the time we are currently rendering (minus the interpolation delay). However, what interests me is how people deal with single actions (fire, crouch etc). These actions may have occurred for only a fraction of the time between the two sends, especially if we sample input on the client every frame and then send a number of inputs in a single packet to the server.
I suppose sending the time that the actions occurred (I pressed crouch at time t and released it at time t1) would be one approach, but this will eat up bandwidth and I do not think is viable, especially as without the time all the key presses can be fit into a single byte.
The approach I am taking is that I process one off events, such as firing, at the time the send is timestamped and only once for the whole send gap. So for firing I will animate firing once at the start time. For actions which persist, such as crawling or crouching, I also process them at the start time but the actions remain applying for the entire gap (1/15 secs). Again this looks ok but is not wholly representative of what the player is doing as they may have only crouched for half this gap.
I don’t suppose it makes a whole lot of difference given the size of the time gaps but I was just wondering if anyone else implements a similar behaviour and if so how they go about dealing with it?