FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Topics & Contributions
   Simulation, Artificial Life
(Moderator: REAS)
   Steering behavior model(s)
« Previous topic | Next topic »

Pages: 1 2 
   Author  Topic: Steering behavior model(s)  (Read 2849 times)
mflux

fluxhavoc WWW
Steering behavior model(s)
« on: Nov 1st, 2003, 10:52am »

Currently I'm writing a series of short programs based on Craig Reynold's "Steerting for Autonomous Characters" http://www.red3d.com/cwr/steer/
 
(updated 11/15/03)
My demos of current steering behaviors
http://classes.design.ucla.edu/Fall03/157A/cursos/00/index_visor.php?id= 8&ejercicio_id=9&persona_id=20
 
Click the lower right hand corner icon to cycle the demos. Press "c" to toggle the vector display mode.
 
Compare my seek model to the one on Craig Reynold's site:
http://www.red3d.com/cwr/steer/SeekFlee.html
 
My seek algorith is nearly identical to what he wrote in his 1999 abstract submitted at SIGGRAPH:
http://www.red3d.com/cwr/steer/gdc99/
 
However, the seek algorithm he has on his website seems like it is demonstrating a lot more than what he wrote in his paper. There appears to be some form of breaking and distance-judging going on that I cannot figure out.
 
Notice how, when his vehicle is trying to establish alignment, the steering vector (blue) will overshoot the velocity vector and richochet back in order to maintain balance.  
 
Compare this to my seek model where the vehicle tries to steer itself within a certain time frame, and often overshoots if it starts too close or too fast.
 
 
Hopefully I can have this resolved before I move on to implement further interesting behaviors (crowd steering and obstacle negotiation).
« Last Edit: Nov 18th, 2003, 11:09pm by mflux »  
Koenie

170825270170825270koeniedesign WWW Email
Re: Steering behavior model(s)
« Reply #1 on: Nov 1st, 2003, 2:29pm »

Wow this is sweet! I'm gonna look into this too, I like the crowd steering stuff and the collision detection and stuff.
 
I think your problem may have to do with the force vectors. The vector pointing at the target is there the whole time, so the object will be accelerated all the time. This doesnt seem to be happening in your example.
 
Koenie
 

http://koeniedesign.com
REAS


WWW
Re: Steering behavior model(s)
« Reply #2 on: Nov 2nd, 2003, 6:16am »

Are you basing your code off the C++ implementation or the algorithms described in the paper?
 
mflux

fluxhavoc WWW
Re: Steering behavior model(s)
« Reply #3 on: Nov 2nd, 2003, 11:01am »

Thanks Koenie. I think the problem ISN'T that the force vector doesn't point constantly at the target. The whole thing about seek steering is that compared to gravitational pull, it doesn't produce an orbit. Gravitational pull is a vector constantly pointing towards the center of gravity, whereas steering tries to move the force vector in such a way that the vehicle is "steered" towards the target in the minimum time frame.
 
Casey: the model that I wrote is based on the paper. I have the code but I haven't disected it yet.
 
mflux

fluxhavoc WWW
Re: Steering behavior model(s)
« Reply #4 on: Nov 2nd, 2003, 10:50pm »

Here's what's next on the table (just working down the list...).
 
Pursuit seeking is where the vehicle tries to gauge the future location of a target and uses seek steering to manuever itself to that position:
 
http://www.design.ucla.edu/~mflux/p5/vehicle_pursuit/applet/
 
I've also improved upon my seek algorithm and removed a few bugs. On a side note, my seek algorithm produces "arrival" which was a completely unexpected feature. Note how the vehicle slows down as it approaches the target. This was not supposed to happen, but it does.
 
The pursuit algorithm here is a very primitive, linear prediction using only one time-step to gather information about future position. It's useful for targets with linear motion, however for things that have altering speeds and angles, this algorithm does not hold too well.
 
Compare this to Craig Reynold's pursuit algorithm at:
 
http://www.red3d.com/cwr/steer/PursueEvade.html
« Last Edit: Nov 2nd, 2003, 11:21pm by mflux »  
Elrick

4892360348923603
Re: Steering behavior model(s)
« Reply #5 on: Nov 6th, 2003, 9:02pm »

Dunno if you caught this, but I noticed on his model, it looks like the pursuer guages N timesteps ahead of the target vehicle, where N is the number of timesteps it would take the pursuer to reach the target it it's current velocity;  on other words, as the pursuer gets closer to the target, the target gets closer to the target vehicle, thus increasing the chace of a 'tag'.  I may be wrong, but this is how it appears to me.
 
flight404

WWW Email
Re: Steering behavior model(s)
« Reply #6 on: Nov 6th, 2003, 11:24pm »

Curious to see how this all works out for you.  I tried a little while ago to implement these nice algorithms but had limited success due to my lack of knowledge of vector based movement.  
 
Here is one of them colored in the REAS color scheme.
http://www.flight404.com/p5/steering3/
 
Have had better success recently after doing a bit of research but the end result exists only in flash mode.  Did a series of banners for Discover (as Barbarian Group through Goodby).  Got the collision avoidance working for the car banner at...
 
http://www.weather.com/activities/homeandgarden/holidays/?from=hogafl
 
Hit refresh until the car one comes up.
 
Have you tried the collision avoidance one yet?
 
r
 
REAS


WWW
Re: Steering behavior model(s)
« Reply #7 on: Nov 7th, 2003, 10:10am »

grrrrr
 
mflux

fluxhavoc WWW
Re: Steering behavior model(s)
« Reply #8 on: Nov 18th, 2003, 11:08pm »

Hey Flight404 that was really cool. Was that car a point mass or mass spread over an area? It looks like you have spin and breaking down, and it looks really good.
 
I have an update to the steering behavior models:
 
http://classes.design.ucla.edu/Fall03/157A/cursos/00/index_visor.php?id= 8&ejercicio_id=9&persona_id=20
 
Click the lower right hand corner icon to cycle the demos. Press "c" to toggle the vector display mode.
 
flight404

WWW Email
Re: Steering behavior model(s)
« Reply #9 on: Nov 23rd, 2003, 10:26pm »

Thanks Michael.  Here is it rebuilt in Processing.  Code is really sloppy (as is usually the case with my work) and there are probably bits in there I am not even using (like the fact that my Vehicle object is an object array).
 
http://www.flight404.com/p5/steering5/
 
With the Flash version (and this version), I am dealing with a point mass, but use a radius offset to make sure the car looks like it is taking up more space than just a point.  It is still easy to break though.  If the car moves towards two obstacles that are too close together to allow for the car's width, it tends to get a little pissed and just chooses one to run into.  I guess I should set a variable like turn="left" or turn = "right" and have it continue with that turn until there is no obstacle in the way.
 
I was having a lot of trouble with keeping the car within a sized rectangle.  It ran into many problems when it ended up in a corner but there was an obstacle present to either its left or right.  That is why the Flash banner version wraps left-right but not top-bottom.
 
But then again, it is only a banner ad, and banner ads should never reflect one's best work, right?  
 
Oh, and additionally, I tried to represent the car as something that had some suspension so I have a main anchor point (the center of the car), a couple vector-based points (front and rear axle), and each of those has an elastic point tied to it (which I use to orient the car graphic so it looks a little springy and less rigid).
 
 
aadigi


Re: Steering behavior model(s)
« Reply #10 on: Apr 5th, 2004, 4:09pm »

After discovering this thread, I was inspired to try working out some kind of steering scheme myself. This is my preliminary attempt at the "seeking" behavior: http://allwatchedover.com/p5/Autowand/
 
So far, so good, but I'd like to slow down its steering a little bit. If the next seeking target shows up behind the vehicle, it'll usually whip around, making a nearly 180 degree turn and I'd like to have it be more gradual. Also, at higher speeds, the vehcile often gets stuck doing a sort of figure-eight orbit around the target, which I think means that there is something inherently problematic with my implementation. Any suggestions? Thanks.
 
-Aaron
 
miked


Re: Steering behavior model(s)
« Reply #11 on: Apr 13th, 2004, 6:27pm »

hi aadigi,
 
For your first problem, I would consider (as you probably have) the idea of a turning radius.  If we're talking about cars here, there's a maximum effective angle the car can turn from it's direction of motion during any given time step.  I haven't looked at any of the code here, so this may have been done already, but I would start by checking the dot product between the car's normal direction (direction of motion) and the position of the target relative to the car.  This will give you an idea of the target's "angular distance" away from the car's direction.  You can use this to dampen the "force" the car feels towards the target.
 
As for the second issue, maybe scale the car's velocity slightly by it's distance from the target?  If the car slows down as it nears the target it will spiral in towards it, rather than be thrown in to orbit.
 
Hope that helps!
 
-mike
 
Markavian

Markavian+iTX WWW
Re: Steering behavior model(s)
« Reply #12 on: Apr 18th, 2004, 6:04pm »

I read through the original article at  
http://www.red3d.com/cwr/steer/gdc99/
 
And I'm impressed by mflux's work on reproducing the motion. There were other types of motion described in the article, have you considered reproducing them?
 
The other development from reading and viewing the examples is, what about combining them? I noticed on a few collision avoidance examples that the car sometimes got stuck, or at least rapidly confused by two close obstacles.
 
What about reversing the motion at this point and finding a new route.
What about setting a start / end target for a journey, rather then relying on wandering motion?
 
Just punching some ideas out.
Regards,
- Markavian
 
mflux

fluxhavoc WWW
Re: Steering behavior model(s)
« Reply #13 on: Apr 19th, 2004, 6:03pm »

I don't know how this thread got revived from the dead, but it brings tears to my eyes.
 
*cough*
 
All sarcasm aside, thank you for those suggestions Markavian. Indeed, mister Reynolds had many other forms of steering behaviors. In fact, his paper had a section explicitly stating how he thought a good model of mixing steering behaviors would work. His solution is to have the autonomous agent run a routine that determines which steering type to use, and diffuses those decisions within many time-steps. This would allow the autonomous being to exhibit a variety of characteristics, completing the "mind" part of the circuitry, and making believable, autonomous characters.
 
My goal for studying this was that I had a hard time, as a non-CS student, creating agents that could move at their own will even in two dimensional space. I wanted to study behavior, motion, and many fun topics in simulation, but the only way to do that was powering through and learning how to program autonomous characters that can move themselves.
 
Your suggestions are excellent, an I'll take them into serious consideration the next time I take a dive into the programming world again.
« Last Edit: Apr 19th, 2004, 6:06pm by mflux »  
aadigi


Re: Steering behavior model(s)
« Reply #14 on: Jun 29th, 2004, 6:36pm »

*steering thread revival*
 
what is the best approach to having your "vehicle" do braking? I'd like my vehicle to have some kind of smart-braking where it will slow down its velocity as it approaches its target, but I'm kind of stumped on how to have it slow down just the right amount so that it doesn't stop before the target or pass it. Thanks.
 
-Aaron
 
Pages: 1 2 

« Previous topic | Next topic »