]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: tweak timeout values for searching a new goal and for searching a new goal...
authorterencehill <piuntn@gmail.com>
Mon, 11 Sep 2017 11:18:25 +0000 (13:18 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 11 Sep 2017 11:18:25 +0000 (13:18 +0200)
defaultServer.cfg
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/utils.qh

index a63ad8345dda9e0b1cf272fc3698fa7fe43aed41..2e8090666556fa039d1997ab2176e15813c0f849 100644 (file)
@@ -115,8 +115,8 @@ set bot_debug_goalstack 0 "Visualize the current path that each bot is following
 set bot_wander_enable 1 "Have bots wander around if they are unable to reach any useful goal. Disable only for debugging purposes."
 // general bot AI cvars
 set bot_ai_thinkinterval 0.05
-set bot_ai_strategyinterval 5 "How often a new objective is chosen"
-set bot_ai_strategyinterval_movingtarget 3.5 "How often a new objective is chosen when current objective can move"
+set bot_ai_strategyinterval 7 "How often a new objective is chosen"
+set bot_ai_strategyinterval_movingtarget 5.5 "How often a new objective is chosen when current objective can move"
 set bot_ai_enemydetectioninterval 2 "How often bots pick a new target"
 set bot_ai_enemydetectionradius 10000 "How far bots can see enemies"
 set bot_ai_dodgeupdateinterval 0.2 "How often scan for items to dodge. Currently not in use."
index f842c29d3b491cede45cd6b302fcc735227b547b..8c1283a7f3ff21588301380ebf09bc66fe7e8c31 100644 (file)
@@ -761,7 +761,7 @@ void havocbot_movetogoal(entity this)
        }
        if(!locked_goal)
        {
-               if(navigation_poptouchedgoals(this) && this.bot_strategytime < time + 1)
+               if(navigation_poptouchedgoals(this) && time > this.bot_strategytime - (IS_MOVABLE(this.goalentity) ? 3 : 2))
                        navigation_goalrating_timeout_force(this);
        }
 
index d92d02f95a009135e2b7a3d9154d0abda8e3c939..ea54b5571fa16e49c998548c789c18dfb2e4e1ad 100644 (file)
@@ -19,7 +19,7 @@
 
 void navigation_goalrating_timeout_set(entity this)
 {
-       if((IS_PLAYER(this.goalentity) || IS_MONSTER(this.goalentity)) && !STAT(FROZEN, this.goalentity))
+       if(IS_MOVABLE(this.goalentity))
                this.bot_strategytime = time + autocvar_bot_ai_strategyinterval_movingtarget;
        else
                this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
index 4a603c02256d244dd69fca54040a80b9f4faeed1..a0b7b596541b57e4cd88c95f49f2401ddd18caa4 100644 (file)
@@ -22,6 +22,8 @@ const string STR_OBSERVER = "observer";
 #define IS_VEHICLE(v) (v.vehicle_flags & VHF_ISVEHICLE)
 #define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET)
 
+#define IS_MOVABLE(v) (((IS_PLAYER(v) || IS_MONSTER(v)) && !STAT(FROZEN, v)) || IS_VEHICLE(v))
+
 // NOTE: FOR_EACH_CLIENTSLOT deprecated! Use the following instead: FOREACH_CLIENTSLOT(true, { code; });
 // NOTE: FOR_EACH_CLIENT deprecated! Use the following instead: FOREACH_CLIENT(true, { code; });
 // NOTE: FOR_EACH_REALCLIENT deprecated! Use the following instead: FOREACH_CLIENT(IS_REAL_CLIENT(it), { code; });