Book Image

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
Book Image

JMonkeyEngine 3.0 Cookbook

By: Rickard Eden

Overview of this book

Table of Contents (17 chapters)
jMonkeyEngine 3.0 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the AI using cover


Having AI using cover is a huge step towards making characters seem more believable and it usually makes them more challenging as they don't die as quickly.

There are many ways to implement this functionality. In the simplest form, the AI is not aware of any cover. It's simply scripted (by a designer) to move to a predefined favorable position when they spot an enemy. A player playing the sequence for the first time can't possibly notice the difference between an AI taking the decision by itself. Hence, the task of creating a believable AI (for that situation) is accomplished.

A much more advanced way would be to use the same principles for cover, which was established in Chapter 2, Cameras and Game Controls. However, evaluating options also becomes far more complex and unpredictable. Unpredictable AI might be good from the player's perspective, but it's a nightmare from a designer's perspective.

In this recipe, we'll go for a middle ground. First of all, we will...