410 likes | 434 Views
Explore how actions define what NPCs can do, with parameters and semantics, organizing action sets based on roles, and measuring similarity for taxonomy creation. Analyzes real-world examples and showcases a taxonomy using component similarity.
E N D
Understanding Everything NPCs Can Do: Metrics for Action Similarity in Non-Player Characters J. Timothy Balint, Jan M. Allbeck, Rafael Bidarra Foundations of Digital Games 2018
What are Actions? Daze • An action is the definition of what NPCs can do • Contains everything needed to: • reason • operate
What are Actions? Roles Prisoner Guard • Actions have intrinsic parameters and semantics • We call these Components
What are Actions? Roles Conditions - Assertions C: Prisoner can walk to guard Prisoner Guard C: Prisoner is not holding anything A: Guard is Dazed • Actions have intrinsic parameters and semantics • We call these Components
What are Actions? Roles Conditions - Assertions Behavior Daze C: Prisoner can walk to guard Sequence Prisoner Guard C: Prisoner is not holding anything A: Guard is Dazed • Actions have intrinsic parameters and semantics • We call these Components Hit Approach
What are Actions? Roles Conditions - Assertions Behavior Daze C: Prisoner can walk to guard Sequence Prisoner Guard C: Prisoner is not holding anything A: Guard is Dazed Behavior parts can be actions as well! • Actions have intrinsic parameters and semantics • We call these Components Hit Approach
Organizing Actions Can action sets be organized?
Organizing Actions Can action sets be organized?
Organizing Actions Have Roles Prisoner and Guard Can action sets be organized?
Organizing Actions No connection between all actions • Can action sets be organized? • Taxonomy based on name
Organizing Actions • Can action sets be organized? • Taxonomy based on Roles
Organizing Actions Have Roles Prisoner and Guard • Can action sets be organized? • Taxonomy based on roles
Organizing Actions • How can action sets be organized? • Metrics for Similarity of Actions • Metrics for Taxonomy
Similarity Metrics for Actions • Previous work looks at Levenshtein Distance • Differences in actions are binary comparison • Finds the minimum cost to convert one behavior into another
Similarity Metrics for Actions Sequence Sequence Sequence Selector Previous work used Levenshtein distance for behaviors
Similarity Metrics for Actions Sequence Sequence Sequence Sequence Role: Prisoner, Guard Role: Prisoner, Guard 1 Role: Prisoner, Guard Role: Prisoner, Guard Role: Prisoner, Guard 2 Role: Prisoner, Guard 1 Previous work used Levenshtein distance for behaviors
Similarity Metrics for Actions • Total cost considers edit distance and set comparison • Edit distance allows sequence comparison and different costs • Similarity is 1 – normalized cost • We define costs for: • Action (if organized into a taxonomy) • Components • Behavior
A Real World Example Used Shoulson et al.’s Event-Centric Planning Action Set A. Shoulson, M. L. Gilbert, M. Kapadia, and N. I. Badler, “An event-centric planning approach for dynamic real-time narrative,” in Motion in Games, Doublin, Ireland, 2013, pp. 121–130.
A Real World Example Levenshtein Distance Edit Distance and Role Component Similarity
A Real World Example Difference between Levenshtein and Edit Distance with Roles Component Similarity
A Real World Example Difference between Levenshtein and Edit Distance with Roles Component Large Difference in Measurements Similarity
A Real World Example Trap Guards Alarm Distract Guard Sequence Sequence Parallel Press (Prisoner, Button) Press (Prisoner, Button) Hide (Prisoner, Waypoint) Call (Prisoner, Guard) Trap (Guard, Trap) Parallel Approach (Prisoner, Button) Parallel Parallel Hide (Prisoner, Waypoint) Trap (Guard, Trap) Roles: 1 Guards, 3 Prisoners, 2 Waypoints, 1 door Call (Prisoner, Guard) Approach (Guard, Prisoner) Approach (Guard, Prisoner) Trap (Guard, Trap) Call (Prisoner, Guard) Approach (Guard, Prisoner) Approach (Guard, Prisoner) Trap (Guard, Trap) Call (Prisoner, Guard) Approach (Guard, Prisoner) Approach (Guard, Prisoner) Call (Prisoner, Guard) Approach (Guard, Prisoner) Approach (Guard, Prisoner) Roles: 4 Guards, 2 Prisoners, 2 buttons, 1 trap
Organizing Actions into a Taxonomy Taxonomy AB AB AB ABG AG Added category actions (black) Actions in Set (Colored) Component of Action Similarity can help us set up a taxonomy Measure taxonomy using components
Organizing Actions into a Taxonomy AB AB AB ABG AG Similarity can help us set up a taxonomy Measure taxonomy using components
Organizing Actions into a Taxonomy Taxonomy AB AB AB ABG AG AB A G Similarity can help us set up a taxonomy Measure taxonomy using components
Organizing Actions into a Taxonomy Taxonomy A AB AB AB ABG AG AB A G Similarity can help us set up a taxonomy Measure taxonomy using components
Organizing Actions into a Taxonomy Taxonomy A AB AB AB ABG AG AB A G Similarity can help us set up a taxonomy Measure taxonomy using components
Organizing Actions into a Taxonomy Taxonomy A B AB A G Similarity can help us set up a taxonomy Measure taxonomy using components
Organizing Actions into a Taxonomy Taxonomy A B B G Similarity can help us set up a taxonomy Measure taxonomy using components
Organizing Actions into a Taxonomy Taxonomy Taxonomy (Original) A B AB AB AB ABG AG B G
Another Real World Example Using Conditions and Assertions Using Roles Component similarity guides creation
Another Real World Example A. Shoulson, M. L. Gilbert, M. Kapadia, and N. I. Badler, “An event-centric planning approach for dynamic real-time narrative,” in Motion in Games, Doublin, Ireland, 2013, pp. 121–130. Event Centric Planning* action set No organization and three organization strategies Binary task comparison
Another Real World Example • Two different agent reasoning systems • Crowd (uses roles) • Define 10 areas for each role set • 1000 trials • Traditional Planner (uses condition and assertions) • Time to find a plan that satisfies three randomly chosen assertions • Average found plan is 8 to 10 actions • 20 trials
Another Real World Example Using a Role-Based Action Selector
Another Real World Example Using a Role-Based Action Selector
Another Real World Example Using a Condition and Assertion Based Action Selector
Another Real World Example Using a Condition and Assertion Based Action Selector
Conclusions • Action taxonomies can assist in NPC decision making • Generalize Data • Pre-prune Tree • Action Similarity teases out difference in meaning • More information = More insight
Limitations • Comparing semantics means we need semantics • Similarity is only a guide • More complicated reasoning makes it more difficult to build taxonomies
Questions? • Email: j.t.balint@tudelft.nl • Action Metric Repository: • https://github.com/j-timothy-balint/Action-Comparison