O'Reilly logo

jMonkeyEngine 3.0 Cookbook by Rickard Edén

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling groups of AI

In this recipe, we'll kill two birds with one stone and implement both an interface for group AI management and look at weighted decision making.

In many ways, the architecture will be similar to the Decision making – Finite State Machine recipe. It's recommended to have a look at it before making this recipe. The big difference from the normal state machine is that instead of the states having definite outcomes, an AI Manager will look at the current needs, and assign units to different tasks.

This recipe will also make use of an AIControl class. This is also an extension of the AIControl that can be found in the Creating a reusable AI control class recipe.

As an example, we'll use resource gathering units in an RTS. In ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required