Original Post
Hi everyone!
So recently I have been thinking about what needs to be sent over a network for games to stay in sync. In regards to say an MMO, but lets scale it down to the basics. In a one-to-many server-client system here is what I assme happens, please correct me if I'm wrong because I'm very interested to see how this is best achieved (for later projects).
The player has direct control over the position and rotation of the character (so walking around, or flying, whatever) using WADS and mouse and instead of sending the control inputs to the server the position and rotation vectors are sent to the server and the server sends them to all other clients that need to see them (so in the same area or instance). I'd assume there would be a check there first to see if the character has been moved by external forces (being hit by a boulder or collided with an object) first or if the character is still alive.
Perhaps the clients computer takes care of the colisions when the server has sent the position of the boulder and then lets the server know that there has been an impact and the boulder and player are now in new positions. Though I'm not sure who would control the boulder (client or server) if this is an object that all players can interact with, possibley the last player or object to interact with it has control of it's position and rotation.
Then there are actions or skills. I'd assume that the input from the player is again translated into a function instead of being sent directly to the server for it to control. (That was hard to understand, I'm awful at my own native language) What I mean is if I cast a fireball which is skill one. If to activeate it I press the number 1, that keypress is not sent to the server but the client sees the button press and then tells the server that fireball is being cast and not skill one is being cast. Then the server lets everyone else know that the player has cast fireball and tells the others what animation needs to be played and to instantiate the projectile using the pos and rotation and velocity they get from the server. With unguided projectiles such as a basic fireball skill would the server give the velocity and then not worry about it or would it update the information every few steps to make sure sync is possible.
With guided objects such as a homing missile, would that also be controlled by the player that fired it, the player it is following or the server? I'd think server, because it has the most up to date information on everything.
I know this is a lot of information and I'll probably be experimenting with it to see what works best for each situation but I'd like a starting point.
So recently I have been thinking about what needs to be sent over a network for games to stay in sync. In regards to say an MMO, but lets scale it down to the basics. In a one-to-many server-client system here is what I assme happens, please correct me if I'm wrong because I'm very interested to see how this is best achieved (for later projects).
The player has direct control over the position and rotation of the character (so walking around, or flying, whatever) using WADS and mouse and instead of sending the control inputs to the server the position and rotation vectors are sent to the server and the server sends them to all other clients that need to see them (so in the same area or instance). I'd assume there would be a check there first to see if the character has been moved by external forces (being hit by a boulder or collided with an object) first or if the character is still alive.
Perhaps the clients computer takes care of the colisions when the server has sent the position of the boulder and then lets the server know that there has been an impact and the boulder and player are now in new positions. Though I'm not sure who would control the boulder (client or server) if this is an object that all players can interact with, possibley the last player or object to interact with it has control of it's position and rotation.
Then there are actions or skills. I'd assume that the input from the player is again translated into a function instead of being sent directly to the server for it to control. (That was hard to understand, I'm awful at my own native language) What I mean is if I cast a fireball which is skill one. If to activeate it I press the number 1, that keypress is not sent to the server but the client sees the button press and then tells the server that fireball is being cast and not skill one is being cast. Then the server lets everyone else know that the player has cast fireball and tells the others what animation needs to be played and to instantiate the projectile using the pos and rotation and velocity they get from the server. With unguided projectiles such as a basic fireball skill would the server give the velocity and then not worry about it or would it update the information every few steps to make sure sync is possible.
With guided objects such as a homing missile, would that also be controlled by the player that fired it, the player it is following or the server? I'd think server, because it has the most up to date information on everything.
I know this is a lot of information and I'll probably be experimenting with it to see what works best for each situation but I'd like a starting point.