seek and avoid jitter problem
Hi
I'm trying to implement the seek and avoid steering behavior.
Say my agent is positioned far left - and he seeks a straight line to the far right.
a few obstacles are scattered along his path, not necessarily in a straight line.
The problem is, the way my agent moves is it bounces off obstacles. When it hits one, it'll try to steer away, and ofcourse its seek behavior is active so it will try to steer again towards the target, then bounce again, then seek again, then bounce.
What I want is a more arc like movement or at least a more sensible movement where the agent does not bounce.
Any ideas?
Thanks
ps,
it just occured to me, perhaps while its avoiding obstacle i should disable the seek state yes?
Would guys happen to know if the obstalces needs to have ample space in between them?
And that the passage should be at least maybe 1 and 1/2 bigger than the bounding sphere of the agent? or perhaps bigger?
And that the passage should be at least maybe 1 and 1/2 bigger than the bounding sphere of the agent? or perhaps bigger?
Yeah ample space would help. Also, in one game I worked on we solved a similar issue by giving each collidible object 2 collision radii - a hard collision radius and a soft collision radius. The hard collision radius is true collision. The soft collision radius is where any nearby objects would steer around. We were using a somewhat modified BOIDs algorithm.
One idea might be to use a collision prediction system to look ahead for obstacles (eg. the avoidance algorithm, if I remember correctly), and when you encounter one, pick a new point perpendicular to the obstacle to seek towards. When you get there, you're half-way past the obstacle and can revert to seeking the original destination. Perhaps you could use a stack of seek-targets for this.
Quote: Original post by Kylotan
and when you encounter one, pick a new point perpendicular to the obstacle to seek towards.
Hey guys, thanks for helping me out - this definitely fixed my problem. My unit now steers away completely from the obstacle. I'm using code from programming game ai earlier and i don't think his method works very well.
It tries to exert 2 force to each of the 2 axis - a lateral force that would move the unit "Up" and a breaking force that would move the unit "back"
I'm highlighting those because in my demo, it seems my unit always steers to one direction, if not bumping all the time in the obstacle.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement