Like HowStuffWorks on Facebook!

Halo Networking: An Interview with Chris Butcher


For Example...
"The server's the only machine that can create a destroying object and do other things like damage people or award kills and stuff like that."
"The server's the only machine that can create a destroying object and do other things like damage people or award kills and stuff like that."
Photo courtesy of Bungie.net

Chris Butcher continues:

"So if I'm the client, and I pull the trigger to throw a grenade, I actually create the grenade in the world. I'll play the animation, I'll play the sound. But the grenade [in terms of actually affecting the world] -- I'm not allowed to create that because that's an action that requires the authority to do so. The server is the only machine that can create a destroying object and do other things like damage people or award kills and stuff like that. So, what happens is that the clients are sending requests to the server such as, 'I request to throw a grenade here.' The server will say, 'All right I believe you because my knowledge says that you are here in this location and that is consistent with my version of events.' So essentially, there's interplay between the client sending their version of events to the server and the server trying to reconcile them and create the authoritative version of the world. It then sends out the authoritative version to everyone in the world.

So the full sequence of events for throwing a grenade is: I throw a grenade, I see the animation, I hear the sound and then some number of milliseconds later the server will start sending the information for this new object in the world which is the grenade that it created as a result of my actions. So from the user's perspective, you see this grenade appear in mid-air right there and we have all this trickery and prediction to make it look like these complex interactions. Interactions like boarding someone's vehicle essentially are made up of five or six different messages from the server. You're on the vehicle, you start the animation to board him, he gets kicked out, and he's here in the world. All the interaction between those events is sent as a separate message from the server."