Okay, one of the problems I have been facing from day one is figuring out where to handle collision detection and movement.
I can take two approaches:
Client-side detection/movement:
All movement and detection with the environment and other mobs and such is handled on the player's side.
Pros: I can keep only the surrounding environment in the player's RAM so it can use boundless maps and movement will be smooth and steady.
Cons: I'm not quite sure what kind of cheating this could open up for, but I'm guessing any important client-side processing opens up holes for cheating. This would also complicate things a bit when needing to move a mob by means contained on the server. The server would never know for sure where a player is each tick, and that can be a major hassle. It would have to guess the player's location like a client.
Server-side detection/movement:
The server is the only authority for truly determining where a character's position is and what it has collided with.
Pros: The only player that can possibly use it to cheat is the host, and since everything is handled by the server, a player can only be where the server says a player is, so there is no guessing server-side.
Cons: If I take this approach I have a feeling that I can't allow for boundless maps because the server would have to load the entire map into RAM or painstakingly load around the mob from files and nearby objects to check for detection, and do that for every single mob. And although it's telling the server what the player is doing, the client would have to guess the player's model's (his ghost's) location as if it were just another player model. This would lead to jumpiness and slow reaction times.
So, what do you think?
ID:31427
![]() Jun 9 2007, 3:06 pm
|
|
Everything's done client-side, but the server is updated as to what the client's trying to do. The server then does the processing, and replies to the client whether or not it was allowed to do what it did. Usually both should match up, but if they don't, the client just gets popped back to a valid location.