artificial intelligence for games

22
Artificial Intelligence for Games Patrick Olivier & John Shearer [email protected]

Upload: dana-king

Post on 02-Jan-2016

44 views

Category:

Documents


3 download

DESCRIPTION

Artificial Intelligence for Games. Patrick Olivier & John Shearer [email protected]. What is (artificial) intelligence?. What is (artificial) intelligence?. Perception Representing Reasoning Acting Collaborating Learning …we know it when we see it…. What is a game?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Artificial Intelligence for Games

Artificial Intelligence for Games

Patrick Olivier & John [email protected]

Page 2: Artificial Intelligence for Games

What is (artificial) intelligence?

Page 3: Artificial Intelligence for Games

What is (artificial) intelligence?

• Perception• Representing• Reasoning• Acting• Collaborating• Learning• …we know it when we see it…

Page 4: Artificial Intelligence for Games

What is a game?

Page 5: Artificial Intelligence for Games

Serious games are interesting…

Page 6: Artificial Intelligence for Games

But what about really serious games?

Page 7: Artificial Intelligence for Games

Course structure

• Finite state machines• Search• Heuristic search (including path planning)• Adversarial search• Rule-based systems• Multi-agent systems• Learning• Planning• Knowledge Representation

Page 8: Artificial Intelligence for Games

Required reading

S.J. Russell & P. Norvig “Artificial Intelligence: A Modern Approach” (International Edition)

2nd or 3rd edition, Prentice Hall.

Page 9: Artificial Intelligence for Games

Classes of game AI…• Empirical:

– hacked procedural (scripted) solutions

• Principled:– classic algorithms (e.g. A* for path planning)

• Real-time state-of-the-art:– newer algorithms (e.g. heuristic search planning)– newer approaches (e.g. cooperating agents)

Page 10: Artificial Intelligence for Games

Development context…• Game AI is hard core computer science!• Game AI is a “bounded optimality” problem• Processing time is always in demand:

– common for the AI < 10% CPU time)

• Efficient algorithms: – real-time – any time

• Efficient representations (especially on consoles)

Page 11: Artificial Intelligence for Games

Don’t reinvent the wheel!

• Over 80% of Game AI problems have been addressed in robotics or agent-based systems:– plan a path for a NPC within the game level– define behaviour for a NPC– define strategies and tactics in wargames– learn from an opponents behaviour– define collective behaviours for NPC

Page 12: Artificial Intelligence for Games

AI for Games in 30 minutes…

• Finite state machines• Search & problem solving • Path planning as heuristic search• Adversarial search • Multi-agent systems• Machine learning• …

Page 13: Artificial Intelligence for Games

FSM: current state of play...

Page 14: Artificial Intelligence for Games

Rule-based (expert) systems• In 1970s expert systems dominated AI• Rule-bases that captured “expertise”• Rules base systems:

– Data representation declarative– Data distinct from procedures for manipulation– Allows flexible description of behaviour

• Encode behaviour as IF-THEN-ELSE rules• …and so…

Page 15: Artificial Intelligence for Games

Rule-based bots…

IF enemy visible AND my health is < 20% OR his weapon >> my weaponTHEN retreat

Page 16: Artificial Intelligence for Games

Search & problem solving• State-based representation of the world

• Transform the world using operators

• Transform current state desired state

• Search for the right sequence of operators– Exhaustively– Heuristically– Stochastically

Page 17: Artificial Intelligence for Games

Path planning as search

• A significant number of games involve moving in buildings, battlefields, etc.

• Choosing the best path within a determined space is a classic AI problem

• Algorithms have been developed that “construct” the best path by exploring possible directions using a heuristic

Page 18: Artificial Intelligence for Games

Path planning for NPCs

• Discretise the environment (state)• Discretise the movement (operators)• Formulate a heuristic• Search algorithm (A*)• Enhance performance:

– Memory (IDA*)– Real-time (RTA*)

Page 19: Artificial Intelligence for Games

Adversarial search• Killing is fun…but we still want to beat Kasparov!• “Serious” games were the first Game AI problems• Representation problem is easy• But the search space is humungous!• Need to search against an opponent

– Minimax

• Need to optimise– Alpha-Beta pruning– Singular extensions

• How did Deep Blue do it?

Page 20: Artificial Intelligence for Games

Machine learning

• Being really intelligent means be able to learn (and become cleverer)…

• Learn to anticipate our opponent• How can we learn?

– Remembering (rote learning)– Learning by building rules– Learning by building models

• Game AI will learn more…

Page 21: Artificial Intelligence for Games

What about the programming?

• Programming AI (in Java)

• Two hour practical classes:– collaborate and learn– 2 progressive programming coursworks– 50% of the assessment for CSC3203– 1 week turnaround for feedback

Page 22: Artificial Intelligence for Games

What next?

• Write notes in the lectures• Buy the textbook (e.g. amazon.co.uk)• Start reading the textbook• Go to the practical classess• Program in your own time• Sign-up for a project