O'Reilly logo

CryENGINE Game Programming with C++, C#, and Lua by Ruan Pearce-Authers, Carl-Filip Lundgren

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

Creating custom AI

The process of creating custom AI is relatively straightforward, especially if you're comfortable with the actor system introduced in the previous chapter.

There are two parts of each actor; its IActor implementation and the AI entity definition.

Registering an AI actor implementation

AI actors typically use the same IActor implementation as the player, or at least a shared derivation.

In C#

Registering an AI actor in C# is very similar to how we did it in Chapter 5, Creating Custom Actors. Essentially, all we have to do is derive from CryEngine.AIActor instead of CryEngine.Actor.

The AIActor class derives directly from Actor, and therefore does not sacrifice any of its callbacks and members. However, it has to be explicitly implemented ...

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