ai “i have always tried to teach the ai the same successful strategies that i use in playing a...

31
AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Upload: christopher-baldwin

Post on 01-Apr-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

AI

“I have always tried to teach the AI the same successful strategies that I use in

playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Page 2: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Source

• Rouse, R., (2005) Game Design, Theory and Practice (2nd ed.), Wordware Publishing Inc., Plano Tx USA, chapter 9.

Page 3: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Turing Test:

• Humans are provided with terminals

• They type sentences

• A machine provides responses on screen

• If humans believe that responses provided by human, the machine has passed the Turing test.

Page 4: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Depth of AI

• In games, AI tries to make the game fun

• Game’s AI may be completely random

• Game’s AI may be completely logical

• Bigger challenge to design behaviours and movement patterns

• E.g.: Tetris selects the next block at random.

Page 5: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Depth of AI

• Degree of AI depends on the game

• In RPG (role playing game) expect high level of AI

• In Sims, the AI is the game

• (NPC = non-playing character = AI driven)

Page 6: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Rules of AI

• AI must not do silly things

• High standard expected from “human” characters (the Uncanny Valley effect)

• Non-humans don’t need to be so clever

• Nevertheless, dumb behaviour destroys the game experience

Page 7: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Making AI Appear Human

• AI must be unpredictable

• Humans are unpredictable

• If game behaviour is predictable, the fun stops

• Players need surprise

• Surprise can be as simple as a random number generator

Page 8: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Making AI Appear Human

• Players attribute intelligence even if actions random, “What’s it trying to do?”

• Fuzzy logic: randomness weighted so as to make good strategies more likely

• Or small amount of randomness added into cold logic to add surprises

• Try not to let randomness get in the way of enemy strategy

Page 9: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Storytelling

• AI assists storytelling• Better to show than to tell• CAN show that citizens frightened in a cut-

scene• BETTER: program citizens to avoid the

player• Dynamic storytelling: NPC responds to

how you treat it – either helps you or opposes you.

Page 10: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Storytelling

• AI can create a living world

• There are NPCs which are part of the game

• Other NPCs simply set the scene – make the player feel less lonely.

Page 11: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

The Sloped Playing Field

• Humans are usually smarter than AI

• Not realistic to give each a fair chance, so:

• There are more of them than us, They never need to reload, We have to shoot them while they only need to touch us

• Victory against insurmountable odds is far sweeter!

Page 12: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

AI and the Environment

• Stupid NPCs sometimes get stuck in corners

• Need to match the design of the level to ability of NPC to navigate - compromise

• Levels and NPCs are usually designed by different teams, so it doesn’t always work first time

• If the NPC is on the player’s side, make very sure it won’t let her down.

Page 13: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Scripted Behaviour

• If there is something really tricky for an NPC to do (swing on a rope?) – script it.

• Don’t use too much scripting – it looks and is predictable

• Can switch between scripts, randomly or intelligently

• Common to script “human” guides who lead and advise at various points

• Guides tend to be big talkers!• If a guide leads, program the end-point but use

AI to decide the route

Page 14: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Policy and Programming

• Game itself is anthropocentric (revolves around human player

• NPC interacts with human player:

– Simple reactions (eg shoots back when shot at)

– General attitudes (behaviour depends on how treated)

– Complex intentions (agenda of own)

Page 15: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Where to put the intelligence

• The more restrictive the game world is, the more complex the NPCs need to be

• eg: If the game world allows NPCs to walk into a fire, we need to programme the NPC not to

• If the game world prevents anyone from walking into the fire, NPC programming becomes easier

Page 16: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Humanness and Stance

Humanness:• NPCs are limited in humanness – so multiplayer

games can look far more realistic• Even minor displays of emotion can make a

character look more human• Humans unconsciously try to read humanness

into character actions• If the game world is interesting to watch, it will

also be enjoyable to participate in

Page 17: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Humanness and Stance

Humanness:

• There are games which don’t have human players (eg: Sims, Singles)

• Humans remain as non-participating observers

• Enthusiastic watchers: parents and coaches watching protégés and own children

Page 18: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Humanness and Stance

• Stance:–Enemy

–Ally

–Observer

Page 19: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Humanness and Stance

• Stance: Enemy

• Traditionally NPC is an enemy

• Must show intelligent or at least purposeful behaviour

• Illusion that NPC is at same level as the human player

Page 20: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Humanness and Stance

• Stance: ally

• Reconnaisance officer must provide data in a visually accessible format

• Human players require consistency, even at the expense of complete data.

• NPC allies can even take on tasks for player

Page 21: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Humanness and Stance

• Stance: neutral• NPC is observer (camera operator,

commentator)• NPC is referee (football)• Can simply be part of the story• An extra• There to provide atmosphere• Assist immersion

Page 22: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

The MVC Model

Model - View - Controller

Page 23: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

The Role of the Computer

• Coordinating the game process (eg realising a participant’s move in a chess game according to the rules

• Illustrating the suituation ( e.g. displaying the chessboard and pieces on the screen)

• Participating as a fellow player

Page 24: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

The MVC Model

• Developed by the Smalltalk community and adopted by the object-oriented world.– The underlying application domain

(Model)– The way the scene is presented to the

viewer (View)– The way the user interacts with the

game (Controller)• These should be kept separate.

Page 25: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)
Page 26: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Model

• Includes software components that do coordination: evaluate rules, uphold game state

• Rules and basic entity information (eg gravity and other physical laws) form the core structures

Page 27: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Model

Core structures need not cover all rules as they may be instantiated:

• Core structures cover basic mechanism and properties of eg playing cards

• Instance data provides additional structures needed for game (eg ranking of hands, stake handling, resolving ties)

Page 28: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

View Section

• Handles the presentation of the game state to human and synthetic playeers

• Rendered view goes to output device for human players. Sometimes customisable. Includes audio. Can include sensory feedback (rumble)

• Synthetic view goes to synthetic (AI) player. Has coordinates and mathematical data - more useful than rendered form.

Page 29: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Controller

• Controller allows human and synthetic players to input moves into the game

• Controller can exclude illegal moves suggested by the player

• usually human input enters controller through an input device and driver software.

• Configuration component initialises the game.

Page 30: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Extensions of MVC model

• Diagram only shows one player and one AI synthetic player. There may be many

• The model may be distributed over many computers

Page 31: AI “I have always tried to teach the AI the same successful strategies that I use in playing a game”. – Brian Reynolds (Civilisation II & Alpha Centauri)

Directed study:

• Download Doom95 and play it

• Note especially the behaviour of the monsters

• What do they do when they aren’t engaged?

• When do they engage with you

• What do they do while engaged?

• Do they help each other?