# seek and avoid jitter problem

This topic is 3620 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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?

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
Quote:
 Original post by Kylotanand 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.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
5. 5
A4L
11

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633768
• Total Posts
3013741
×