Steering Behavior For autonomous characters

Advanced game related topics
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Steering Behavior For autonomous characters

Post by Guimauve »

Hello everyone,

By searching on how to program the movements of intelligent autonomous characters, I came across the following sites:

http://www.red3d.com/cwr/steer/
http://opensteer.sourceforge.net/

I hope these links may be helpful for game developer.

Best regards.
Guimauve
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Re: Steering Behavior For autonomous characters

Post by void »

I've actually been making use of these resources for a bit myself, and found them very helpful. I've managed to implement time-based (instead of game tick based) versions of seek + arrive, and separation so far in PureBasic.

I also found this site somewhat helpful in understanding some of the implementation details:
http://www.shiffman.net/teaching/nature/steering/
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Steering Behavior For autonomous characters

Post by Zach »

What is your opinion on the Pros/Cons of each method? (Time vs Game Tick) I thought Game ticks were based on a high-resolution system clock anyway?
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: Steering Behavior For autonomous characters

Post by Guimauve »

Hello,

A simulation based only on game ticks can slowdown or accelerate depending on the CPU load. A time based can be corrected more easily in the case of your control loop time change during the game play. (More collisions to manage, more time needed for special effects calculation, another program running in background, etc.)

This why a time based is more efficient and give more correction possibility. For example, if you use a Catmull-Rom spline to calculate the position and trajectory tangent vector, if the time vary you just need to calculate the new spline parameter (generally named u or t parameter) according to the Elapsed time between frame to precisely calculate the right position and tangent vector.

This my point of view on this topic.

Best regards.
Guimauve
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Re: Steering Behavior For autonomous characters

Post by void »

Pretty much what Guimauve said. It's more robust and gives more consistent results along a wide variety of system configurations and game settings (if you provide them).

In my case, I'm working with nearing a thousand boids with my current prototype, and without time-based physics updates, the simulation would slow to a crawl on my current build on my development machine. The simulation precision lowers somewhat in that circumstance, but it's still fundamentally 'playable' (inasmuch as my prototype can be 'played').
Post Reply