Causality in online gaming Objectives Understand how online
Causality in online gaming • Objectives – Understand how online gaming relates to causality research in distributed systems – Be able to apply distributed systems knowledge in the domain of online gaming with respect to causality
Describing game play • The act of “witnessing” an event by an artefact may be represented, in its simplest form, via message passing between artefacts: an artefact, say A 1, generates an event, say E 1, that results in a message, say M 1, been sent from A 1 to A 2 to enable A 2 to witness event E 1. • This notion of message passing brings our model for gaming scenarios inline with the more general model for distributed computing.
Space Time Diagram
Internal and external events
Assumptions • Two basic assumptions that tend to divide the distributed computing community are those pertaining to the reliability of communication links and processes. • Processes may fail via a crash manner (faulty processors stop) or byzantine manner (faulty processors continue to produce output) – (one must realise there a number of varying failure models found between these two extremes). • Communication links are commonly modelled as either asynchronous (message and processing delays are bounded but unknown) or synchronous (message and processing delays are bounded and known).
Cause and effect • When viewed globally we may deduce that an event, say E 1 may have caused an event, say E 2. • This is the classic “happens before” relationship as described by Lamport and indicates that E 1 “happened before” E 2 (E 1 → E 2). • The consideration of causal relationships throughout a distributed computation provides a partial ordering of events; – partial as simultaneous events (those that do not share a causal relation) may be arbitrarily ordered with respect to each other.
A simple scenario • Consider a gaming scenario consisting of four players (P 1, P 2, P 3 and P 4). • The goal of the game is for a player to shoot all other players. • The virtual world is constructed from a number of different rooms and players may not shoot beyond the room they are within. – P 2 enters a room (containing P 1, P 3 and P 4) and is shot by P 1 while P 4 leaves the room and P 1 and P 3 reload their guns at some point during the gaming scenario. To allow this gaming scenario to proceed there is a need to propagate event notification, that is, different players must be informed when certain events happen so they may react.
Game progression • P 2 enters the room where P 1, P 3 and P 4 reside (E 21) at approximately the same time as P 4 leaves the room (E 41), which is witnessed by all players via M 21 and M 41 respectively. • P 1 loads their gun (E 11) and shoots their gun at P 2 (E 12). The firing of the gun is seen by all (M 11). • P 2 realises they are shot (M 11) and dies (E 22), informing all other players of their mortal wound (M 22). • During the shooting of P 2, P 3 reloads their gun (E 31). – A number of events can be ordered arbitrarily with respect to each other (e. g. , E 11 and E 31), with many events exhibiting causal relations (e. g. , E 21 → E 12→ E 22 → E 23).
Example in space and time
Causal violation
Delivery as opposed to receive • To preserve causality there is a need to ensure that P 3 witnesses E 21 (M 21) before E 12 (M 11). • The term witness is not adequate for describing this process and what actually is required is a distinction to be made between the receiving of a message by a process and the ability to act on such a message. • This introduces the classic send, receive and deliver approach to describing message handling in distributed computations: – although P 3 received M 11 before M 21, P 3 does not actually deliver M 11 until it has delivered message M 21 (preserving causal ordering). This delayed delivery is shown
Ensuring causality
- Slides: 12