SlideShare a Scribd company logo
Approaches to game AI
Ivan Dolgushin
Game developer at Appturn
Artificial Intelligence
Artificial intelligence (AI) is
the intelligence exhibited
by machines or software.
Intelligent Agent
• simple reflex agents
• model-based reflex agents
• goal-based agents
• utility-based agents
• learning agents
Why should we bother?
• philosophy: understanding the
nature of thought and the nature
of intelligence and building
software to model how thinking
might work;
• psychology: understanding the
mechanics of the human brain
and mental processes;
• engineering: building algorithms
to perform human-like tasks;
Duck-testing game AI
If it looks like a duck,
swims like a duck,
and quacks like a duck,
then it probably is a duck.
Simple vs Complex
• Simple things can look good.
• Complex things can look bad.
Not Too Hard, Not Too Easy
Not Too Hard, Not Too Soft
What do we need it for?
• Steering
• Pathfinding
• Decision making
• Learning
• Predicting actions
• Group AI and
coordinated actions
• Sensory input
Cowboy Style
Neural Networks
NN: Summary
Pros:
• mass parallelism;
• distributed representation of
information and computation;
• ability to learn and generalize;
• adaptability;
• process information in the
context;
• tolerant to errors.
Cons:
• hard to teach;
• hard to test;
• hard to interpret data.
Summary: think twice before adopting in your project
Finite State Machines
FSM: State Polling vs Event
FSM: State Polling vs Event
FSM: To Stack Or Not To Stack
FSM: Example
Stack-less event-based FSM example:
<stateMachine>
<states>
<state class="move" id="moveAfterStampede" animation="move" speed="1.6" walkTime="2.33"/>
<state class="dead" id="dead"/>
<state class="getout" id="getout" initial="initial" animation="getout"/>
...
<state class="wait" id="rot" animation="rot" delay="3"/>
<state class="wait" id="disappear" animation="disappear"/>
</states>
<events>
<state id="disappear">
<event name="animationEnd"><state id="dead"/></event>
</state>
<state id="rot">
<event name="waitEnd"><state id="disappear"/></event>
<event name="wait"><state id="waitForRevive"/></event>
</state>
<state id="die">
<event name="animationEnd"><state id="rot"/></event>
</state>
<state id="getout">
<event name="animationEnd"><state id="stampede"/></event>
<event name="hit"><state id="stampedeHit"/></event>
</state>
...
</events>
</stateMachine>
FSM: Summary
Pros:
• easy to understand;
• flexibly parameterized;
• allow wide variety of
abstraction levels;
• easy to interpret;
• easy to test;
• has a lot of well described
modifications.
Cons:
• large FSM can be hard to
comprehend;
• hard to maintain large FSMs;
• don’t learn;
• has no memory;
• trivial state switching triggers
logic;
• may force some redundancy.
Summary: nice universal option for most small-to-mid
projects. Good starting point if you have few well defined
behaviors.
Growing Trees
Decision Trees
DT: Linearization
DT: Linearization
If no HP left
Then monster is dead
Else If player is in melee radius and monster can use a ‘Hammer’ skill
Then monster uses ‘Hammer’
Else If player is close
Then monster flees (move) from a player
Else If player is in aggro-radius and monster can use a ‘Summon’ skill
Then monster uses ‘Summon’
Else If player is in shooting radius
Then monster shoots
Else If player is in aggro-radius
Then monster chases them (move)
Else Monster wanders (move) around the room
DT: Summary
Pros:
• easy to understand;
• easy to interpret, especially
in linearized form;
• easy to reuse subtrees;
• easy to add learning
• easy to understand learnt
knowledge.
Cons:
• don’t learn;
• has no memory;
• depends on world state, not
on events in the world;
• may force some
redundancy.
Summary: good for turn-based games and other games
with atomic (instant) actions and a lot of factors with the
few significant values each.
Behaviour Trees
BT: Flow Control
Selector (any) Sequence (all)
Result:
• Success
• Failure
• Running
BT: If-Else
Result:
• Success
• Failure
• Running
BT: Example
BT: Example
<all> <!-- Attacking block -->
<isPlayerInRoom/>
<isPlayerInAggroRadius/>
<callForBackup/>
<any> <!-- Using skills block -->
<any>
<all> <select target="Player"/> <use skill="Advanced"/> </all>
<all> <select target="Player"/> <use skill="Basic"/> </all>
</any>
<go to="Player"/>
</any>
</all>
BT: Summary
Pros
• very flexible and extensible;
• easy to interpret after some
practice;
• extends strengths of DTs with
some FSM features;
• allows to work on different
abstraction/detail levels;
• high modularity;
• easy to reuse subtrees.
Cons
• require certain mindset to
comprehend;
• explicit flow control
configuration may sometimes
look redundant;
• don’t learn;
• has no memory;
• depends on world state, not on
events in the world;
Summary: great technique for all variety of project sizes
and complexities, if you are willing to learn thinking in BT-
way.
Cause vs Goal
GOAP
GOAP
GOAP: Example
GOAP: Example
1. GetAxe<2>  ChopLog<4>  MakeCampfire<1> = 7
2. CollectBranches<8>  MakeCampfire<1> = 9
3. GetAxe<2>  CollectBranches<8>  MakeCampfire<1> = 11
Thank you!
Questions?
Ivan Dolgushin
ivand@appturn.com

More Related Content

Similar to Approaches to game AI overview

Dev and Ops Collaboration and Awareness at Etsy and Flickr
Dev and Ops Collaboration and Awareness at Etsy and FlickrDev and Ops Collaboration and Awareness at Etsy and Flickr
Dev and Ops Collaboration and Awareness at Etsy and FlickrJohn Allspaw
 
Kaseya Connect 2013: Automatic Remediation & Superfluous Ticket Elimination
Kaseya Connect 2013: Automatic Remediation & Superfluous Ticket EliminationKaseya Connect 2013: Automatic Remediation & Superfluous Ticket Elimination
Kaseya Connect 2013: Automatic Remediation & Superfluous Ticket EliminationKaseya
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentReto Meier
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationNick Pruehs
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Torontodmethvin
 
Operationalizing Clojure Confidently
Operationalizing Clojure ConfidentlyOperationalizing Clojure Confidently
Operationalizing Clojure ConfidentlyPrasanna Gautam
 
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...Al-Mamun Sarkar
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Lviv Startup Club
 
JavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for EveryoneJavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for EveryoneDerek Featherstone
 
User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖Maxis Kao
 
TDC 2015 SP - O ciclo de vida de aplicações UWP
TDC 2015 SP - O ciclo de vida de aplicações UWP TDC 2015 SP - O ciclo de vida de aplicações UWP
TDC 2015 SP - O ciclo de vida de aplicações UWP Vitor Meriat
 
Look Up Mobile Javascript
Look Up Mobile JavascriptLook Up Mobile Javascript
Look Up Mobile JavascriptDron Rathore
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScriptRaymond Camden
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileChris Toohey
 
Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...
Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...
Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...DevGAMM Conference
 
Troubleshooting Plone
Troubleshooting PloneTroubleshooting Plone
Troubleshooting PloneRicado Alves
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidStanojko Markovik
 

Similar to Approaches to game AI overview (20)

Dev and Ops Collaboration and Awareness at Etsy and Flickr
Dev and Ops Collaboration and Awareness at Etsy and FlickrDev and Ops Collaboration and Awareness at Etsy and Flickr
Dev and Ops Collaboration and Awareness at Etsy and Flickr
 
Kaseya Connect 2013: Automatic Remediation & Superfluous Ticket Elimination
Kaseya Connect 2013: Automatic Remediation & Superfluous Ticket EliminationKaseya Connect 2013: Automatic Remediation & Superfluous Ticket Elimination
Kaseya Connect 2013: Automatic Remediation & Superfluous Ticket Elimination
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android Development
 
Introduction to threat_modeling
Introduction to threat_modelingIntroduction to threat_modeling
Introduction to threat_modeling
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Toronto
 
Operationalizing Clojure Confidently
Operationalizing Clojure ConfidentlyOperationalizing Clojure Confidently
Operationalizing Clojure Confidently
 
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
 
JavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for EveryoneJavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for Everyone
 
User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖
 
TDC 2015 SP - O ciclo de vida de aplicações UWP
TDC 2015 SP - O ciclo de vida de aplicações UWP TDC 2015 SP - O ciclo de vida de aplicações UWP
TDC 2015 SP - O ciclo de vida de aplicações UWP
 
Look Up Mobile Javascript
Look Up Mobile JavascriptLook Up Mobile Javascript
Look Up Mobile Javascript
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for Mobile
 
Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...
Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...
Leszek Szczepański (Guerrilla Games) - Creating quests in the open world of H...
 
YUI 3
YUI 3YUI 3
YUI 3
 
Troubleshooting Plone
Troubleshooting PloneTroubleshooting Plone
Troubleshooting Plone
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 

Recently uploaded

Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfOrtus Solutions, Corp
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandIES VE
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...Alluxio, Inc.
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareinfo611746
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockSkilrock Technologies
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownloadvrstrong314
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILNatan Silnitsky
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEJelle | Nordend
 

Recently uploaded (20)

Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 

Approaches to game AI overview

  • 1. Approaches to game AI Ivan Dolgushin Game developer at Appturn
  • 2. Artificial Intelligence Artificial intelligence (AI) is the intelligence exhibited by machines or software.
  • 3. Intelligent Agent • simple reflex agents • model-based reflex agents • goal-based agents • utility-based agents • learning agents
  • 4. Why should we bother? • philosophy: understanding the nature of thought and the nature of intelligence and building software to model how thinking might work; • psychology: understanding the mechanics of the human brain and mental processes; • engineering: building algorithms to perform human-like tasks;
  • 5. Duck-testing game AI If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.
  • 6. Simple vs Complex • Simple things can look good. • Complex things can look bad.
  • 7. Not Too Hard, Not Too Easy
  • 8. Not Too Hard, Not Too Soft
  • 9. What do we need it for? • Steering • Pathfinding • Decision making • Learning • Predicting actions • Group AI and coordinated actions • Sensory input
  • 12. NN: Summary Pros: • mass parallelism; • distributed representation of information and computation; • ability to learn and generalize; • adaptability; • process information in the context; • tolerant to errors. Cons: • hard to teach; • hard to test; • hard to interpret data. Summary: think twice before adopting in your project
  • 14. FSM: State Polling vs Event
  • 15. FSM: State Polling vs Event
  • 16. FSM: To Stack Or Not To Stack
  • 17. FSM: Example Stack-less event-based FSM example: <stateMachine> <states> <state class="move" id="moveAfterStampede" animation="move" speed="1.6" walkTime="2.33"/> <state class="dead" id="dead"/> <state class="getout" id="getout" initial="initial" animation="getout"/> ... <state class="wait" id="rot" animation="rot" delay="3"/> <state class="wait" id="disappear" animation="disappear"/> </states> <events> <state id="disappear"> <event name="animationEnd"><state id="dead"/></event> </state> <state id="rot"> <event name="waitEnd"><state id="disappear"/></event> <event name="wait"><state id="waitForRevive"/></event> </state> <state id="die"> <event name="animationEnd"><state id="rot"/></event> </state> <state id="getout"> <event name="animationEnd"><state id="stampede"/></event> <event name="hit"><state id="stampedeHit"/></event> </state> ... </events> </stateMachine>
  • 18. FSM: Summary Pros: • easy to understand; • flexibly parameterized; • allow wide variety of abstraction levels; • easy to interpret; • easy to test; • has a lot of well described modifications. Cons: • large FSM can be hard to comprehend; • hard to maintain large FSMs; • don’t learn; • has no memory; • trivial state switching triggers logic; • may force some redundancy. Summary: nice universal option for most small-to-mid projects. Good starting point if you have few well defined behaviors.
  • 22. DT: Linearization If no HP left Then monster is dead Else If player is in melee radius and monster can use a ‘Hammer’ skill Then monster uses ‘Hammer’ Else If player is close Then monster flees (move) from a player Else If player is in aggro-radius and monster can use a ‘Summon’ skill Then monster uses ‘Summon’ Else If player is in shooting radius Then monster shoots Else If player is in aggro-radius Then monster chases them (move) Else Monster wanders (move) around the room
  • 23. DT: Summary Pros: • easy to understand; • easy to interpret, especially in linearized form; • easy to reuse subtrees; • easy to add learning • easy to understand learnt knowledge. Cons: • don’t learn; • has no memory; • depends on world state, not on events in the world; • may force some redundancy. Summary: good for turn-based games and other games with atomic (instant) actions and a lot of factors with the few significant values each.
  • 25. BT: Flow Control Selector (any) Sequence (all) Result: • Success • Failure • Running
  • 26. BT: If-Else Result: • Success • Failure • Running
  • 28. BT: Example <all> <!-- Attacking block --> <isPlayerInRoom/> <isPlayerInAggroRadius/> <callForBackup/> <any> <!-- Using skills block --> <any> <all> <select target="Player"/> <use skill="Advanced"/> </all> <all> <select target="Player"/> <use skill="Basic"/> </all> </any> <go to="Player"/> </any> </all>
  • 29. BT: Summary Pros • very flexible and extensible; • easy to interpret after some practice; • extends strengths of DTs with some FSM features; • allows to work on different abstraction/detail levels; • high modularity; • easy to reuse subtrees. Cons • require certain mindset to comprehend; • explicit flow control configuration may sometimes look redundant; • don’t learn; • has no memory; • depends on world state, not on events in the world; Summary: great technique for all variety of project sizes and complexities, if you are willing to learn thinking in BT- way.
  • 31. GOAP
  • 32. GOAP
  • 34. GOAP: Example 1. GetAxe<2>  ChopLog<4>  MakeCampfire<1> = 7 2. CollectBranches<8>  MakeCampfire<1> = 9 3. GetAxe<2>  CollectBranches<8>  MakeCampfire<1> = 11

Editor's Notes

  1. 01:30 Искусственный интеллект (ИИ) - это интеллект, демонстрируемый механизмами или ПО
  2. 2:30 Интеллектуальные агенты (ИА) - сущности, получающие информацию через систему сенсоров о состоянии управляемых ими процессов и осуществляющие влияние на них через систему актуаторов, при этом их реакция рациональна в том смысле, что их действия содействуют достижению определенных параметров. Рациональный агент (англ. rational agent) — это агент, действующий оптимальным для достижения наилучшего ожидаемого результата образом. Рациональным агентом может быть любое действующие лицо принимающее решения. Как правило, это любое живое существо, включая человека, группа людей, организация, робот или программа. Всех агентов можно разделить на пять групп по типу обработки воспринимаемой информации: Агенты с простым поведением. Агенты с поведением, основанным на модели. Целенаправленные агенты. Практичные агенты. Обучающиеся агенты. Агенты с простым поведением действуют на основе текущих знаний по схеме условие-действие. Они должны иметь возможность наблюдать все условия и не обладают памятью. Агенты с поведением, основанным на модели, могут оперировать с частично наблюдаемой средой. Агент содержит модель, представляющую его “картину мира”, на основании которой он может принимать решения, даже не наблюдая какой-то части реального мира. Целенаправленные агенты, помимо прочего, хранят информацию о тех ситуациях, которые для них желательны. Это дает агенту способ выбрать среди многих путей тот, что приведет к нужной цели. Практичные агенты обладают так же “функцией полезности”, позволяющей им определить насколько та или иная ситуация для них предпочтительна. Обучающиеся агенты отличаются от всех предыдущих типов способностью обучаться и развиваться в процессе взаимодействия с окружающей средой.
  3. 03:15
  4. 04:00 Окно восприятия
  5. 05:30 Слишком сожный ИИ в неподходящей ситуации в лучшем случае сожрет у вас кучу времени на разработку и ни один пользователь не заметит офигенно крутой мимики болельщиков в вашем футбольном симуляторе. А в худшем случае это будет выглядеть тупо. С другой стороны, простые, основанные, например, на случайных значениях, алгоритмы уже могут давать весьма неплохо выглядящие результаты.
  6. 06:10
  7. 07:30
  8. 07:50
  9. 08:30
  10. 13:30
  11. 14:15
  12. 14:45 State polling
  13. 15:15 Events
  14. 16:15
  15. 17:30
  16. 21:30
  17. 23:00
  18. 23:30
  19. 28:30
  20. 31:30
  21. 32:00
  22. 34:00
  23. 38:45