algorithm - Avoid stepping in Lava Circles -


i trying figure out how write ai avoidance algorithm game not step on lava areas. safe distance center of lava object static 25 range. if 1 lava object calculate distance between player , object, calculate angle , move backwards x range until 25 range away.

but because there can more 1 lava object each 25 range safe radius. 3 need taken consideration otherwise might move away 1 , step onto another.

any appreciated.

1

if 1 lava object calculate distance between player , object, calculate angle , move backwards x range until 25 range away.

that's right idea, have scale it. create vector each lava circle. angle should represent "away" circle, , magnitude represents how far away is. can add these represent steering vector. it's not perfect, can tweak suit particular needs well.

that's bare basics, principle can applied kinds of steering, pursuit, avoidance, wall following, etc.

the best reference know of send steering behaviors autonomous characters craig reynolds(the creator of boids). site's pretty old, information ever.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -