From: terencehill Date: Mon, 5 Sep 2022 20:48:36 +0000 (+0200) Subject: Bot AI: increase the amount of error induced to the bots aim with skill < 10, make... X-Git-Tag: xonotic-v0.8.6~322^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c800330f9439f3421a2ef67661e1e8548a320c8f;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: increase the amount of error induced to the bots aim with skill < 10, make it less intense vertically and when bot is not aiming at any enemy and a bit more randomized in time. Also get rid of a useless normalize call --- diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index 96de17a74..f05097fd4 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -201,14 +201,18 @@ void bot_aimdir(entity this, vector v, float maxfiredeviation) // get the desired angles to aim at //dprint(" at:", vtos(v)); - v = normalize(v); + //v = normalize(v); //te_lightning2(NULL, this.origin + this.view_ofs, this.origin + this.view_ofs + v * 200); if (time >= this.bot_badaimtime) { - this.bot_badaimtime = max(this.bot_badaimtime + 0.3, time); - this.bot_badaimoffset = randomvec() * bound(0, 5 - 0.5 * (skill+this.bot_offsetskill), 5) * autocvar_bot_ai_aimskill_offset; + this.bot_badaimtime = max(this.bot_badaimtime + 0.2 + 0.3 * random(), time); + int f = bound(0, 1 - 0.1 * (skill + this.bot_offsetskill), 1); + this.bot_badaimoffset = randomvec() * f * autocvar_bot_ai_aimskill_offset; + this.bot_badaimoffset.x *= 0.7; // smaller vertical offset } - desiredang = vectoangles(v) + this.bot_badaimoffset; + float enemy_factor = ((this.bot_aimtarg) ? 5 : 2); + // apply enemy_factor every frame so that the bigger offset is applied instantly when the bot aims to a new target + desiredang = vectoangles(v) + this.bot_badaimoffset * enemy_factor; //dprint(" desired:", vtos(desiredang)); if (desiredang.x >= 180) desiredang.x = desiredang.x - 360; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index a06cd2ec5..f94c9ab78 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -142,7 +142,7 @@ set bot_ai_aimskill_firetolerance 1 "enable fire tolerance" 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 -set bot_ai_aimskill_offset 0.3 "Amount of error induced to the bots aim" +set bot_ai_aimskill_offset 1.8 "Amount of error induced to the bots aim" set bot_ai_aimskill_think 1 "Aiming velocity. Use values below 1 for slower aiming" set bot_ai_custom_weapon_priority_distances "300 850" "Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons" set bot_ai_custom_weapon_priority_far "vaporizer oknex vortex rifle electro devastator mortar hagar hlac crylink blaster okmachinegun machinegun fireball seeker okshotgun shotgun shockwave tuba minelayer" "Desired weapons for far distances ordered by priority"