[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Server-based FPS



How can be a server based fps like Quake II so fast?

I think that the way it works should sound like:
1. Client has an event request -> i press CTRL, client says to server "I want 
to shoot!"
2. Server receives the request, decides it is a valid request and inform all 
clients (mine included) that "player X shoots".
3. Clients receives the information and displays everything.

That means i must send a message back and forth between client and server for 
each action a player performs.
Even using UDP i should have a significant amount of time between the request 
(pressing fire) and the actual action (my gun fires).

Also, how can i keep all the clients syncronyzed with the server?
If the message "player X fires" arrives to my computer after 0.1" from 
keypress and 0.2" on another computer, how can the two clients display and 
keep a consistent scene?
Fixing this may force server to update the entire situation to each client 
many times per second, with an excessive load for the network.

Suppose i got multiple slow projectiles going straight.
I call an event that changes all the speeds.
All the clients must agree on the position of each projectile at the moment 
it changes speed, otherwise they'll have very different positions.
Server must inform all the clients about all the positions of the projectiles 
at the moment they change speed, or it must be sure they all have the same 
posistion (ie: clients are syncronyzed).

The only way I see to ensure syncro. is each client sending a "i'm ready for 
next frame" message to server, and server replying back "goto next frame" 
when all clients are ready.
Wich I suppose being painfully slow.

Any ideas?
Francesco Orsenigo, Xarvh Project