Client proxy movement and animation in an authoritative server

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?

Well it’s very important to “replay” things in the correct order with the correct durations, so applying your events for the whole gap (1/15) i don’t see as viable solution.

You shouldn’t be even sending or using “time” when doing this kind of thing.

I don’t really understand what you mean when you say I shouldn’t be using time doing this kind of thing.

As far as I understood input is entered by a user and sent to the server every tick (say 1/15 s) The server takes this input, acts on it, and every tick sends out information to all the connected clients detailing where everything is so the clients can display this to their users. This latter step has surely got to involve the time that these events occurred so they can be represented at the correct point on the players screens?

If, during the 1/15s a player fired and jumped how would I go about getting the server to communicate this to the other players without an accurate time in which these actions occurred if I am not going to assume they occurred once at the start of the time represented in the message?

I feel I am missing something here but not sure what it is!