From c6b89a209d15c0a76c98cd00d54fe0ad6fafe40e Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 21 Jan 2017 19:04:49 +0100 Subject: [PATCH] Fine tune enemy rating --- qcsrc/server/bot/default/havocbot/roles.qc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/bot/default/havocbot/roles.qc b/qcsrc/server/bot/default/havocbot/roles.qc index ebdca2d89..1efdab0d3 100644 --- a/qcsrc/server/bot/default/havocbot/roles.qc +++ b/qcsrc/server/bot/default/havocbot/roles.qc @@ -121,6 +121,7 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float }); } +#define BOT_RATING_ENEMY 2500 void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius) { if (autocvar_bot_nofire) @@ -130,6 +131,8 @@ void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org if(this.waterlevel>WATERLEVEL_WETFEET) return; + ratingscale = ratingscale * 0.00005; // enemies are rated around 20000 already + int t; FOREACH_CLIENT(IS_PLAYER(it) && bot_shouldattack(this, it), LAMBDA( @@ -163,8 +166,17 @@ void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org // adding a player as a goal seems to be quite dangerous, especially on space maps // remove hack in navigation_poptouchedgoals() after performing this change - t = (this.health + this.armorvalue ) / (it.health + it.armorvalue ); - navigation_routerating(this, it, t * ratingscale, 2000); + t = ((this.health + this.armorvalue) - (it.health + it.armorvalue)) / 150; + t = bound(0, 1 + t, 3); + if (skill > 3) + { + if (time < this.strength_finished - 1) t += 0.5; + if (time < it.strength_finished - 1) t -= 0.5; + } + t += max(0, 8 - skill) * 0.05; // less skilled bots attack more mindlessly + ratingscale *= t; + if (ratingscale > 0) + navigation_routerating(this, it, ratingscale * BOT_RATING_ENEMY, 2000); )); } -- 2.39.2