game ai techniques: a brief overviewavagames.ir/wp-content/uploads/2018/04/slides-game... · amin...
TRANSCRIPT
Game AI Techniques: A Brief Overview 1 of 36Amin Babadi
In The Name Of God
Game AI Techniques:
A Brief Overview
Amin Babadi
Ph.D. Candidate in Computer and Video Games
Aalto University, Finland
Spring 2018
Game AI Techniques: A Brief Overview 2 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 3 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 4 of 36Amin Babadi
Who Am I?▪ Academia
o 2007-2011: B.Sc. in Software Engineering, University of Kashan, Iran
o 2011-2013: M.Sc. in AI, Sharif University of Technology, Iran
o 2013-2017: Ph.D. in AI, Isfahan University of Technology, Iran (Dropped Out)
o 2017-Present: Ph.D. in Computer and Video Games, Aalto University, Finland
▪ Industry
o 2011-2012: E.T. Armies (AI Programmer)
o 2012-2013: Awakening: Burning Ashes (Lead Programmer)
o 2016-2017: Cut (Gameplay and AI Programmer)
Game AI Techniques: A Brief Overview 5 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 6 of 36Amin Babadi
What Is Game AI?
Comparison between A* and a human path finder. Left: initial problem. Middle: human. Right: A*
Game AI Techniques: A Brief Overview 7 of 36Amin Babadi
Definition▪ Game AI consists of techniques used to produce the illusion of intelligence in
the behavior of non-playable characters (NPCs).
▪ AIs must be entities that provide just the right amount of complexity to be
challenging and engaging, but not more than that.
Game AI Techniques: A Brief Overview 8 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 9 of 36Amin Babadi
Architecture of AI Agents
Sense Think Act
Game AI Techniques: A Brief Overview 10 of 36Amin Babadi
Sense▪ All AIs need to be aware of their surroundings.
▪ What should be sensed and how?
o It largely depends on the type of game you are creating.
Game AI Techniques: A Brief Overview 11 of 36Amin Babadi
Think▪ Thinking stage is when the actual AI happens!
▪ Luckily, many games require only simple decision-making processes.
▪ A lot of games praised for their great AI have been built with relatively
simple algorithms!
▪ A lot more on this later!
Game AI Techniques: A Brief Overview 12 of 36Amin Babadi
High-Level vs Low-Level Thinking▪ High-level planning
▪ Low-level control
Game AI Techniques: A Brief Overview 13 of 36Amin Babadi
Act▪ Many games exaggerate this part much like in a theater play, so the
character's intentions are obvious and personality is conveyed.
▪ From AI developer’s point of view, this part is the simplest one!
Game AI Techniques: A Brief Overview 14 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 15 of 36Amin Babadi
The Power of Randomness▪ If there are 𝑛 possible actions with equal probability:
o Pick a random integer between 1 and 𝑛 and take the corresponding action.
▪ If there are 2 possible actions with probabilities 𝑝1 and 1 − 𝑝1:
o Pick a random number 0 ≤ 𝑟 ≤ 1, take action 1 if 𝑟 ≤ 𝑝1 and take action 2otherwise.
▪ Roulette wheel selection:
Game AI Techniques: A Brief Overview 16 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 17 of 36Amin Babadi
Rule-Based Systems▪ Rule-based systems allows us to model many behaviors that are tricky to
model using FSMs.
▪ We test the left hand side of each expression (the conditions) in order, and
then execute the right hand side (the action) of the first rule that is activated.
▪ Example:
1. If in contact with an enemy ⟹ combat
2. If an enemy is closer than 10 meters and I'm stronger than him ⟹ chase him
3. If an enemy is closer than 10 meters ⟹ escape him
4. If we have a command from our leader pending ⟹ execute it
5. If a friendly soldier is fighting and I have a ranged weapon ⟹ shoot at the
enemy
6. Stay still
Game AI Techniques: A Brief Overview 18 of 36Amin Babadi
Decision Trees▪ Simply another formulation of rule-based systems.
Game AI Techniques: A Brief Overview 19 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 20 of 36Amin Babadi
Finite State Machines (FSM)
Game AI Techniques: A Brief Overview 21 of 36Amin Babadi
FSM Variations▪ Basic
▪ Non-deterministic
▪ Parallel
▪ Synchronized
▪ Hybrid
Game AI Techniques: A Brief Overview 22 of 36Amin Babadi
Non-Deterministic FSM
Game AI Techniques: A Brief Overview 23 of 36Amin Babadi
Parallel FSM
Game AI Techniques: A Brief Overview 24 of 36Amin Babadi
Synchronized FSM
Game AI Techniques: A Brief Overview 25 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 26 of 36Amin Babadi
Search and Planning
Game AI Techniques: A Brief Overview 27 of 36Amin Babadi
A*
Game AI Techniques: A Brief Overview 28 of 36Amin Babadi
A*
Game AI Techniques: A Brief Overview 29 of 36Amin Babadi
Monte Carlo Tree Search (MCTS)
Game AI Techniques: A Brief Overview 30 of 36Amin Babadi
MCTS Characteristics▪ Aheuristic
▪ Anytime
▪ Asymmetric
Game AI Techniques: A Brief Overview 31 of 36Amin Babadi
Evolutionary Planning
Game AI Techniques: A Brief Overview 32 of 36Amin Babadi
Rolling (Receding) Horizon Evolution
▪ Genetic algorithm (for discrete actions)
▪ Evolution strategy (for continuous actions)
Game AI Techniques: A Brief Overview 33 of 36Amin Babadi
Rolling (Receding) Horizon Evolution
▪ Genetic algorithm (for discrete actions)
▪ Evolution strategy (for continuous actions)
Game AI Techniques: A Brief Overview 34 of 36Amin Babadi
Agenda▪ A little about me
▪ What is game AI?
▪ Architecture of AI agents
▪ Randomness
▪ Logical reasoning
o Rule-based systems
o Decision trees
▪ Finite state machines
▪ Search and planning
o MCTS
o Evolutionary Planning
▪ How/where to begin?
Game AI Techniques: A Brief Overview 35 of 36Amin Babadi
How/Where to Begin?▪ Books
▪ Websites
o AIGameDev.com (http://aigamedev.com/)
▪ Courses
o The Principles of Modern Game AI (https://courses.nucl.ai/)
Game AI Techniques: A Brief Overview 36 of 36Amin Babadi
Thanks!
https://github.com/keijiro/PuppetTest