Flylib.com

Books Software

 
 
 

Practical Demo

Summary

There are different levels of understanding of the problem: informal, theoretical, statistical, and analytical. These provide a good combination of experience:

  • The description of the task provides an indication of the complexity.

  • By multiplying the size of the problem parameters together, we obtain the total number of configurations in the domain.

  • Gathering arbitrary data about the problem enables us to establish usage of values and configurations.

  • Some parameters depend on each other; this can usually be identified in pairs using covariance.

  • More complex relationships between variables need to be established analytically.

This understanding enables us to manipulate the problem in two ways:

  • Refining the problem into a simpler one that can be handled by standard technique

  • Splitting the problem into manageable subproblems that can be divided recursively

The AI engineer plays a crucial role in acquiring this understanding and applying it:

  • Expert features can be ranked by priority, and they can be added or removed as necessary.

  • Experimentation reveals the importance of features.

  • Statistical metrics also provide essential hints to the quality of inputs.

This chapter discussed knowledge of the problem in conceptual terms. More than half a dozen problems have already been solved using most of these concepts. These ideas will also enlighten the design of remaining prototypes . The methodology for solving complex problems will become more obvious with further practice.

Practical Demo

You can download an animat from http://AiGameDev.com/ that facilitates data collection and analysis. Lumberjack logs everything: most details from the senses and each action executed. The log file can be processed by standard packages or custom scripts when necessary. Lumberjack provides a good framework for putting the ideas in this chapter into practice.


Part III. Conclusion

This part had everything to keep a modern AI game developer happy: rockets , neural networks, and many different prototypes . We also discussed a very important aspect of the application phase: how to understand the problem and manipulate it so that we can solve it easily.

Retrospective Overview

With a bit more distance, let's go over the various behaviors and techniques to extract key lessons.

Behaviors

This part showed us how to split a problem into manageable parts . We were then able to implement each of the solutions separately.

The prediction of enemy movement is very efficient -in both computation and quality. However, the physics-based approach is fundamentally limited to linear trajectories; this can be error prone for large distances. Improving upon this requires getting into the mind of the enemies and simulating their movement, which requires different assumptions. The linear guess is the best compromise of quality/cost, without going into the full probabilistic analysis!

There were few problems applying the standard perceptrons to aiming. However, the problems were simple and the results were predictable. Although learning that task with a perceptron was somewhat unnecessary, it remains a good example to demonstrate online learning. It also provides a unique way of learning to cope with complex errors; in this case, an analytical approach would have been more difficult.

The target-selection behavior provided a great example of applying a neural network. The learning component itself is not particularly effective, reaching 25 percent error in many cases. However, the behaviors are realistic and the system benefits from the experience of the perceptron (thanks to the quality of the design). This reveals the kind of problem to which neural networks should be applied: ones that don't require too much precision and where the learning can only improve the model. In this case, the generation mechanism allowed realistic results regardless of the neural network's performance.

Techniques

The first technique used was based on physics. Although other solutions with predictive capabilities could be used, the hard-coded approach turned out to be the base of the other tasks . To reiterate, it's fine to use "standard" programming to solve problems when necessary. After all, a significant proportion of the system is always customized anyway. Trying to apply modern AI techniques to each problem will slow progress.

Another technique we used was neural networks. Whenever possible, we should try to use the single-layer perceptron. They are limited, but they have far fewer issues. (For instance, they are easy to understand and always provide the best approximation .)

Multilayer perceptrons are very good at solving problems, as long as they are applied correctly. Data preparation, feature selection, and topological choices are all parameters that the AI engineer has control of, so these neural networks can be applied to anything. However, this level of control leaves room for the solution to go wrong, and it can be hard to find problems in game AI that actually need multilayer perceptrons.