O'Reilly logo

Learning Game AI Programming with Lua by David Young

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 evaluators

Creating evaluators relies on simple functions that perform isolated operations on the agent's userData table. Typically, most evaluators will only perform calculations based on userData instead of modifying the data itself, although there is no limitation on doing this. As the same evaluator might appear within a decision structure, care must be taken to create consistent decision choices.

Tip

Evaluators that modify userData can easily become a source of bugs; try to avoid this if at all possible. Actions should modify the agent's state, when evaluators begin to modify the agent's state as a decision structure is processed; it becomes very difficult to tell how and why any eventual action was chosen, as the order of operations ...

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