Decision Making Concepts:
Decision Trees:
Decision trees are
evaluated from root to leaf, every time. For a decision tree to work properly,
the child nodes of each parent must represent all possible decisions for that
node. If a node can be answered "Yes”, “No” and “Maybe", there must be
three children, Yes node, No node and Maybe node. This means there's always
some lower node to traverse, until reaching an end node. (Gallear, Decision Making Concepts, 2018)
Decision Trees are
extremely helpful in the way that they work and are often found in games where
decisions are rather basic, as adding too many decisions may result in an AI
having problems if in large groups. Additionally, Decision Trees help by making
AI feel more real by allowing them to make choices similar to what a player
would make. For example; Can it see the player? If yes, then it can give chase
or attack. If no, then it can continue on its patrol route. And if maybe it may
go into an alert state and checkout what the disturbance was.
State Machines:
A finite-state machine
is a model used to represent and control execution flow. It is perfect for
implementing AI in games, producing great results without a complex code. Only
a single state can be active at the same time, so the machine must transition
from one state to another in order to perform different actions. FSMs are
commonly used to organize and represent an execution flow, which is useful to
implement AI in games. The "brain" of an enemy, for instance, can be
implemented using an FSM: every state represents an action, such as attack or
evade, or even block if capable. (Bevilacqua, 2018)
From the above
Bevilacqua's FSM you can see the fundamentals of how the algorithm works, this
is the state machine for an AI character. Now the state machine can work in
relation to a health bar, for example if the health bar gets below 60% for the
AI then the AI would decide to hide or take cover to reduce the risk of taking
more damage and reducing health. When the health bar drops again below a
certain point, the AI would choose to run from the scene and works similarly
with the Fuzzy Logic algorithm whose state membership has a float range and not
made up of 0 and 1's.
Fuzzy Logic:
Fuzzy
Logic is a logic operations method based on many-valued logic rather than
binary logic (two-valued logic). Two-valued logic often considers 0 to be false
and 1 to be true. However, Fuzzy Logic deals with truth values between 0 and 1,
and these values are considered as intensity (degrees) of truth. Fuzzy Logic
may be applied to many fields, including control systems, neural networks and
artificial intelligence (AI). (Techopedia, 2018)
In
terms of gameplay, Fuzzy Logic is used as a platform to make decisions to
determine an AIs state to give states to an AI. Usually in older games there
would be only two states: Alive and Dead. For example, in Donkey Kong (1981)
Jumpman (aka, Mario) would alive until they bumped into an AI, and at that
point it would be all over, and they were dead. As mentioned above, this
application of fuzzy logic is expanding this linear system by introducing new
waypoints between 0 and 1.
In
games like Elder Scrolls: Skyrim, Enemy AI will start out as aggressive when
their health bars are full or near full. Upon reaching a certain percentage of
health they will start to flee and stay away from the Player until they’ve
recovered enough health. These are states determined by fuzzy logic which, when
the AI drop below a certain percentage of their maximum health, tells them that
they are in some sort of unhealthy state, and must retreat.


No comments:
Post a Comment