View Single Post
Re: Navigation using AABB
Old
  (#52)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Navigation using AABB - 19-07-2017

Also, the nervous jumping is just the way I calculate a jump. The way it's handled now is:

- It is assumed the maximum distance a player can jump horizontally is 170 units when running max speed
- The run up required to go from standing to max speed is 80 units
- Therefore the max run up required for a jump is 80 * jump distance / max jump distance, so a jump of 85 units (half max) will require a 40-unit run-up if the bot is standing still (since it only has to jump half as far)
- Acceleration is calculated linearly, so if the bot is already moving at max speed, the run up will be 0, and at half-speed it will be 50% of the required max run up

Final calculation is:

Required run-up = (1.0f - (currentSpeed / maxSpeed)) * (80 * (jumpDist / maxJumpDist))

If the distance of the bot from the jump-off point is less than the required run up, then it will abort the run and back up to the max required run up (+4 units extra to ensure it has enough distance), because according to the calculations it won't have built up enough speed by the time it hits the jump off point.

It will also abort if the dot product of the jump direction, the direction the bot approaches the jump off point, and its movement velocity is less than 0.9 (i.e. it's approaching from the wrong angle and will miss the target).
  
Reply With Quote