From: terencehill Date: Wed, 6 Mar 2019 14:44:27 +0000 (+0100) Subject: Disable fire tolerance since bots tend to shoot way less then before when enemy is... X-Git-Tag: xonotic-v0.8.5~1586^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c10a815a440610c7769065ece770e3e171d0d76;p=xonotic%2Fxonotic-data.pk3dir.git Disable fire tolerance since bots tend to shoot way less then before when enemy is close to them even with low range weapons that don't need extreme accuracy This commit actually reverts c82f443c "Bot AI: fix bots starting to fire when they aren't aiming at the enemy yet" --- diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index c69442f19..21506d075 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -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)) diff --git a/qcsrc/server/bot/default/cvars.qh b/qcsrc/server/bot/default/cvars.qh index aea112d9e..55bc9c8f3 100644 --- a/qcsrc/server/bot/default/cvars.qh +++ b/qcsrc/server/bot/default/cvars.qh @@ -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; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index a5874eb24..fdba9aec0 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -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"