Newsgroups: comp.graphics.algorithms,comp.graphics.animation,comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!news.duq.edu!newsgate.duke.edu!news.mathworks.com!www.nntp.primenet.com!nntp.primenet.com!ddsw1!news.mcs.net!in-news.erinet.com!bug.rahul.net!rahul.net!a2i!ns2.mainstreet.net!ns1.aplatform.com!pagesat.net!NEWS1!not-for-mail
From: "Sean L. Palmer" <sean@delta.com>
Subject: Re: Intellectual character "driving" along the curved paths
Message-ID: <326B1461.3921@delta.com>
Date: Mon, 21 Oct 1996 02:12:49 -0400
References: <ABVDQQoCV5@creatgraphics.spb.su>
X-Mailer: Mozilla 3.0Gold (Win95; I)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 61
Xref: glinda.oz.cs.cmu.edu comp.graphics.algorithms:39058 comp.graphics.animation:40795 comp.ai.games:6626

Andrew Iones wrote:
> 
> Hi, everybody!
> 
> Do you know if somebody ever tried to tackle the problem of real-time
> "driving" a (biped) character along a curved path?
> 
> GIVEN a spline path and speed along it
> DRIVE a 2 leg character along it, i.e. calculate character footplacements
>       on each step and define the steps themselves. Initially your character
>       stands somewhere in the beginning of your path. The problem is that
>       spline can have high curvature and, perhaps, the terrain can be
>       irregular.
> 
> Pay attention, that this problem is much more difficult then, say, driving
> a boat along a path as the boat does not have legs that complicate a lot
> the solution. It seems that some "intelligentness" is required so that
> the character would move in a natural way.
> 
> Any references/ideas/related works are appreciated.

The problem with splines is it's very difficult to compute actual
distance along the curved path.  Splines can be loops, can vary really
wildly.  The T index to a spline won't necessarily correspond to
distance traveled OR speed of the character...  Best thing I can suggest
is to use the position on the spline as a 'destination' for the
character, and use some other kind of linear movement to actually get
him to walk. Upon reaching each 'position' along the curve, it would
find a new spot farther along the curve to head for, involving only
slight bearing change..  similar to the problem of drawing a spline
using line segments, but making sure the line segments are of a size
proportional to the character's speed.

I toyed with using splines for actual movement (position) and for
velocity and it doesn't work well at all.  This was with spaceships
though. The only difference is that a person has to put his feet down at
certain intervals based on their speed. Otherwise the feet shouldn't
matter too much in a game.

I guess if you had some kind of convertor that converted the splines
into simpler kinds of curves it would work better. Convert them into
3-point quadratic splines with the center control point approx. midway
along the curve between the other two knots and, preferrably, on the
curve itself.  Those are pretty easy to deal with, step distance is
pretty constant, and the basis matrix is simple so you can do any
required math alot easier.  

Or hell just convert them into a series of 'target' points, and then
forget about the spline and use a simple checkpoint-type system.  And
use a simpler 'head straight for the next point' type scheme.   You'll
want to adjust the speed based on whether this is the last point in the
series or not, so they stop at the end of the path.  Maybe slow down if
they have to turn sharply..

The problem is really similar to a heuristic for a heat-seeking missile.

This is assuming that you have the animation for the character walking
or running already and you just want to know how to get the guy to
follow the spline.  When to put each leg down has to be heuristically
determined based on his speed. Where to put it down would be based on
position and the way your animation model looks.

