Game Development Reference
In-Depth Information
The AI project for this topic can be found in the topic's companion
files (code bundle) in the ai folder of this chapter.
In creating this project, we'll apply nearly all the concepts and ideas seen so far in an
isolated and pure form, looking at how they come together in the project, alongside
a unique range of AI concepts, such as Finite State Machines ( FSMs ), navigation
meshes, line of sight, and more. To follow this chapter and get the most from it,
I recommend that you create a new and blank Unity project and take each step from
start to finish. The final, completed project arrived at by the end of this chapter can
be found in the topic's companion iles (code bundle) in the ai folder of this chapter.
Artificial Intelligence in games
The concept of intelligence can be understood in many senses: psychological,
scientific, philosophical, spiritual, sociological, and others. Many of them are
profound. However, in video games, it's primarily about appearances, namely,
the appearance of intelligence. Perhaps, this is why the word "artiicial" enters the
title. The idea is that video games are primarily about having fun and interesting
experiences. This means that the believability of a game for the gamer rests on how
engaged they are with the events actually happening in the game. Thus, whenever
a non-player character ( NPC ), such as an enemy wizard in an RPG, does something
"silly" (like walking through solid walls for no good reason or aimlessly walking
back and forth as though stuck), then the gamer perceives that something is wrong.
They regard the characters as not acting intelligently just because the character's
behavior, in those specific circumstances, is not appropriate and cannot be explained
reasonably with reference to anything else happening in the game. The "mistake" or
"silliness" of the character's behavior forces the player to recognize a glitch, and in
doing so, the gamer is removed from the experience, becoming aware that it's just a
game. The upshot of this is that for games, AI largely consists of making characters
respond appropriately to their situation whenever the gamer is looking. In games
where AI is for enemies or opponents, this consists largely of tweaking difficulty, that
is, not making the AI too easy or too hard. Seen in this way, AI is not about building
a mathematical model of the human mind and consciousness that simulates what
happens to us while thinking from an inward or internal perspective. It's only about
creating behaviors, making characters act as we'd expect them to under those specific
conditions, as shown in the following screenshot. Consequently, there's something
"hollow" about AI for games, but this philosophical observation need not concern us
here any further.
 
Search WWH ::




Custom Search