Should all of the agent's rays be of the same length?

Started by
21 comments, last by IADaveMark 13 years ago
I have no experiencing with this, so forgive my input if its plain silly but often an uninitiated eye can catch things right? My thought in reading the thread is that your updating every frame right? so buffer the updates, don't take immediate feedback and apply it, average it and filter it for extremes or inputs that go against the norm, then after maybe 10 or 20 frames return the smoothed out data as an input to turn. In other words clear out the erroneous data between the feeler return and the input to the actor, I would think creating a data set of returns and finding a norm would be the best way to go about it. Find the number of frames it takes to get from the end of the feeler to obstacles and use a third of those frames, more or less, to smooth out movement. You do this with your new code checking for negative input, and adjusting interpolation, but I think you should be setting up a buffer where turns are checked against multiple inputs not just the immediate turn. You could do this before or after getting the actual turn rate.

Make your actor think more before he turns.
Advertisement
I'm using a similar avoidance behavior at the moment and attributed the jerkiness to the fact that high turning speeds will lead the agent to turn away from obstacles very fast so Its path is "clear" for the next time step. In the next step it figures "ah nothing in the way" and will again turn hard to its destination etc. I guess one could solve this by not allowing instant angular velocity changes but using angular acceleration and maximum angular velocity to describe turning motion. That should automatically smooth out the jerkiness.
Another thing you can do with the 2-feeler method is to determine the angle at which the obstacle is facing toward or away from you. By doing so, you can set your new heading as parallel to the plane of the obstacle.

Additionally, one reason for using sliding scale techniques on the length of the feelers... change the turn rate based on how far away the obstacle is. The closer it is, the quicker you want to turn to the new heading. Also, if the obstacle is inside a certain time distance (not just physical distance), you can also reduce your speed. This give it a "whoa!" factor as well.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement