A very quick episode this week where I talk about replicated events. So far I’ve been replicating “state” information (that is: positions that change over time, persistent objects, etc).

Now I’m replicating transient events that describe why the state changes. For example: a gun being fired or a grenade exploding.

If you’re interested in a really in depth discussion about game networking, including discussion about state vs events, check out this talk: I Shot You First: Gameplay Networking in Halo Reach. It’s almost two hours long, but very interesting.

Comments

Alejandro

11:13 am, Thursday 25 October 2012

I think I didn’t get correctly the idea… you mean that instead of handling everything the “imperative” or “forward” way (fire grenade -> bounce around -> timer off -> blow up) you have like an “Event Listener”?

Is it something like that?

Example:
“A grenade was fired -> by who + timestamp + etc” or “a grenade dissapeared -> because it blew up (play explosion sound) or because it was eating by another ninja (play “gulp” sound)”

Andrew Russell

1:15 pm, Friday 26 October 2012

It’s basically a fancy remote procedure call.

Take the player object’s “Update” method, for example. This sets variables like “position” and “aim direction” which are then replicated to clients. In most cases the client doesn’t call “Update” at all – it just lets the server set values directly.

So to handle transient events, “Update” can now call these replicated event methods. For example: a “GunWasFired” method. This method call (including any parameters, plus timing information) will be replicated to all clients. That method can then spawn effects, play sounds, etc.

(And there’s a bunch of other fancy stuff involves. For example events can be predicted on the client, without the double-spawn problem you see in episode 16.)

Alejandro

3:29 am, Saturday 27 October 2012

Thanks for clearing that up!
Would love to see one day the complete stuff, an overview perhaps… (like: Handling Transient Events, dumbed down version : p)
Been loving these DevLog’s by the way, lots of interesting stuff… thanks for sharing.