Player movement in online FPS games

Started by
14 comments, last by lazaius 16 years, 11 months ago
Just found it funny how no one even mentioned the most common and easy to implement method.

Dead reckoning.

The concept with that is quite simple. Giving the player hit the move key and is facing direction (-) (theta) we can keep moving in that direction at a fixed speed until the player releases the move key or changes direction. The speed is fixed at the server level so no speed hacking. All players would get the same data and would reduce the amount of "jumping" of players on remote clients. Plus the client only needs to send update packets if the movement state changes. I would recommend every few seconds pooling the clients to check and see if they are still moving or have the client send an update to compensate for packet loss.
Advertisement
Well... So about the dead reckoning method..

You simple sending 1 packet included one defined key( Up,Down,Left,Right ) and the direction( theta )?

1. Do I send this packet in some sort of interval ?

2. Do this packet include some sort of time? I meen like if you get connection interupted the player will keep on moving until the client disconnect's right?

3. Server sends out update packets for all clients in the "inrange list" IF the position have changed right?


Thanks!
1. you can send it at an interval to keep the clients insync but its not necessary

2. for this i would recommened every second or two pooling the clients, asking them, hey are you still moving? if no response stop moving. if direction/key has changed you will be able to find out then and take the last know good position and move from there

3. you can just send out the new position when a person changes like every 5th packet you send is all the updated player positions or something like that
Ok, thanks.. Just one question.

Then you must have like ~5-10 packets/sec updates for the camera direction Right?, else it will become an wrong force "orbit/path" if you know what I mean.
well the only camera updates you need to send are left/right because up down is local only. it would be the same as sending a left/right key send a mouse_move_left = true then a mouse_move_left = false when they stop moving the camera left
allright, thanks dude!

This topic is closed to new replies.

Advertisement