From ce47b94cdf4ff7fe943f4a4bf52ed04890ae87e1 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 11 Sep 2017 13:18:25 +0200 Subject: [PATCH] Bot AI: tweak timeout values for searching a new goal and for searching a new goal when removing a waypoint to increase chances bot doesn't need to find nearest waypoints --- defaultServer.cfg | 4 ++-- qcsrc/server/bot/default/havocbot/havocbot.qc | 2 +- qcsrc/server/bot/default/navigation.qc | 2 +- qcsrc/server/utils.qh | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/defaultServer.cfg b/defaultServer.cfg index a63ad8345..2e8090666 100644 --- a/defaultServer.cfg +++ b/defaultServer.cfg @@ -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." diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index f842c29d3..8c1283a7f 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -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); } diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index d92d02f95..ea54b5571 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -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; diff --git a/qcsrc/server/utils.qh b/qcsrc/server/utils.qh index 4a603c022..a0b7b5965 100644 --- a/qcsrc/server/utils.qh +++ b/qcsrc/server/utils.qh @@ -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; }); -- 2.39.2