]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: add some randomness when trying to shorten path, it should help on certain...
authorterencehill <piuntn@gmail.com>
Thu, 28 Sep 2017 13:03:34 +0000 (15:03 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 28 Sep 2017 13:03:34 +0000 (15:03 +0200)
qcsrc/server/bot/default/navigation.qc

index 5de03e8afd3e8b6886d9047cc6d3227c9dba04c1..0f223142a1c04e95d9a8ab36337d62436616de2c 100644 (file)
@@ -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))
        {