This document discusses various approaches to game AI, including intelligent agents, neural networks, finite state machines, decision trees, behavior trees, and the goal-oriented action planning technique. For each approach, it provides pros and cons as well as examples. The techniques range from simple reflex agents to more complex learning agents. The document advocates considering the specific needs of a game before choosing an AI technique and provides guidance on when different approaches may be suitable.
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.
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
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.
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.
01:30
Искусственный интеллект (ИИ) - это интеллект, демонстрируемый механизмами или ПО
2:30
Интеллектуальные агенты (ИА) - сущности, получающие информацию через систему сенсоров о состоянии управляемых ими процессов и осуществляющие влияние на них через систему актуаторов, при этом их реакция рациональна в том смысле, что их действия содействуют достижению определенных параметров.
Рациональный агент (англ. rational agent) — это агент, действующий оптимальным для достижения наилучшего ожидаемого результата образом. Рациональным агентом может быть любое действующие лицо принимающее решения. Как правило, это любое живое существо, включая человека, группа людей, организация, робот или программа.
Всех агентов можно разделить на пять групп по типу обработки воспринимаемой информации:
Агенты с простым поведением.
Агенты с поведением, основанным на модели.
Целенаправленные агенты.
Практичные агенты.
Обучающиеся агенты.
Агенты с простым поведением действуют на основе текущих знаний по схеме условие-действие. Они должны иметь возможность наблюдать все условия и не обладают памятью.
Агенты с поведением, основанным на модели, могут оперировать с частично наблюдаемой средой. Агент содержит модель, представляющую его “картину мира”, на основании которой он может принимать решения, даже не наблюдая какой-то части реального мира.
Целенаправленные агенты, помимо прочего, хранят информацию о тех ситуациях, которые для них желательны. Это дает агенту способ выбрать среди многих путей тот, что приведет к нужной цели.
Практичные агенты обладают так же “функцией полезности”, позволяющей им определить насколько та или иная ситуация для них предпочтительна.
Обучающиеся агенты отличаются от всех предыдущих типов способностью обучаться и развиваться в процессе взаимодействия с окружающей средой.
03:15
04:00
Окно восприятия
05:30
Слишком сожный ИИ в неподходящей ситуации в лучшем случае сожрет у вас кучу времени на разработку и ни один пользователь не заметит офигенно крутой мимики болельщиков в вашем футбольном симуляторе. А в худшем случае это будет выглядеть тупо. С другой стороны, простые, основанные, например, на случайных значениях, алгоритмы уже могут давать весьма неплохо выглядящие результаты.