Jump to content
  • Advertisement
Sign in to follow this  
jballaban

Path Mapping

This topic is 4438 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Should object paths be calculated by both the client and the server? Just the client or just the server? Both seems unecessary duplication of code, server seems best but that means the client has to wait for a response from the server before setting the object path, client seems the best but which client decides what object takes what path (i.e. when two objects collide and need to move around each other). So basically my questions are, how is an objects path decided, where are the collisions detected and how are they resolved. Note in my specific setup the client is very lightweight and I'm trying to push as much processing as possible to the server.

Share this post


Link to post
Share on other sites
Advertisement
One common technique is for both the client and the server to calculate physics and game logic, using identical code-paths. This allows the client to "predict" the game state. Then the server updates the client every so often (~20 time a second) with the real game state, keeping both of them in sync. The allows the client to be responsive on slower connections, and as long as nothing drastic happens in-between updates the predicted game state and the real game state won't be that different. The real and predicted states might diverge more on slower connections, causing jerkiness, but this is the type of system used in Half-Life 1/2 and with great success. There's actually an article someone describing the prediction used in the Source engine, but I can't remember where I read it.

Share this post


Link to post
Share on other sites
doesnt this belong in Multiplayer and Network Programming ?
anyways the server should always be the head -> the one who does all the computations. The client, instead of doing calculations, it would just interpolate to the positions given by the server (dead reckoning).
IF a collision occurs, the server should inform the client it has collided and not vice versa, so all clients would be in sync with the server.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!