User:Anaminus/AIConcept

From Legacy Roblox Wiki
Jump to navigationJump to search

1 make path...
   1 make vector (target - bot)
   2 add path (current position - nearest collision or target)
   3 if collision = object then
      1 add path (current position x + 1/3 - current position)
      2 add path (current position x - 1/3 - current position)
   4 if collision = path or edge then
      stop
   5 repeat until target
2 get shortest path
3 correct path...
   lerp(path end - current path)...
    1 make vector (path end - current path)
    2 if no collisions then add path (current path lerp - current path) current path = current path lerp
4 feather path...
   lerp(path end - path start)...
    1 make vector (current path - nearest collision)
    2 if magnitude < bot width/2 then current path = current path + normal (nearest collision - current path)
5 correct path
6 follow path until target
Vector intersect function
 return intersections {object,line segment} in order.