From b5f61ddcce128eb0c10f6a1aa743c832f4713c90 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 19 Dec 2016 18:32:02 +0100 Subject: [PATCH 1/1] Add some randomness to the goal selection when a bot is stuck on a jump pad, increasing chances to unstuck bots (e.g. on the jump pad near the ctf team base on Implosion) --- qcsrc/server/bot/default/havocbot/havocbot.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index b23c15bcaf..39665a6515 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -492,6 +492,7 @@ void havocbot_movetogoal(entity this) if(this.jumppadcount) { // If got stuck on the jump pad try to reach the farthest visible waypoint + // but with some randomness so it can try out different paths if(this.aistatus & AI_STATUS_OUT_JUMPPAD) { if(fabs(this.velocity.z)<50) @@ -504,7 +505,7 @@ void havocbot_movetogoal(entity this) if(trace_fraction < 1) continue; - if(!newgoal || vlen2(it.origin - this.origin) > vlen2(newgoal.origin - this.origin)) + if(!newgoal || ((random() < 0.8) && vlen2(it.origin - this.origin) > vlen2(newgoal.origin - this.origin))) newgoal = it; }); @@ -514,6 +515,8 @@ void havocbot_movetogoal(entity this) this.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout; navigation_clearroute(this); navigation_routetogoal(this, newgoal, this.origin); + if(autocvar_bot_debug_goalstack) + debuggoalstack(this); this.aistatus &= ~AI_STATUS_OUT_JUMPPAD; } } -- 2.39.2