Archived

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

Wymsical

Client-Controling The Player

Recommended Posts

I''m starting to make a multi-player space shooter, and i''ve got everything thought-out and planned out in-terms of synchronizing the game state, where there is a standalone-server which has the ultimate athority. My problem is with user input. I don''t know how I would/should handle this if the server is to be still the main authority. If I were to give the authority to the client only for the client''s player-object, (ship I guesse), I could get the client to send the server state updates about the ship, but then I would have to deal with potentially hacked clients that would get the ship to do crazy and/or impossible things that would be quite difficult to detect/correct by the server. My second option I thought of was to send the server state updates on the client''s input. Not all, but the most important things like joystick position, changes in throttle, firing of a weapon etc. But would that do anything to the response time of the player? Like if I were to do a jolt-leftwards on my joystick but for some reason some of those input-packets got lost, my ship wont do that. Would my second option limit the responsiveness of the game? And also, would that be too demanding on the bandwidth, if there could be maybe 50, maximum 100 people on the server? The main problem is that I don''t want to "trust" my clients in any way.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You can''t not trust your clients at all, otherwise there is no game, with no input. You have to allow the client to send you things!!
I can''t see why it would be difficult for the server to detect a hacked client doing weird or crazy things? If it attempts to do the impossible, don''t let it.

Share this post


Link to post
Share on other sites
agree. all multiplayer games "trust" the client to some extent. you move your player, your system does the physics, rotation, movement then you send the updated info to the server for that frame. if you want to be sure about most things then keep track of all inventory/bullets remaining/money/etc server side. but be prepared to spend $1000s of dollars on database equipment/ or a big box with multi ram/ or many processors, etc.

honestly, you;re never going to be able to protect against everything. you could encrypt your packets if you really want to.

the other question you should ask yourself is this: "what is the actual likelyhood that i'll be able to make a game that competes with everquest, etc.". if the answer is little to no chance, then no one's going to be hacking your game so don't worry about it.

the other more productive answer that i'll offer is, if you are really concerned about things have an algorithm running on the server to check the "realism" of the moves it's getting sent. the server will need to be aware of everyone's positions and such anyway. it should't be too hard to put together something that makes sure ships aren't invincible, etc.

-me

[edited by - Palidine on July 18, 2002 2:13:32 AM]

[edited by - Palidine on July 18, 2002 2:14:33 AM]

Share this post


Link to post
Share on other sites
ummm, all ammo and inventory is kept server side in any game i have played. also status like health and armour.

you dont send joystick input, you send the physics state. the server merely has to figure out if the movement is possible (ie if acceleration is too high, movement fast, or other inconsistencies that break the rules). the server decides to ok the stuff, and when replying back with the world updates, he could tell the player that the speed is at x instead of the 2x the player tried to cheat with. also the server tells the client hits a wall or not. the client merely correctly predicts the outcome so the player sees things as they should.

Share this post


Link to post
Share on other sites