View Single Post
Re: State of the Bot
Old
  (#10)
DrEvil
Member
 
DrEvil's Avatar
 
Status: Offline
Posts: 142
Join Date: Jan 2004
Location: Los Angeles, CA
Default Re: State of the Bot - 04-08-2006

What he said. The most important of such missing features is essentially:

What weapons does the bot have?
or more easily,
Does the bot have weapon x?

and a way to query the ammo from the bot.

With those 2 functions, which would have been trivial for valve to add to the interface long ago, we could make some pretty functional bots, though without the other things they would be a bit more stupid that most of us desire. At least they would be releasable and fun to play.

The only weapon function exposed in the bot interface SetActiveWeapon is the most poorly written function ever, creating a brand new weapon for the bot every time you call it. It doesn't take long to crash the game with this function, when it runs out of enemies.

Code:
void CPlayerInfo::SetActiveWeapon( const char *WeaponName ) 
{ 
    Assert( m_pParent );
    if ( m_pParent->IsBot() )
    {
        CBaseCombatWeapon *weap = m_pParent->Weapon_Create( WeaponName );
        if ( weap )
        {
            m_pParent->Weapon_Equip(weap); 
            m_pParent->Weapon_Switch(weap); 
        }
    }
}
Clearly whoever wrote this function had no idea what they were doing. This function should FAIL if the bot doesn't have it, or at the least a bool _force parameter to only create on request. We would still need another function bool HasWeapon(const char *WeaponName), to query if the bot has the weapon. Another trivial function. Fixing these 2 issues would have been a damn nice start, and taken someone at valve a whopping 10 seconds to do. I'm not bitter though


Omni-bot AI framework
http://www.omni-bot.com

Foxbot - for Team Fortress Classic
http://www.foxbot.net



Last edited by DrEvil; 04-08-2006 at 18:29..
  
Reply With Quote