Recently I was playing 1v1 CTF with a bot on a map that has waypoints at a high skill level. I looked into why the bot captured the flag less than I thought it should. I thought I'd post what I learned about bots and CTF just in case it interests anyone else.
The bot captured the enemy flag less often than I thought he should. Closer examination revealed that the bot would occasionally walk past the enemy flag with no apparent interest in it. Sometimes if the bot was sufficiently far from the enemy flag it would seem to be out of range. If the game mode is such that there are no potential goals (no "pick up items", etc.) on the map other than enemy flag the bot will sit motionless if the enemy flag is far enough away.
There are two reasons for this:
1) The bot's goals are determined by its current role. The bot's role is determined by the state of the game. Not all roles value flags.
2) There is a tradeoff between how far goals can be (in terms of the number of intervening waypoints) and still be considered by the bot and with the startup time when the level includes bots.
As to 1) the roles are things like "carrier", "defense", "interceptor", "middle" and "offense". Occasionally the role will change at random intervals. It also specifically changes as a function of what is going on with the flags.
For example, when an enemy gets the flag the bot's role changes to "interceptor". "interceptor" places a high value on the enemy flag carrier as a goal. So the bot is highly inclined to find a path via the waypoints to get to the enemy flag carrier, and hopefully kill him.
One reason why the bot sometimes seems to have no interest in the enemy flag is that it may have a role that places no value on the enemy flag ("middle", for example). I suspect one way of addressing this would be to place some minimum small value on the enemy flag in all roles. Most bots that aren't playing offensively would still remain where they are, but any bot that got lucky enough to get close enough to the enemy flag would pick it up. But I have not verified this.
Since multiple roles may apply the bot occasionally switches from one applicable role to another. Sometimes, if there are no other items on the map to get, the bot will sit motionless while its role is "middle" or "defense" and then only start moving when its role finally changes to "offense". Perhaps the role should be changed immediately if it results in a motionless bot that has no goal. I have not verified this.
As to the trade off mentioned in 2) if you search for "1050" in qcsrc/server/bots.qc you'll find a magic hard coded parameter that controls then number of waypoints that the bot is willing to look through to get its goal. I found setting this variable to "3000" was sufficient to get the bot to repeatedly go all the way from its base to the enemy base and capture the enemy flag on a moderate sized map, like Chasmv2. But it then takes almost 10 seconds to startup. Try different values. This value should probably be a variable.
Anyway, the above is something I always wanted to understand better. I hope it's interesting.