.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Grave Bot (http://forums.bots-united.com/forumdisplay.php?f=56)
-   -   Waypointing (http://forums.bots-united.com/showthread.php?t=3068)

Ghoul 22-01-2005 16:00

Re: Waypointing
 
Hey everyone, check these out. :)

Grave Bot in S&I stability test 1 (insanely high scores)

Grave Bot in S&I stability test 2 (notice the time in the console window for each bot)

:D I'm going to write the avoiding code today and hopefully that'll be the end to that problem.

Ghoul 22-01-2005 22:18

Re: Waypointing
 
Okay, found and fixed the problem. Let me explain...

The contact evasion code used some math to determine the current direction the bot was headed. One function used was the asin function, which takes one parameter. This parameter is a float between -1 and 1. The bot inputs its current strafe speed divided by the max speed to get the value which asin takes. This all works fine normally under the correct conditions.

S&I however changes the maximum speed of players quite often. Something like switching weapons will increase or decrease the max speed. If a bot is currently on a weapon with high max speed, then switches to a weapon of low max speed, there is a fraction of a second where the bot is actually traveling faster than the max speed.

So, in the code, the obtained value will be either > 1 or < -1 (depending on the direction of travel) and that value will be passed on to asin. asin doesn't work correctly with values out of its range, and so it returns an invalid jumbled float. This value is passed on into the function (BotAvoidContact), corrupting the angular vector caluclated, and the direction vector calculated. The bad direction vector is used in an initial TraceLine function to see if anything is in the way of the bot.

The TraceLine function is where the looping begins. Apparently it is unable to correctly handle the corrupt vector, and somehow hits an infinite loop. Since the function is within the engine, there's no way to really know.

The first fix I tried was to limit the value of the variable passed into the asin function. This worked fine, as it should, but then I realized that the whole asin function itself, along with many other calculations, were pointless. I simply created a new vector in the bot called v_curr_direction. Everytime the bot calculates the direction it wishes to travel, that vector is updated with the calculated direction.

The avoid function has been updated to use this new vector, rather than performing tons of unneeded math, and all is well.

What's going to happen today? A release of 0.3 with the S&I crash fixed and hopefully the min_bot and max_bot crash fixed (along with a couple other misc adjustments). Version 0.3 will be released under the following:

- Windows standard hooking DLL
- Windows metamod DLL
- Linux standard hooking .so
- Linux metamod .so

See ya guys!

Ghoul 23-01-2005 16:50

Re: Waypointing
 
Beta 0.3 is out. Check out the news.

CoCoNUT 24-01-2005 14:30

Re: Waypointing
 
2 Attachment(s)
Hi, beta 0.3 is really cool, bots donīt crash anymore, great fun! I completed all si_-standard-map-waypoints. Some more difficult paths (crouch-jump etc.) are not waypointed yet. Removed some paths with breakables (mill&depot) and removed the sniper-waypoints from si_urban. Made a few fixes and updates, also all remaining maps. Enjoy! :D ...and report all bugs =).

These waypoints are "all free", anyone is allowed to tweak and re-release them.

Maps: all S&I standard-maps (except si_overtime)
Only flags: team, weapon, health, armor, door, crouch, ladder, jump

----edit:----
What I saw in si_early: No matter how I place the waypoints, the bots try to reach the administrator directly and get stuck on the ramp:

Ghoul 24-01-2005 21:05

Re: Waypointing
 
If I remember right, the bots try to head directly to their goal if they're close enough. That ramp must but just tall enough so they thing they can walk right to him. I'll put in visibility and traceline checks for 0.4.

BuMHeD 25-01-2005 17:32

Re: Waypointing
 
Quote:

Originally Posted by Ghoul
Beta 0.3 is out. Check out the news.

Great news Ghoul!! I will download and test this new and improved Grave Bot just as soon as I can and let you know if we have any crash issues!! Pray tell, what exactly did you change in hopes of dodging the min/max_bot crash bug. I'm a student of C++ and I'm curious what you may have editted to prevent the overflow. Thanks.

*~BuM~*

Ghoul 25-01-2005 21:26

Re: Waypointing
 
I extended the time between bots joining. Maybe that'll work, maybe not. I didn't really test. I'll probably just completely redo the min/max code for 0.4.

So, with that said. Give me suggestions on how it should work exactly.


All times are GMT +2. The time now is 22:23.

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