DESC9180 Designing Virtual Worlds Week 9 Interactivity II – Agent Models for Dynamic Virtual...
-
date post
15-Jan-2016 -
Category
Documents
-
view
212 -
download
0
Transcript of DESC9180 Designing Virtual Worlds Week 9 Interactivity II – Agent Models for Dynamic Virtual...
DESC9180 Designing Virtual Worlds
Week 9
Interactivity II – Agent Models for Dynamic Virtual Worlds
6pm – 9pm
Tuesday, September 18th, 2007
Kathryn Merrick and Owen Macindoe
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Lecture Overview
What is an agent?
The role of agents in virtual worlds
Designing agents for dynamic virtual worlds
Demonstrations and examples
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
What is an Agent?
A software process that: Monitors its environment using sensors Reasons about sensor data using some
characteristic reasoning process
Acts in its environment using effectors
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Other Properties of an Agent (I)
Reflexive: Pre-programmed responses to the state of the virtual environment
Reactive: Reasoning within a fixed set of goals
Reflective: Hypothesises about possible goals
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Other Properties of an Agent (I)
Autonomous: Includes reasoning processes to create new goals
Proactive: Anticipate the needs or intentions of others
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Implementation complexity
scriptedbehaviours
reactive,reflectiveagents
reflexiveagents
autonomous,proactive
agents
Behavioural com
plexity
The Role of Agents in Virtual Worlds (I)
Agents provide a structured approach to implementing dynamic virtual worlds
Believable characters Incredible objects
A single agent program may be applicable in many scenarios
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
The Role of Agents in Virtual Worlds (II)
Enemies or opposition
Partners
Support characters
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Designing Agents for Dynamic Virtual Worlds
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
effectors
Current state of the virtual world or some part of it
action
A change to the virtual world
state
reasoning
sensors
AGENT
Agents generally monitor and act in only a small part of the world
There may be multiple agents
A LSL Approach to Agents
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
default{ state_entry() { state sensation; }}
state sensation{ state_entry() { // Gather information // about the world… state reasoning; }}
state reasoning{ state_entry() { // Process information // about the world… state reasoning; }}
state activation{ state_entry() { // Perform an action… state sensation; }}
Sensation
Reasoning
Activation
Monitoring the Virtual World
Agents generally monitor only a small part of the world:
Monitor properties that are necessary for deciding how to act
What to monitor? Self Other objects or scripts Avatars or chat Virtual land
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Self-Monitoring Objects
llGet… functions are useful for this: Shape and location properties Physics properties Meta-data Ownership and permissions Script properties
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Monitoring Other Objects and Avatars
Monitoring other objects: llSensor (see last week’s lecture) llDetected… functions
Monitoring avatars llSensor for generic properties llListen for chat touch_start for avatar touches collision for collisions
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Monitoring the Virtual Land
llGet... And llGround… functions for: Time and sun position Parcel and region flags Camera position Properties of the ground
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Reasoning: Artificial Intelligence for Virtual Worlds
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Artificial Intelligence (AI) techniques used in virtual worlds lag behind the current state of the art in AI research:
AI techniques are complex Behaviour may be unpredictable
But some techniques have been used with great success…
Rule-Based Systems
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Define a set of rules about states of the virtual world
Rules have the form: If <condition> then <action>
Simple to implement for a single agent A lot of work when there are multiple
agents requiring different rules
Flocking
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
A special example of
rule-based reasoning Used to control groups
crowds or animals
Three rules governing: Separation Alignment Cohesion
Craig Reynold’s flocking rules for boids
State Machines
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Divide the reasoning process into internal states
Each state defines rules about: How to act while in that state When to transition to a different internal
state
One of the most popular control strategies for dynamic virtual worlds
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
AI Implant
Fuzzy Logic
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
A way for agents draw a conclusion based on facts that may be vague, ambiguous, inaccurate, incomplete
Classical rules Fuzzy logic
Fuzzy Rules
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Fuzzy logic can be used to create a rule-base with rules of the form:
If <X is A> then <Y is B> Eg: if number of avatars is large then
overcrowding is likely
Can be used in rule based approaches and state machines
Supervised Learning
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Agents gradually modify their internal structure in response to examples
Examples of desirable behaviour provided by human controlled avatars
Learning agents can adapt Learning can be slow or inaccurate
How a Supervised Learner Works
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Many variants of supervised learning exist Agent monitors:
State of virtual world Actions performed by avatars
Agent stores: State-action pair Weight indicating confidence
Agent acts autonomously when a recognised state is encountered
State 1 Action1 0.3
State 2 Action 5 0.9
State 3 Unknown
State 4 Action 3 0.8
Reinforcement Learning
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Learning by trial and error Agents modify their internal structure in
response to reward or punishment from: Human controlled avatars Internal function
Learning agents can develop better policies than programmed agents
Learning can take a long time
How a Reinforcement Learner Works
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Many variants exist Action is initially random trial and error Agent monitors:
State of virtual world Reward or punishment
Agent stores: State-action pair Cumulative reward or punishment
Agent acts by choosing action with highest reward (or lowest punishment)
State 1 Action1 0.9
Action 2 0.5
State 2 Action 1 0.3
Action 2 0.8
Evolutionary Algorithms
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
A society of characters evolve individuals with advantageous characteristics
Karl Sims’ evolved virtual creatures
Acting in the Virtual World
Individual agents generally act in or change only a small part of the world
Multiple agents may control larger regions of the virtual environment
How to act? Changes to self Avatars Changes to other objects Environment eg: chat
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Self-Changing Objects
llSet… functions are useful for this: Shape and location properties Physics properties Meta-data Ownership and permissions Script properties
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Changing Avatars
You can’t put scripts in avatars… But you can:
Apply an animation to an avatar Attach scripted objects to an avatar to
control: Avatar location Other avatar attachments
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Changing Other Objects
You can’t directly change an object from a script inside a different object…
But you can: Send messages to an object telling it
how to change itself (remember the light switch example from last week)
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Tutorial: Advanced LSL techniques
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Download the agent framework LSL script:
http://www.it.usyd.edu.au/~kkas0686/desc9180readings/Agent%20Framework.txt
Copy a sheep from thetruck in Furness (236, 10, 55)
Write your own agentscripts to create someintelligent sheep (see tutorial sheet)
Next Week (s)
DESC9180 Designing Virtual Worlds University of Sydney, September 2007
Next week (25/9) is the mid semester break No lecture or tutorial
The following week (2/10) will be our paper review session
Please send me your slides in advance so I can have them installed, ready for class