Archived

This topic is now archived and is closed to further replies.

Server vs. Client responsibilities

This topic is 5305 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

ok, I''m wondering ... Take for instance a FPS like Counter Strike that demands pretty fast responces to what the player does (keyboard strikes, mouse movement etc.) How much, if any, of the responce is calculated in the client? Can the responce be made as good as that if the only thing sent from Client to Server is keyboard and mouse input and the Server is made to calculate new positions, collisions, etc. and send it back to the client ... even the players own movements? In a case like that you would hit a key and then actually have to wait while that is sent to the server and the result sent back to you before you see your own character move. I know this would be by far best to prevent cheating and to make the game most consistent between computers but can it be done completely like that in a responsive game like a FPS or other fast paced games? These are my thoughts so if anybody knows how it''s done in certain games or have other thoughts on the matter, please respond. Kári.

Share this post


Link to post
Share on other sites
On most FPS games, the client stores a "perceived" world state, which is simply what the client _thinks_ the world looks like at any given time. When the client moves, it immediately updates its own world state, and then sends a message to the server indicating that it has moved. If the server finds that the client''s move was illegal (i.e. blocked by another player), it''ll respond and tell the client to go back.
The advantage of this system is that the client has absolutely no direct control over the actual world state. This makes it very difficult to cheat. Even if the client does some game logic/collision detection, the server will usually validate it (to catch cheaters).
AFAIK, this is basically the system used by the Quake & UT series.

Share this post


Link to post
Share on other sites
In my game I plan on making it so that the server will actually check to see if a player is capable of seeing another player, and if not then it won''t tell that player where the other player is. This is VERY cool as half-life does it (but not as well as I''m going to) and COMPLETELY prevents wall hacks. The cost though is a lot of server horsepower...

Share this post


Link to post
Share on other sites
quote:
Original post by 31337
In my game I plan on making it so that the server will actually check to see if a player is capable of seeing another player, and if not then it won''t tell that player where the other player is. This is VERY cool as half-life does it (but not as well as I''m going to) and COMPLETELY prevents wall hacks. The cost though is a lot of server horsepower...

I''m curious how you achieve this. If the client doesn''t know that (call him player2) player2 is nearby, then how does it display him in a timely manner when he does actually come into view? What if he peeks his head out, and ducks quickly behind the wall again? How does your client do any interpolation of position if the server isn''t providing data to the clients about that particularly entity (player2 in this case)? What if player2 is behind the player running the given client?

Lost of questions, just curious.

Share this post


Link to post
Share on other sites
Half-Life (And therefore Counter-Strike) does many things on the client side...

It tries to run a good approximation of what is going on in the server by evaluating the behavior of the entities. The client also does not wait for the server reply to accomplish movement up to a certain point. (You see yourself moving before the server has actually agreed that you are moving). As of the mouse movement, it''s entirely done on the client side.... The client decides which way he''s aiming, the server gets the new mouse movements but he can''t disagree, because you are free to look anywhere... If you had to wait for the server, you''d feel mouselag (like in serious sam).

Share this post


Link to post
Share on other sites
quote:
It tries to run a good approximation of what is going on in the server by evaluating the behavior of the entities.

Certainly, that''s how pretty much all MP games work. But 31337 claims he''s going to maintain this approximation without the client having any knowledge of the necessary entities. In my skepticism I posed somewhat rhetorical questions that I already know the answers to, when I should have just come out and said "uh, no, that won''t work".

Sorry for the confusion

Share this post


Link to post
Share on other sites