Sly 2:Game state: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Added link to DAGviz)
(Updated and added info, added links)
Line 1: Line 1:
{{Infobox game mechanic
{{Infobox game mechanic
|image=Sly 2 Palace DAG official.png
|image=Sly 2 Palace DAG official.png
|caption=The official DAG for Sly 2 Episode 2
}}
}}


'''Game state''' refers to the current state of objects in the the game world. It was the subject of a 2005 GDC presentation by Bruce Oberg, the Principal Engineer at Sucker Punch.<ref>[https://www.gdcvault.com/play/1020295/The-Picture-Worth-a-Thousand The Picture Worth a Thousand Bugs] - YouTube, 3 April 2021 (archived from a 2005 GDC conference)</ref>
The '''game state''' is the current state of everything in the game world. It was the subject of a 2005 GDC presentation by Bruce Oberg, the Principal Engineer at Sucker Punch.<ref>[https://www.gdcvault.com/play/1020295/The-Picture-Worth-a-Thousand The Picture Worth a Thousand Bugs] - YouTube, 3 April 2021 (archived from a 2005 GDC conference)</ref>


== Tasks ==
== Tasks ==
The current game state is represented by a '''D'''irected '''A'''cyclic '''G'''raph, or '''DAG''', which is a data structure comprised of a directed graph with no cycles. Each node on the DAG is called a ''task''. For example, <tt>t1_follow_dmitri_on_streets</tt> is the task of tailing Dimitri in the "Follow Dimitri" job (the prefix <tt>t1</tt> indicates that it is a task in Episode 1, and <tt>follow</tt> is the codename for the "Follow Dimitri" job).
The current game state is represented by a '''directed acyclic graph''' ('''DAG'''), which is a directed graph with no cycles. Each node on the DAG is called a {{Sly 2|Task|task}}. For example, <tt>t1_follow_dmitri_on_streets</tt> is the task of tailing Dimitri in the "Follow Dimitri" job (the prefix <tt>t1</tt> indicates that it is a task in Episode 1, and <tt>follow</tt> is the codename for the "Follow Dimitri" job).


=== Task States ===
=== Task States ===
Line 19: Line 20:


===State Forcing===
===State Forcing===
At all times, every task ''before'' an Available task must be Complete or Final. Additionally, every task ''after'' an Available task must be unavailable. It is possible to ''force'' a task to a particular state, which propagates throughout the DAG to ensure those conditions are always met.
At all times, every task ''before'' an Available task must be Complete or Final. Additionally, every task ''after'' an Available task must be unavailable. It is possible to "force" a task to a particular state, which propagates throughout the DAG to ensure those conditions are always met.


==Missions ==
== Missions ==
Tasks are grouped into ''missions'', where each mission is typically one particular job in the story. For instance, <tt>m1_follow</tt>{{check}} is the job "Follow Dmitri". The prefix <tt>m1</tt> indicates that it is a mission in Episode 1, and <tt>follow</tt> is the codename for the mission.
Tasks are grouped into {{Sly 2|Mission|missions}}, where each mission is typically one particular job in the story. For instance, <tt>m1_follow</tt>{{check}} is the job "Follow Dmitri". The prefix <tt>m1</tt> indicates that it is a mission in Episode 1, and <tt>follow</tt> is the codename for the mission.


If a task belongs to a mission and the ''exit task'' in that mission is Completed, then all the tasks in that job become Final.
If a task belongs to a mission and the "exit task" in that mission is Completed, then all the tasks in that job become Final.


==Checkpoints==
== Checkpoints ==
A task is considered a ''checkpoint task'' if it has some checkpoint data associated with it, including a particular character and location in the game world. When a checkpoint task becomes Available that checkpoint is set as the ''latest'' checkpoint.
A task is considered a "checkpoint task" if it has some {{Sly 2|Checkpoint|checkpoint data}} associated with it, including a particular character and location in the game world. When a checkpoint task becomes Available that checkpoint is set as the latest checkpoint.


== Rollbacks==
== Rollbacks ==
A rollback is when the game state rewinds to an earlier state (such as when the player dies). This is accomplished by:
A rollback is when the game state rewinds to an earlier state (such as when the player dies). This is accomplished by:
*Resetting the world
* Resetting the world
*Placing the player at the latest checkpoint
* Placing the player at the latest checkpoint
*Forcing the checkpoint task to Available (which may result in the states of other tasks being updated)
* Forcing the checkpoint task to Available (which may result in the states of other tasks being updated)

== See also ==


== See also==
*[[DAGviz]] - A tool for viewing and editing the DAG in real time
*[[DAGviz]] - A tool for viewing and editing the DAG in real time
*[[Sly 1:GS]] - The game state tracking system in {{Sly 1}}.
*[[Sly 1:GS]] - The game state struct in {{Sly 1}}.


==References==
==References==
<references />
<references />

{{Navbox Sly 2}}

[[Category:Game mechanics]]
[[Category:Game mechanics]]
[[Category:Game mechanics in Sly 2]]
[[Category:Game mechanics in Sly 2]]
[[Category:Game mechanics in Sly 3]]
[[Category:Game mechanics in Sly 3]]

{{Navbox Sly 2}}