Wander:
Filter:
GameLoop/Classes (extension) | Class

Wander
ExtensionExtension

Implementation of the wander steering behaviour

Description

Designed to produce a steering force that will give the impression of a random walk through the agent’s environment. You will either need to read the implementation1 or experiment with it to get a sense of what the values are doing. I suggest both!

Click here for a java applet demonstration (will not play in the IDE help browser).

Class Methods

.new

Arguments:

entity

the entity on which the steering force will be applied

wanderRadius

the radius of the constraining circle

wanderDistance

the distance the wander circle is projected in front of the agent

wanderJitter

the maximum amount of random displacement that can be added to the target each second

Instance Methods

.value

Get the calculated force. To be used in the .force_ method of the entity. This is how the steering forces are applied.

[1] - If you are interested to know about these methods (or even better would like to implement them) a useful resource can be found in the book 'Programming Game AI by Example' by Matt Buckland.