Jump to content

Threads Question


Recommended Posts

Posted

Well, Just wondering... If a player does something [like moving] and another player is moving in the same time, why doesn't the server stuck? I mean it's all handled in a single thread... therefore it takes time to complete the operation.

So it doesn't stack because it moves extremely fast and we can't sense this, or because a different thing?

If you didn't understand the question I'll ask it again more clearly.

Posted
If a player does something [like moving] and another player is moving in the same time, why doesn't the server stuck?
A player has smooth, continuous movement on the client side, but it only sends its current position to the server periodically. The frequency of these position updates is low enough that the server has plenty of time to do other things.

Similarly when a creature moves a destination is chosen and every 50 ms its position is shifted closer to it. In this case however, the server only needs to send the destination and speed of the creature at the start of the movement, and the client can interpolate the rest. So where the client sees a smooth movement, the server sees a series of small shifts 50 ms apart.

So for example if you are running from a creature and you have lag, you may be sending position update less frequently but the creature is still moving towards you with same speed, so even if on the client you see you've outrun the creature, on the server it may have caught up to you and killed you.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use