The document discusses the system for modeling concurrent interactions in The Sims 4. It describes how interactions are the fundamental unit of behavior, and how the game aims to model multitasking by allowing Sims to have multiple active and queued interactions. Constraints are used to determine whether interactions are compatible to run concurrently based on factors like location, posture, and object handling. An interaction queue and priority system manages which interactions are started and stopped based on constraint checks.
11. ● The world is built using game objects
The Sims Architecture
12. ● The world is built using game objects
● Game objects provide interactions
– Sims are objects too!
The Sims Architecture
13. ● The world is built using game objects
● Game objects provide interactions
– Sims are objects too!
● Sims run interactions
– Interactions are fundamental unit of
behavior
The Sims Architecture
15. ● Natural
– People do multiple things at the same time
● Frequently requested feature
Multitasking
16. ● Natural
– People do multiple things at the same time
● Frequently requested feature
● Systematic approach is valuable
– Ad hoc implementation is lots of work,
inconsistent results
Multitasking
17. ● No true concurrent execution
– This is a hard problem
– Deadlock, race conditions, etc...
Concurrency vs Multitasking
18. ● No true concurrent execution
– This is a hard problem
– Deadlock, race conditions, etc...
● Multitasking
– Context switching
– Cooperative
Concurrency vs Multitasking
25. ● Each Sim has
– A set of active interactions
– An ordered queue of pending interactions
Running Interactions
26. ● Each Sim has
– A set of active interactions
– An ordered queue of pending interactions
● Sub-actions run “inside” active interactions
Running Interactions
38. ● Data-driven rules
● Preconditions on running an interaction
● Answer the questions
– Can I run an interaction?
– How do I run an interaction?
Constraints
62. ● Each Sim has
– A set of active interactions
– An ordered queue of pending interactions
Interaction Queue
63. ● Each Sim has
– A set of active interactions
– An ordered queue of pending interactions
● Interactions have priority
– High (User directed)
– Low (Autonomous)
– Idle (Finished but still running)
Interaction Queue
67. Queue Processing
Can Next
Interaction
Run?
Can Next
Interaction
Run?
Wait in QueueWait in Queue
No
Yes
Cancel
Incompatible
Active
Interactions
Cancel
Incompatible
Active
Interactions
Start RunningStart Running
71. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Holding
Drink
How Hands
AnythingAnywhere
Anywhere Anything
72. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
How Hands
AnythingAnywhere
Anywhere
73. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
How Hands
AnythingAnywhere
Anywhere
74. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
How Hands
AnythingAnywhere
Anywhere
Sit or
Stand
75. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
How Hands
AnythingAnywhere
Anywhere
Sit or
Stand
76. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Hold
Drink
How Hands
AnythingAnywhere
Anywhere
Sit or
Stand
77. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Hold
Drink
How Hands
AnythingAnywhere
Anywhere
Sit or
Stand
78. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
Sit or
Stand
Anywhere
79. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
Sit or
Stand
Anywhere
80. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
Sit or
Stand
Anywhere
81. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
Sit or
Stand
Anywhere
On Seat
82. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
Sit or
Stand
Anywhere
On Seat
83. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
Sit or
Stand
Anywhere
On Seat Sit
84. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
Sit or
Stand
Anywhere
On Seat Sit
85. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Don't
Care
How Hands
Sit or
Stand
Anywhere
On Seat Sit
86. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Don't
Care
How Hands
Sit or
Stand
Anywhere
On Seat Sit
87. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrink
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Don't
Care
How Hands
Sit or
Stand
Anywhere
On Seat Sit
88. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
89. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
90. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
91. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
In view,
Facing
92. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
In view,
Facing
93. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
In view,
Facing
Sit or
Stand
94. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
In view,
Facing
Sit or
Stand
95. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Don't
Care
How Hands
SitOn Seat
In view,
Facing
Sit or
Stand
96. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Don't
Care
How Hands
SitOn Seat
In view,
Facing
Sit or
Stand
97. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV
DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Don't
Care
How Hands
SitOn Seat
In view,
Facing
Sit or
Stand
98. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
99. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
100. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
Anywhere
101. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
Anywhere
102. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
103. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
104. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
105. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
106. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV DrinkDrinkSitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Hold
Drink
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
107. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
108. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
109. Next interaction
Active Interactions
Queued Interactions
Watch
TV
Watch
TV SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
110. Next interaction
Active Interactions
Queued Interactions
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
111. Next interaction
Active Interactions
Queued Interactions
SitSit
Read
Book
Read
Book
Interaction Processing Example
Where
Don't
Care
Both
Hands
How Hands
SitOn Seat
Anywhere
Sit or Stand,
Not TV
117. ● Constraints define preconditions for
performing an interaction
Generating Behavior
118. ● Constraints define preconditions for
performing an interaction
● Can be used generatively
Generating Behavior
119. ● Constraints define preconditions for
performing an interaction
● Can be used generatively
● Requires ability to find transition to
constraint
Generating Behavior
120. ● The constraints on each object are stored
in an abstract graph
Transition Graph
121. ● The constraints on each object are stored
in an abstract graph
● Edges are state changes
Transition Graph
122. ● The constraints on each object are stored
in an abstract graph
● Edges are state changes
● Search graph to generate a transition
sequence
Transition Graph
125. Using the
Graph
Stand near table,
Carry Drink
Stand near table,
Carry Drink
Stand near table,
Drink on table
Stand near table,
Drink on table
126. Using the
Graph
Stand near table,
Carry Drink
Stand near table,
Carry Drink
Sit at table,
Drink on table
Sit at table,
Drink on table
Stand near table,
Drink on table
Stand near table,
Drink on table
144. ● Building Features
– Less tolerance for ad-hoc implementation
Challenges – Complexity
145. ● Building Features
– Less tolerance for ad-hoc implementation
– Must express features using constraints
Challenges – Complexity
146. ● Building Features
– Less tolerance for ad-hoc implementation
– Must express features using constraints
● Authoring content
Challenges – Complexity
147. ● Building Features
– Less tolerance for ad-hoc implementation
– Must express features using constraints
● Authoring content
● Complexity of data
Challenges – Complexity