views:

74

answers:

3

Hi.

I want to start writing a multiplayer 3D game. It will be a virtual world, that user are represented as players. Every player, is a 3D model. I'm going to write this in Java and JOGL, so it will be cross platform and accessible through the web (applet). The server, will be wrriten in C++.

When a user clicks with his mouse on some point in the virtual world, it will go to this point, in animation. My question is, should the client calculate to where to go, and send to the server his new position everytime, so the server will update the clients? Or, should the client just send the server to where he wants to go, and then the server will send to this clients and all clients his new position? Consider that I want minimal bandwidth and prevent script kiddies.

Thank you.

+4  A: 

I believe the prevailing design is to assume on the client that an action will succeed and proceed with it, tell the server about what it has done, and allow the server to "correct" the client when it detects that it did something fishy. This keeps the game client responsive to the player's requests, while still giving the server veto power.

Because the server is always the authority on the state of the world, and the other game clients will receive their information only through the server, any illegal actions by a client will always be caught by the server before they can ever possibly affect another player.

Mike Daniels
A: 

If you don't like cheats in the client-side, it's better to you calculate the player's location by the server, but, you have to do threading to not lag the others players when the server processes someone's location.

Flávio Toribio
A: 

Never trust the client side. It's subject to all sorts of problems, including deliberate cheating and unnoticed corruption. If you allow the client to specify where the character is, some client will specify a place you want to be out of bounds for that client, and some will generate a wildly inaccurate position that's impossible to get out of by normal means (unless you have a teleport-to-home-base ability).

The client should tell the server where the character is going, and the server should respond to that. It already has to tell every other relevant client what the character is doing, so it can just as easily do that for every client.

Runescape is the only MMORPG that I know of that works the way you're suggesting. On Runescape, if you have a connection problem and click to move, your character will stay still (although moving in minor ways, to look alive) until the server gets and acknowledges the movement. (Your character will fight without user input, giving you a chance to survive a bad connection in dangerous territory.)

David Thornley
Yes, I have taken the idea from RuneScape.
TTT