steering behaviours: wander

16
Steering Behaviours: Wander http://samuelcartwright.com.au

Upload: sam-cartwright

Post on 26-Jun-2015

1.898 views

Category:

Technology


0 download

DESCRIPTION

In this presentation I'll show you how you can implement a simple Wander algorithm into your games to give your autonomous agents more natural movement.

TRANSCRIPT

  • 1. Steering Behaviours:Wanderhttp://samuelcartwright.com.au

2. References Programming Game AI by Example, Mat Buckland, 2005 3. Autonomous Agentsany agent that possesses some degree of autonomousmovement 4. Action Selection,Steering andLocomotion 5. Wandering 6. Random Movement 7. Wander 8. Implementation 9. Constantsvar WanderRadius// radius of the constraining circlevar WanderDistance// distance wander circle projected in front of agentvar WanderJitter// maximum random displacement added each update 10. Wander Target 11. Update Wander TargetWanderTarget += SmallRandomVector 12. Reproject Target onto Circle 13. Reproject Target onto Circle // reproject new random vector back onto unit circleNormalize(WanderTarget) // increase length of vector to same as the radius of // wander circleWanderTarget *= WanderRadius 14. Apply Wander Distance 15. Apply Wander Distance // move target into a position WanderDistance // in front of agentLocalTarget = WanderTarget + Vector2(WanderDistance, 0.0f)WorldTarget = Transform(LocalTarget, AIsTransformation)Seek(WorldTarget) 16. Thankshttp://samuelcartwright.com.au