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.
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
Post a Comment