From 0e2ffc1d28c4cc5fbc375a36305c34f68952c159 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 28 Sep 2017 15:03:34 +0200 Subject: [PATCH] Bot AI: add some randomness when trying to shorten path, it should help on certain hard paths with climbs and tight corners --- qcsrc/server/bot/default/navigation.qc | 1 + 1 file changed, 1 insertion(+) diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 5de03e8af..0f223142a 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1366,6 +1366,7 @@ int navigation_poptouchedgoals(entity this) // If for some reason the bot is closer to the next goal, pop the current one if(this.goalstack01 && !wasfreed(this.goalstack01)) + if(random() < 0.7) // randomness should help on certain hard paths with climbs and tight corners if(vlen2(this.goalcurrent.origin - this.goalstack01.origin) > vlen2(this.goalstack01.origin - this.origin)) if(checkpvs(this.origin + this.view_ofs, this.goalstack01)) { -- 2.39.2