Game Development Reference
Having a reasonable definition of what game AI is, it is worth considering what
game AI is not. AI is not physics. The code that decides whether a virtual rock on
the edge of a cliff should stay on the cliff or fall off the cliff is not AI. The rock has
no free choice in the matter and no options to pick from, no matter how smart it
is. Forces of a certain magnitude always push the rock off the cliff, and forces
below that level cannot. The rock is not free to make a sub-optimal choice in
the short term that better suits its long-term goals. The code may resemble AI—
the rock evaluated changing conditions and the decision was made to fall off the
cliff—but it had no choice in the matter.
AI need not always be complex. While there is a need for complex AI methods, a
large amount can be accomplished with simple methods. These simple methods
are still AI, despite a feeling in academia and industry that, ''stuff we know how to
do isn't really AI and stuff we can't do yet is real AI.'' This topic has many basic
techniques for game AI. All of them, even the simplest, are in widespread use by
professional game developers.
The rest of this chapter deals with where to find Visual Basic and using Visual Basic
to create your first project. If you have experience programming with Visual Basic
.NET, you may be able to skip ahead to Chapter 2, ''Simple Hard-Coded AI.'' If
you are an experienced programmer who is new to Visual Basic, you should be able
to fly through the rest of this chapter. The projects and material in the rest of the
book will be far less elementary than this introductory project.
The projects in this topic were written in Visual Basic .NET using Microsoft
Visual Basic 2008. VB.NET, like VB before it, is easy to learn and write, and yet
quite powerful. With the advent of VB.NET in 2001, VB no longer carries an
inherent performance penalty compared to other languages. You will need to
install VB to use the software on the CD that is included with this topic. Once you
have installed it, you'll bring up the development environment and proceed
through the walk-through example in this chapter.
There is extensive support for VB on the Internet. Many questions can be answered with a few
careful Internet searches; you will usually need to include VB and .NET as keywords. The Microsoft
Developer Network (MSDN) library is another valuable resource for Windows developers. It can be