1
$\begingroup$

It's a pretty simple question. How can I prevent the Steering Actuator from over-shooting the seeking target? The object must go extremely fast, therefore it over-shoots.

Any ideas?

$\endgroup$
4
1
$\begingroup$

You can increase the number of frames per second your game calculates. The steering actuator works by calculating the needed rotation to reach the target for each logic tic. The faster an object is moving, the more moment per tic it has along its axis. Each tic, it moves the object along an axis and calculates the rotation needed to reach the target. When the moment is fast, it adds a lot of distance and calculates the new rotation. If that distance is long enough to move your object off it's target path, it will look like it is overshooting.

enter image description here

By increasing the frames per second that the game runs at, you will increase the logic tics per second. This helps because it calculates a new rotation faster, keeping it on the target path better.

enter image description here

For example, you could set it to 120 instead of 60. Your object should now recalculate it's rotation and trajectory along the path twice as fast. However - this will also drag down performance. The faster you set the FPS, the more work your computer needs to do. If you have a lot of logic, forcing it to run twice as fast should create a noticeable drain on performance.

$\endgroup$
1
  • 1
    $\begingroup$ Thanks for the advice, but it doesn't seem to be the answer I was looking. The Navmesh is basically a massive rectangle, and the target object is a small square inside it. When it tries to seek it, it shoots WAY pass it and then immediately over-shoot back again. $\endgroup$ Apr 25 '16 at 18:53
0
$\begingroup$

I suggest to enable "Self Terminated" to stop steering after reaching the target.

You could detect this situation with the actuator sensor (which evaluates if the referred actuator is active or not).

But, I do not know how the steering actuator performs the last step (e.g. if it is a full step or if it ends exactly at the target.

$\endgroup$
0
$\begingroup$

Do not increase FPS. Instead increase Logic Steps. Blender calculates that number of logic steps for every frame it draws. Drawing a frame is really expensive compared to logic calculations.

It's overshooting because it calculates where the object needs to point and then has to wait a whole tic before it can calculate again. Well, in that amount of time the object has traveled far beyond the target. Now, it calculates the new direction but has to wait a whole tic again before it can check again. Again, in that one tic, the object has traveled past the target.

Imagine driving a car, but you can only touch the steering wheel once every second. You might start a turn, but then you have to wait a whole second. You might be all the way past your turn before you are allowed to touch the steering wheel again. The solution is to give it more opportunities to adjust its heading. Give it enough logic tics every frame and it'll be able to change direction BEFORE it overshoots.

The other problem you're going to run into is what to do when it REACHES its target. Once it reaches its target, if it doesn't stop moving... of course it will overshoot it. Then it will start steering back to the target again. You might have the actor slow down as it gets closer, or you might just have it stop moving altogether if it's touching the target.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.