.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Navigation using AABB (http://forums.bots-united.com/showthread.php?t=10049)

Neoptolemus 19-07-2017 14:52

Re: Navigation using AABB
 
Quote:

Originally Posted by The Storm (Post 66822)
Much better although the bot seems a bit nervous before jump. :D

Two things I can suggest about the framerate.

1. First record a demo, the while playing the demo start to do the actual recording.
2. About the issue in general - it sounds like something wrong with the calculation of the msec value.

Thanks for the suggestions, I'll give it a try if I can replicate the issue consistently.

Here is my to do list right now:

- Improve ladder handling when the bot is approaching from tight angles, to avoid getting stuck on the edges, or climbing up the wrong side

- Add drop calculations for non-adjacent sectors. Currently the bots can jump between platforms, but if the platforms are close enough, and the target platform is lower than the current one, it makes more sense to walk off rather than jump (potentially causing additional fall damage)

- Reduce zig-zagging when the bot is moving in a non-axis aligned direction. Take shortcuts in the path where feasible

Neoptolemus 19-07-2017 17:48

Re: Navigation using AABB
 
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).

The Storm 22-07-2017 19:38

Re: Navigation using AABB
 
I understand your calculations but it looks very unnatural, you should smooth a bit the movement before getting ready to jump.

Neoptolemus 23-07-2017 12:11

Re: Navigation using AABB
 
Quote:

Originally Posted by The Storm (Post 66826)
I understand your calculations but it looks very unnatural, you should smooth a bit the movement before getting ready to jump.

Agreed, it needs some work still!

I added a step in the generation of nav data to adjust the size of generated sectors to be more accurate. The voxelisation process has a resolution of 10 units, so it's possible for a sector's min Z point to float up to 9 units above or below the actual floor. In some edge cases this caused the bot to jump up stairs that they could walk up normally because the voxel process reckoned they were 20 units high, and the GoldSrc step height is 18 units. This was solved with a second pass using simple traces up and down to "feel" for the floor and ceiling.

Weirdly, this now causes a crash on cs_italy during the building of jump connections, even though I confirmed that the code didn't do anything weird like create upside-down sectors (where the min Z is higher than the max Z). Literally all it does is slightly adjust the min and max Z positions of each sector.

Gotta fix that now. I also still have crashes when opening certain Natural Selection maps. Again, no idea why this crashes, but will need to look into it.


All times are GMT +2. The time now is 20:28.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.