From: terencehill Date: Tue, 23 Aug 2022 21:32:22 +0000 (+0200) Subject: Bot AI: fix max fire deviation factor calculation (introduced in 4ae6e27ee) making... X-Git-Tag: xonotic-v0.8.6~322^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=61de2c1194455a487d1ff4384b113b59f2e343e5;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: fix max fire deviation factor calculation (introduced in 4ae6e27ee) making less skilled bots better at aiming with certain weapons --- diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index c7e23765c..96de17a74 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -376,11 +376,9 @@ bool bot_aim(entity this, .entity weaponentity, float shotspeed, float shotspeed float dist = max(10, vlen(v - shotorg)); float maxfiredeviation = 1000 / (dist - 9) - 0.35; - if (!shot_accurate) - maxfiredeviation *= 1.6; - else - maxfiredeviation *= 1 + bound(0, (10 - (skill + this.bot_aimskill)) * 0.3, 3); - maxfiredeviation = min(autocvar_bot_ai_aimskill_firetolerance_maxdegrees, maxfiredeviation); + float f = (shot_accurate) ? 1 : 1.6; + f += bound(0, (10 - (skill + this.bot_aimskill)) * 0.3, 3); + maxfiredeviation = min(90, maxfiredeviation * f); if (applygravity && this.bot_aimtarg) { diff --git a/qcsrc/server/bot/default/cvars.qh b/qcsrc/server/bot/default/cvars.qh index 43a92f6be..bd408da42 100644 --- a/qcsrc/server/bot/default/cvars.qh +++ b/qcsrc/server/bot/default/cvars.qh @@ -2,7 +2,6 @@ float autocvar_bot_ai_aimskill_blendrate; int autocvar_bot_ai_aimskill_firetolerance; -float autocvar_bot_ai_aimskill_firetolerance_maxdegrees; float autocvar_bot_ai_aimskill_fixedrate; float autocvar_bot_ai_aimskill_mouse; float autocvar_bot_ai_aimskill_offset; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index e6bfecb83..a06cd2ec5 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -139,7 +139,6 @@ set bot_ai_dangerdetectionupdates 64 "How many waypoints will be considered for set bot_ai_aimskill_blendrate 2 "How much correction will be applied to the aiming angle" set bot_ai_aimskill_fixedrate 15 "Distance based scale from which correction will be applied to the aiming angle" set bot_ai_aimskill_firetolerance 1 "enable fire tolerance" -set bot_ai_aimskill_firetolerance_maxdegrees 60 "Maximum firing angle. Used on close range" set bot_ai_aimskill_mouse 1 "How much of the aiming filters are applied" set bot_ai_keyboard_distance 250 "Keyboard emulation is disabled after this distance to the goal" set bot_ai_keyboard_threshold 0.57