Understanding Seek Steering Behavior in Autonomous Characters

Click For Summary
SUMMARY

The discussion focuses on the physics equations related to Steering Behaviors for Autonomous Characters, specifically the Seek behavior as outlined in "Programming Game AI by Example" by Mat Buckland. The Seek function calculates the SteeringForce by subtracting the current velocity from the desired velocity, which is derived from the target position and the vehicle's maximum speed. The confusion arises from understanding how this subtraction results in a force, which is clarified by noting that the difference in velocities can be treated as a force or acceleration in the context of game physics, with the potential need for scaling to achieve realistic behavior.

PREREQUISITES
  • Understanding of vector mathematics and operations
  • Familiarity with game physics concepts
  • Knowledge of steering behaviors in AI programming
  • Basic programming skills, particularly in pseudocode
NEXT STEPS
  • Study the implementation of Steering Behaviors in Unity using C#
  • Explore the concept of vector normalization in game physics
  • Learn about the role of mass and acceleration in force calculations
  • Investigate advanced steering behaviors such as Flee and Arrive
USEFUL FOR

Game developers, AI programmers, and students studying game design who are interested in implementing realistic movement and steering behaviors in autonomous characters.

Metro_Mystery
Messages
9
Reaction score
0

Homework Statement



I'm having trouble understanding the physics equations related to Steering Behaviors For Autonomous Characters (present in the book "Programming Game AI by example").

For those that don't know- Seek is a kind of behavior whereby an object with a given mass, current position & velocity attemps to seek to a target position.

Homework Equations



In the book, Mat Buckland calculates Seek like so (in Pseudocode)

def Seek()
DesiredVelocity = Normalize(TargetPos - VehiclePos) * VehicleMaxSpeed
SteeringForce = DesiredVelocity - VehicleVelocity
return SteeringForce

The Attempt at a Solution



Seek is stated, in the book- to return a steering force, which is "the force required, when added to the agents current velocity vector, gives the desired velocity.

How does the subtraction of two velocity vectors suddenly become a force?

My heads in a spin- any help is greatly appreciated!
 
Physics news on Phys.org
If you subtract the two velocity vectors, then you get a vector which points in direction you want the force to point. Formally, you would need to multiply by something (a constant, possibly) that has dimensions of mass over time to get a force. But the computer doesn't care about actual units, and the constant might as well be 1. So that's why a difference in velocities could be a force, or acceleration. A realistic implementation of that AI would probably need to have a constant to scale the SteeringForce to give good behavior, but that's something that would need to be experimented with.
 
Thanks for the great answer, I understand now.

Also- what exactly is the point of scaling the desired velocity vector to max speed? From what I can see- it will affect the direction as well as the magnitude of the output vector.
 
Last edited:

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
Replies
10
Views
5K