View Single Post
Re: Suicidal tendencies of the Botmanīs BOT#1o
Old
  (#2)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Suicidal tendencies of the Botmanīs BOT#1o - 26-03-2014

Quote:
Originally Posted by MIFUNE View Post
Hi. First of all I know that this BOT is almost 10 years old, but it works perfectly for my MOD...

http://www.moddb.com/mods/zion-warcry

...except for the fact that they have a serious and stupid suicidal tendencies. I have tried to use the code in the BOTīs source which is used to find walls, but with no luck.

Code:
BOOL CBot::BotChecFloor( void )
{
   Vector v_src, v_up;
   TraceResult tr;

   UTIL_MakeVectors( pev->v_angle );

   // do a trace down...

   v_src = pev->origin;
   v_left = v_src + gpGlobals->v_up * -40;  // 40 units down

   UTIL_TraceLine( v_src, v_left, dont_ignore_monsters, ENT(pev), &tr);

   // check if the trace hit something...
   if (tr.flFraction < 1.0)
   {
      if (f_wall_down = 1)
         f_wall_down = gpGlobals->time;

      return TRUE;
   }

   return FALSE;
}
Itīs the best approach I have found. In the first version BOTs get stuck (2007 version), and now (2014) I have made them walk on the bridges, buuuuuuut... even if they aparently check that thereīs no floor beneath them (they stop and start walking in other direction), they finally return to the void and fall to death.

What should I do?. Any help will be added to the credits.

Thanks in anticipation.
Are you using waypoints? You shouldn't need this is you have waypoints.
This code is either for waypointless navigation or for another reason.

What is done after and before this function is called? How does a bot know when to stop or move forward?

Better waypointless navigation can be foound in RACC bot source or try old RCBot1 source for ideas.
  
Reply With Quote