Polarith AI

◆ Evaluate()

void Evaluate ( )

In most cases, this method must not be manually called at all because the system does that automatically.

But if you want to achieve a deterministic AI approach and you derived from AIMContextEvaluation to disable automatic AI updates, then you need to manually call this method by all means to get the AI working. For achieving true determinism, you need to make sure that the whole world which can be perceived by the AI is deterministic as well. This can be done by, for example, perceiving the AI world with AIMSteeringPerceiver.Awake (for initialization) followed by calls to AIMPerceiver<T>.Update within the main loop in synchronization with a lock-step or deterministic client-side system. Then, this method needs to be called in synchronization with the same lock-step or deterministic client-side system as well for achieving deterministic AI updates.

Note that behaviours utilizing Unity's pathfinding like AIMUnityPathfinding in combination with AIMFollowWaypoints can never be guaranteed to be deterministic due to its very nature, as against our pure steering algorithms are. If you want deterministic client-side pathfinding, you need to find or implement a custom solution, but you can easily make it compatible to AIMFollowWaypoints by inheriting from AIMPathConnector.

This method calls PrepareEvaluation, Context.Evaluate, ObtainEvaluatedResults and UpdateIndicator right one after another.