Understanding Seek Steering Behavior in Autonomous Characters

AI Thread Summary
The discussion centers on understanding the Seek steering behavior in autonomous characters, particularly the physics equations involved. The Seek function calculates a desired velocity based on the target position and the vehicle's current position and velocity, returning a steering force. The confusion arises from how subtracting two velocity vectors can represent a force, which is clarified by noting that this difference can be treated as acceleration in a simulation context. Additionally, scaling the desired velocity vector to the maximum speed is important for controlling the output vector's magnitude and direction, ensuring realistic movement behavior. Overall, the conversation highlights the need for experimentation with constants to achieve desired steering effects in AI implementations.
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:
Kindly see the attached pdf. My attempt to solve it, is in it. I'm wondering if my solution is right. My idea is this: At any point of time, the ball may be assumed to be at an incline which is at an angle of θ(kindly see both the pics in the pdf file). The value of θ will continuously change and so will the value of friction. I'm not able to figure out, why my solution is wrong, if it is wrong .
TL;DR Summary: I came across this question from a Sri Lankan A-level textbook. Question - An ice cube with a length of 10 cm is immersed in water at 0 °C. An observer observes the ice cube from the water, and it seems to be 7.75 cm long. If the refractive index of water is 4/3, find the height of the ice cube immersed in the water. I could not understand how the apparent height of the ice cube in the water depends on the height of the ice cube immersed in the water. Does anyone have an...
Thread 'A bead-mass oscillatory system problem'
I can't figure out how to find the velocity of the particle at 37 degrees. Basically the bead moves with velocity towards right let's call it v1. The particle moves with some velocity v2. In frame of the bead, the particle is performing circular motion. So v of particle wrt bead would be perpendicular to the string. But how would I find the velocity of particle in ground frame? I tried using vectors to figure it out and the angle is coming out to be extremely long. One equation is by work...

Similar threads

Back
Top