Download presentation
Presentation is loading. Please wait.
Published byCharlene McKenzie Modified over 9 years ago
1
Constraining Autonomous Character Behavior with Human Concepts Presentation by Jonathan Martin Based on Chapter 3.1 of AI Game Programming Wisdom 2, by Jeff Orkin
2
Two Ways to Create Lifelike Behavior Script it in Script it in This ensures we get the behavior we want It’s also extremely time- consuming If the scripter makes a mistake, could have drastic consequences
3
The Alternative: Create Autonomous Characters Whereas scripting involves programming an action for every possible situation… Whereas scripting involves programming an action for every possible situation… Autonomous agents calculate their action based on… Desires Sensory Input Proximity to items of interest
4
A Hypothetical Situation We want to design a Tactical Espionage Action game We want to design a Tactical Espionage Action game The player will be sneaking around an enemy base, hopefully undetected The player will be sneaking around an enemy base, hopefully undetected Guards should have behavior that is both realistic and interesting Guards should have behavior that is both realistic and interesting
5
Creating our AI Step 1: Create enemies that can perform certain actions Step 1: Create enemies that can perform certain actions Step 2: Populate level with tagged objects Step 2: Populate level with tagged objects Tags indicate the action that can be performed on an objectTags indicate the action that can be performed on an object
6
Pseudocode While (alive) While (alive){ Gather input from perceptors Select object on which to perform action Execute action }
7
I want some Hot Coffee I need to get some work done I feel asleep
8
Adding Human Concepts to the AI Ownership Ownership Group Objects into setsGroup Objects into sets A character can “own” one set of objects at a timeA character can “own” one set of objects at a time Public objects can be in their own set, or none at allPublic objects can be in their own set, or none at all Dependancy Dependancy Certain actions can only be performed before or after another Add a dependency tag to each object, which indicates actions that are preconditions for the current action
9
Adding Human Concepts to the AI Responsibility Responsibility Tag each object with the class or classes of character that can interact use itTag each object with the class or classes of character that can interact use it We don’t want soldiers performing experiments in a lab, or scientists picking up assault riflesWe don’t want soldiers performing experiments in a lab, or scientists picking up assault rifles Priority Priority Divide behaviors into categories When choosing an action, choose the highest priority behavior possible “Attack player” might be the highest-priority behavior
10
Adding Human Concepts to the AI State of Consciousness State of Consciousness If the game includes sleep/unconscious states, make sure actions are disabled while in those statesIf the game includes sleep/unconscious states, make sure actions are disabled while in those states Expected State Expected State On seeing an ally, check if he/she is in an unexpected state If an object is moved, set a “changed” flag, so that NPC’s will notice the change
11
Adding Human Concepts to the AI Presence of Others Presence of Others Evaluate how an action will affect other charactersEvaluate how an action will affect other characters This will be covered in the next sectionThis will be covered in the next section
12
A Modified Pseudocode While (alive) While (alive){ Gather input from perceptors Select object on which to perform action { Am I awake? What is most important right now? Has anything changed? What is my purpose? Is this object mine to use? Is there anything I need to do before using this object? How will this action affect other characters? } Execute action }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.