JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

Predicting Behavior

When it comes to predicting the movement of living things, it doesn't really matter how precise the equation is, or how well the integrator performs. Indeed, creatures are not passive objects that obey rules; there is much uncertainty in the forces they can apply, so the acceleration itself can vary. As such, better integrators can be discarded, because the underlying assumptions about the acceleration will often lead to the wrong result anyway. So, we might as well keep it simple!

Unlike the physics engine, human and AI players have no insider knowledge about the state of objects. They can only make deductions by observing objects and monitoring their position (embodiment). With this approach, the velocity can be estimated only between two observations; the velocity is the change of position.

For additional precision, monitoring the change in velocity allows the AI to determine the acceleration. The entire process requires three observations at different times: first, monitor the position; second, understand velocity; and third, extract the acceleration.

Because each of these quantities (velocity, acceleration) can vary quickly from one second to the next, it can be beneficial to average them over a short period of time. This cancels out part of the noise caused by errors in the observation or unpredictable behaviors. However, the problem with averages is that they lag behind the actual value (because past values are taken into account). In games, it might be better to predict the velocity on a stopped/running basis, because these are the two most common states.

Many minor decisions about the model must be made, because many parameters can be adjusted according to observations, or to match particular requirements. These values can be chosen and tweaked during the experimentation phase, using empirical judgment to decide what works best.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor