Advertisement

search fire of line algorithm

Started by October 28, 2007 10:46 PM
0 comments, last by Vorpy 17 years, 1 month ago
I writing an RTS AI and have some problem with searching fire of line. Unit can shoot to target if it's in shooting range and there is the fire of line without any obstacles. If unit deciedes to attack target without fire of line, he should search it. To do that I send unit to target and stop him when fire of line appears but in this way distance to target may be too close. :( Designer wants unit not getting closer than it's necessary. I can't exactly say that in some point unit can shoot to target if he is in another point, but i can do it probably. :) How to find that optimal point to send unit there.
You can do a normal graph search, but instead of the destination being a particular location, the destination is any location with a clear line of fire. The condition for the goal just needs to be changed to do a line of fire test.

This topic is closed to new replies.

Advertisement