From: terencehill Date: Thu, 28 Sep 2017 13:03:34 +0000 (+0200) Subject: Bot AI: add some randomness when trying to shorten path, it should help on certain... X-Git-Tag: xonotic-v0.8.5~2378^2~48 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=0e2ffc1d28c4cc5fbc375a36305c34f68952c159;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: add some randomness when trying to shorten path, it should help on certain hard paths with climbs and tight corners --- 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)) {