]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disable fire tolerance since bots tend to shoot way less then before when enemy is...
authorterencehill <piuntn@gmail.com>
Wed, 6 Mar 2019 14:44:27 +0000 (15:44 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 6 Mar 2019 14:44:27 +0000 (15:44 +0100)
This commit actually reverts c82f443c "Bot AI: fix bots starting to fire when they aren't aiming at the enemy yet"

qcsrc/server/bot/default/aim.qc
qcsrc/server/bot/default/cvars.qh
xonotic-server.cfg

index c69442f19b0ee16c4a309d3b9124fd410eb0d8d1..21506d07523e406f0a5591d84f4c302668321f15 100644 (file)
@@ -335,8 +335,17 @@ void bot_aimdir(entity this, vector v, float maxfiredeviation)
 
        //dprint("e ", vtos(diffang), " < ", ftos(maxfiredeviation), "\n");
 
+       if (maxfiredeviation <= 0)
+               return;
+
+       if (!autocvar_bot_ai_aimskill_firetolerance)
+       {
+               this.bot_firetimer = time + 0.2;
+               return;
+       }
+
        // decide whether to fire this time
-       if (maxfiredeviation != 0 && v * shotdir > cos(maxfiredeviation * DEG2RAD))
+       if (v * shotdir > cos(maxfiredeviation * DEG2RAD))
        {
                traceline(shotorg, shotorg + shotdir * 1000, false, NULL);
                if (vdist(trace_endpos - shotorg, <, 500 + 500 * bound(0, skill + this.bot_aggresskill, 10))
index aea112d9edf75d126ded64b3907ad1c6dcfa1097..55bc9c8f3f1ce218751bf1c57fdf5e6c3b6e86bc 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once
 
 float autocvar_bot_ai_aimskill_blendrate;
+int autocvar_bot_ai_aimskill_firetolerance;
 float autocvar_bot_ai_aimskill_firetolerance_distdegrees;
 float autocvar_bot_ai_aimskill_firetolerance_maxdegrees;
 float autocvar_bot_ai_aimskill_firetolerance_mindegrees;
index a5874eb24a0219d3f51d7e91e303a59649cff3c5..fdba9aec08afba53e8a152122e09af9f7dcf6c27 100644 (file)
@@ -128,6 +128,7 @@ set bot_ai_dangerdetectioninterval 0.25 "How often scan for waypoints with dange
 set bot_ai_dangerdetectionupdates 64 "How many waypoints will be considered for danger detection"
 set bot_ai_aimskill_blendrate 2        "How much correction will be applied to the aiming angle"
 set bot_ai_aimskill_fixedrate 15
+set bot_ai_aimskill_firetolerance 0 "enable fire tolerance"
 set bot_ai_aimskill_firetolerance_distdegrees 100
 set bot_ai_aimskill_firetolerance_mindegrees 2 "Minimum angle tolerance. Used on large distances"
 set bot_ai_aimskill_firetolerance_maxdegrees 60 "Maximum firing angle. Used on close range"
@@ -144,7 +145,7 @@ set bot_ai_weapon_combo 1   "Enable bots to do weapon combos"
 set bot_ai_weapon_combo_threshold 0.4  "Try to make a combo N seconds after the last attack"
 set bot_ai_friends_aware_pickup_radius "500"   "Bots will not pickup items if a team mate is this distance near the item"
 set bot_ai_ignoregoal_timeout 3        "Ignore goals making bots to get stuck in front of a wall for N seconds"
-set bot_ai_bunnyhop_skilloffset 7      "Bots with skill equal or greater than this value will perform the  \"bunnyhop\" technique"
+set bot_ai_bunnyhop_skilloffset 7      "Bots with skill equal or greater than this value will perform the \"bunnyhop\" technique"
 set bot_ai_bunnyhop_startdistance 200 "Run to goals located further than this distance"
 set bot_ai_bunnyhop_stopdistance 300 "Stop jumping after reaching this distance to the goal"
 set bot_ai_bunnyhop_firstjumpdelay 0.2 "Start running to the goal only if it was seen for more than N seconds"