designing intelligence

23
06/21/22 1 Designing Intelligence CIS 488/588 Bruce R. Maxim UM-Dearborn

Upload: tuwa

Post on 23-Feb-2016

42 views

Category:

Documents


0 download

DESCRIPTION

Designing Intelligence. CIS 488/588 Bruce R. Maxim UM-Dearborn. Useful Game AI - 1. Perception Ability of NPC to detect what is happening in the game world (near or far away) Enemies, goals, collisions, and damage should be processed in a believable way Action - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Designing Intelligence

04/22/23 1

Designing Intelligence

CIS 488/588Bruce R. MaximUM-Dearborn

Page 2: Designing Intelligence

04/22/23 2

Useful Game AI - 1

• Perception– Ability of NPC to detect what is happening in the

game world (near or far away)– Enemies, goals, collisions, and damage should be

processed in a believable way• Action

– Behaviors chosen by NPC without any apparent inputs

– Often determined by scripts or rules

Page 3: Designing Intelligence

04/22/23 3

Useful Game AI - 2

• Reaction– Behaviors triggered by game world related stimuli

(usually the player’s actions)• Learning

– Could be simply recording previous information (what worked and what did not)

– Is better if some generalization takes place (and NPC’s share some knowledge of player over time)

Page 4: Designing Intelligence

04/22/23 4

Opponents

• Any entity that tries to prevent player from achieving goals

• Opponent’s capabilities need to match player expectations and abilities ramp up as game progresses

• Perfect (cheatbots) opponents discourage good game play

Page 5: Designing Intelligence

04/22/23 5

Opponent Types

• Action opponents– Should have classes of behaviors that can be

easily identified by players (e.g. guards)• Sports Opponents

– Should approximate player skills (e.g. reaction times, accuracy, tactical decision making)

• Board Game Opponents– Often Mini-max search and book move libraries

(handicap AI by reducing look ahead)

Page 6: Designing Intelligence

04/22/23 6

Allies

• NPC’s that work with player• Concerns

– Recognition (opponents vs allies)– Communication (allowing allies and player to

share understanding of game information)– Following/chasing behaviors (when to follow and

when to act on their own)– Party or squad behavior (groups that share

abilities to support the player’s lead)

Page 7: Designing Intelligence

04/22/23 7

Traditional Approach

• In-game agents simulated as part of the game logic with 2D positions updated each clock tick (very slow)

• AI code can be separated from the game logic if the game agent has access to game state data as needed

• Agile development processes are used to build user interface and game logic from scratch incrementally

• Game AI requires lots of experimentation to get working right as increments evolve

Page 8: Designing Intelligence

04/22/23 8

Traditional Agents

• AI viewed as code fragment that manipulates data

• Single CPU controls all information processing and executes actions on behalf of the agents

• Agents are able to solve some problems for the player by not requiring micromanagement of all game objects

Page 9: Designing Intelligence

04/22/23 9

Traditional Guidelines

• Cut corners whenever possible to save development time without sacrificing efficiency

• Requiring both realism and efficiency argues for weak AI techniques

Page 10: Designing Intelligence

04/22/23 10

Traditional Weaknesses

• Dangerous to let AI access game information directly if changes are allowed

• Manually programming all AI behaviors is tedious and causes exponential growth in development times

• This approach scales up very poorly and fails to transfer examples well from one domain to another

Page 11: Designing Intelligence

04/22/23 11

Modern Approach

• CPU is not needed to deliberate every move for every object

• System behavior is distributed to reactive objects in the game environment

• Full systems are built incrementally by testing each set of new components as they come on line

Page 12: Designing Intelligence

04/22/23 12

Animats

• Animats are embodied systems situated in realistic environments as robots or NPC’s

• Animats simulate reactive creatures accurately meaning fewer aspects need to be faked

• Allow more complete separation of AI from game logic and simulation

Page 13: Designing Intelligence

04/22/23 13

Animat Benefits

• Interaction with environment is formalized to that is can be optimized using the best information sharing technique

• Learning techniques minimize processing power use to perform a particular behavior

• Can provide improvements in efficiency of the design and development pipeline

Page 14: Designing Intelligence

04/22/23 14

Embodiment

• An embodied agent is a living creature subject to the constraints of its environment

• The environmental constraints restrict the AI to the subset of actions plausible with the laws governing the simulation

• A standard agent can change its position to reach any reachable point in space

• An embodied agent will need to deal with obstacles since it does not have the ability to update its position directly (some trial and error is involved)

Page 15: Designing Intelligence

04/22/23 15

Formal Interfaces

• Provide hooks to agents using the game engine

• Allow agents to reside on different servers than the game engine

• Let engineers decide on the best mechanism to communicate data to the AI (messages, callbacks, abstract function calls, shared variables)

Page 16: Designing Intelligence

04/22/23 16

Performance Advantages ofFormal Interfaces

• Lazy evaluation (information gathered only as needed)

• Event-driven (AI does not need to poll for data it is notified)

• Function in-lining (interfaces can be factored out by the compiler if needed)

• Custom optimizations (can be used to speed up queries)

• Batching (queries can be queued for later processing)

Page 17: Designing Intelligence

04/22/23 17

Learning

• Acquisition of new knowledge and abilities• Motivation:

– Optimization (solving known puzzles off-line to allow for better game performance)

– Adaptaton (continuously updating state knowledge on-line to deal with different playing styles during the game)

Page 18: Designing Intelligence

04/22/23 18

Learning Technology

• Supervised learning (algorithms presented with examples expected to generalize patterns)

• Reinforcement learning (feedback takes the form of a numeric reward following particular behaviors reward adapts policy over time)

• Evolutionary approaches (numeric rewards given for sequences of actions)

• Unsupervised learning (design provides performance metric rather than direct training)

Page 19: Designing Intelligence

04/22/23 19

Teaching

• Teaching (humans provide set of examples to help animat adjust its behavior)

• Imitation (animat copies behavior of another another player)

• Shaping (animat completes sequence of successively more complex tasks)

• Trial and error (animat placed in environment and lets it try all actions on its own)

Page 20: Designing Intelligence

04/22/23 20

AI Development Process

Page 21: Designing Intelligence

04/22/23 21

AI Development Process - 1

• Informal phases– Analysis phase describes how existing design and

platform affect general task– Understanding phase provides precise definition of

the problem and testing criteria• Formal phases

– Specification phase defines the interfaces between the AI and the game engine

– Research phase investigates existing AI techniques and expresses theory operationally

Page 22: Designing Intelligence

04/22/23 22

AI Development Process - 2

• Programming phases– Development phase implements AI theory as a

convenient AI module– Application phase take problem definition and

framework and uses AI module to solve problem• Testing phases

– Experimentation phase uses testing to assess the current prototype focusing on tough cases

– Testing phase presents thorough series of evaluations using test case likely to be successful

Page 23: Designing Intelligence

04/22/23 23

AI Development Process - 3• Postproduction phase

– Optimization phase attempts to make actual implementation lean and mean

• The final product of this process is a single behavior

• The process is repeated for each new behavior

• The number of iterations can be reduced using a cleaver AI architectural design