Original Post
Hi guys. I''ve got this problem I''m working on and I''ll try to explain it without a diagram.
I''ve got a target creature that I want to attack and there are other creatures in my way. What I want to do is calculate a point that I can path to that gives me line of sight to my target.
Heres an idea I''m working on:
1) Create a list of all creatures inside the attack range of the target.
2) Create sectors for each creature. The pointy end of the sector is on the target''s centre point and the fat end points are tangent to the creature''s outer edges.
3) For each sector arm (on each creature), if it intersects another sector (on a different creature) eliminate it.
4) Using the list of remaining arms (vectors) create a list of open sectors. Open sectors have no creatures inside them.
5) Use the list of open sectors to find the closest point you can path to that gives you line of sight to your target.
If anyone has a faster method let me know. Mine looks like its going to be very costly.