Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!scramble.lm.com!news.math.psu.edu!chi-news.cic.net!news.cais.net!news.mathworks.com!newsfeed.internetmci.com!in1.uu.net!news.new-york.net!actcom!news
From: bruck@actcom.co.il (Uri Bruck)
Subject: Re: Interception Code
X-Nntp-Posting-Host: p14.haifa3.actcom.co.il
Message-ID: <Dss53F.D4n@actcom.co.il>
Sender: news@actcom.co.il (News)
Reply-To: bruck@actcom.co.il
Organization: ACTCOM - Internet Services in Israel
X-Newsreader: Forte Free Agent 1.0.82
References: <4onpm5$1m8@nntpa.cb.att.com> <4oqic5$9pp@murrow.corp.sgi.com>
Date: Mon, 10 Jun 1996 10:24:14 GMT
Lines: 113

Craig Reynolds <craig@studio.sgi.com> wrote:

>nak@gwe486.cb.att.com (Neil Kirby) wrote:
>> One of the standard problems given to military sims is plotting an
>> intercept course.  Before anybody yells that it's not an AI problem,
>> let me ask the question: Does your AI just point itself at moving
>> units or does it point itself to where moving units are expected to
>> wind up at?

>Mine does the latter, so I was pleased to see this topic come up.

>> For example, my jets are as fast as the Ai's jets, if they do not
>> plot the intercept, they will fall in behind me and never catch me
>> (when they could have).  OK, so it's slightly AI related...


>both a piloted jet and a guided missile have intercept BEHAVIOR, but
>only the pilot has INTELLIGENCE.

>BTW, note that the formal study of behaviors such as pursuit can be
>found in the field of control theory.

>> I have old code that computes this in a stepwise fashion...But I
>> said to myself, I know this can be solved without iteration.

>I agree, and the formulation you presented seems fine as far as it
>goes.  You don't say so, but I assume that once you have an estimate
>of the time-to-intercept you use that with the current velocity of the
>quarry to determine a target point, and then compute steering forces
>or control signals to maneuver your jet toward that point.  But as
>John Martin implied in a followup, using the current velocity is
>equivalent to assuming that the quarry will not steer, that it is
>ballistic during the prediction interval.  Again, you didn't say so,
>but I'm guessing that you recompute your time-to-intercept and
>predicted-intercept-point frequently, like once per simulation step.
>This would allow you to correct for the quarry's evasive maneuvers.

It is not necessary to calculate the time to intercept in order to
have intercept behavior.
All that is necessary is to know the viewing-angle, and how it changes
in time. The viewing angle must be constantly monitored, so off-hand I
can't say whether the method described below is less or more
computationally expensive than actually calculating the time to
intercept. 

viewing angle is the angle between the current direction of movement
and the direction where the enemy unit is observed.

Let's start with the trivial case
We have unit A spotting unit B and deciding to begin pursuit.
Unit A is currently heading in direction Da, velocity Va, unit B is
heading  in direction Db, with velocity Vb. The viewing-angle, which
the angle between Da and direction where B is observed by A is alpha.
Suppose A and B both proceed in a constnat direction, and constant
velocity, and alpha remains constant throughout the pursuit. This
means that A and B are on an intercept course. 
Reasoning:
let C be the point where the future path of A intersects with the
future path of B, if we were to draw a straigh line along that path. 
We want to show that A and B will reach point B simultaneaouly.
In order to do that we will ask the question, when A has gone half the
distance from its initial position to C, where would we find B.

If we draw AtBtC (t==time) where A0,B0 are the initial positions of A
and B, and An, Bn mark the positions at some time n, let n be half the
time it would take A to go from A0 to C, since velocity is constant in
this example, the point An would be also at the half distance point. 
If we draw a straight line at the viewing-angle alpha, which we also
assume to be constant,it would intersect B0C, at the half distance
point as well (I believe this is called a middle section of a
triangle, or something similar), since B also reaches the middle point
at the half the time, it would necessarily reach the intersection
point as the same time as A would.

So far, you may ask, how useful is something which only give results
for constant direction and velocity. It's very useful because this has
a couple of other interesting results.
If the viewing angle increases, it means that the B is going too slow
to reach the intersection point, similarly, if the viewing angle
decreases, it means that B will reach the intersection point before A.
In either case, the intersection is no longer the intercept point.
Note, that in all of the above, the intercept point itself need not be
calculated, we can rely entirely on the viewing-angle.

How can A make the proper correction so it will still on an intercept
course. Simple, make a correction opposite to the viewing angle's
correction. That is:
When the viewing-angle increases, correct to decrease it, when the
viewing angle decreases, correct to increase. 
By how much should one correct?
The correction should be proportional to the rate of change of the
viewing angle.   
You may have noticed that there is something missing here,
proportional, by what ratio? 
This depends on the pursuing unit and its navigational abilities. As
far as the constant is concerned, experiment.

Provided the target is within range of the pursuing unit, the above
method ensures the existence of an approximate interception-point. The
accuracy depends on the frequency of updates. The comptational cost
depends both on the representation, and on the internal programming
mechanism used for movement.

A further (although rather weaker ) result, is that a variation on
this method provides a way to add evasive behavior. While the pursuing
unit's goal is to lower the rate of change of the viewing angle, the
pursued unit's goal is to increase the rate of change of the viewing
angle. 
This works in three dimension as well as in two.

Uri


