World Model
To help the authoring process, the author is capable of defining what are the consequences of an agent performing a specific action in the World Model.
It is important to note that the effects of actions might be programmed directly in the game itself and communicated to the agents via events. When using the World Model Editor the author asks the model what should the consequences of given events be, these can then be applied to the rpcs or to the environment around the.
The main benefit of using the World Editor is that these effects are configurable without having to recompile the game. Additionally, the action effects defined in the World Model Editor are visible in the Simulator. This allows the author to quickly run and test the defined scenario.
Let’s use it in our example scenario to better understand it. We want to define a rule where each time an agent is the target of a Speak action, his dialogue state is updated:
After adding the rule it need to have an effect:
In the figure above I added a World Model Rule that says everytime an agent is the target of a Speak(*,[ns],*,*) event caused by agent [x] then his dialogue state with agent [x] is updated to [ns]. Use the simulator to check the results:
Now we can have a proper conversation. As you can see the dialogue will go through its different stages as you select the dialogue the Player rpc. Additionally you can see the value of the “DialogueState” belief in the belief inspector section at any particular time you wish.
Let’s add more choices to the dialogue, additionally we will use the meaning and style tags to create a more dynamic and interesting conversation.
I added 6 different dialogue actions. My objective is to make the Charlie agent respond according to its emotional state. That state will be affected by the Player’s decisions. First of all let’s go to Charlie’s emotional appraisal asset and add a new rules:
As you can see in the figure above I added three different appraisal rules, one for each of the dialogue tags defined for the meaning field. The Sad meaning event will be appraised with desirability of -5, the Neutral with Desirability 2 and the Happy one with Desirability 7.
Once again let’s turn to the Simulator to see the results, now each time we try a different sentence we can see its effect on the mood of the Charlie agent.:
“M:” is the mood variable value and “S. EM” represents the Strongest Emotion the agent is feeling, at the time of the screenshot the agent was feeling “Distress”.
Let’s use this variables to influence the agent’s decision making process by adding rules to the EDM component:
Here is the FAtiMA definition of each action rule defined above:
-
"Action": "Speak([cs], *, *, Depressed)",
-
"Target": "[x]",
-
"Layer": "-",
-
"Conditions":
-
"DialogueState([x]) = [cs]",
-
"Mood(SELF) < -1",
-
"S2 = [cs]"]
-
-
Priority": 6
-
Action": "Speak([cs], *, *, Neutral)",
-
"Target": "[x]",
-
"Layer": "-", "Conditions":
-
DialogueState([x]) = [cs],
-
Mood(SELF) > -1,
-
Mood(SELF) < 1
-
S2 = [cs]
-
-
"Priority": 6
-
Action": "Speak([cs], *, *, Positive)",
-
"Target": "[x]",
-
"Layer": "-",
-
"Conditions":
-
DialogueState([x]) = [cs],
-
StrongestEmotion(SELF) = Joy,
-
Mood(SELF) > 1,
-
S2 = [cs]
-
-
"Priority": 6
-
"Action": "Speak([cs], *, *, *)",
-
"Target": "[x]",
-
"Layer": "-",
-
"Conditions":
-
DialogueState([x]) = [cs]
-
-
"Priority": 4
The last Action Rule shown above is the same we already had for any dialogue but with a lower priority than the others. When the agent reaches the S2 dialogue state he will also want to perform this action however the simulator will choose one of the others because of their higher priority value.
Note: The “Decide” method, mentioned in Section 4, returns a list of all the action the agent wants to perform. The order of the actions in the list is defined by their priority value. If the agent decides to perform different actions with the same priority value then the list will be returned in a random order.
In all of these conditions we use at least one “Meta-Belief” such as “Mood” and “StrongestEmotion”. We discuss meta-beliefs in the next post: Meta-Beliefs