From: terencehill Date: Tue, 10 Jan 2017 15:08:16 +0000 (+0100) Subject: Bot AI: improve item rating X-Git-Tag: xonotic-v0.8.2~293^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5973eddeb056de5d77f18ca0926755a497bfc454;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: improve item rating * fine-tune weapon base values and always use them instead of needlessly calculating every time new ones from the priority lists * dynamically increase ammo and health/armor values based on the current need of them * rate already owned weapons like ammo plus a small percentage of base weapon value --- diff --git a/qcsrc/common/items/item/ammo.qh b/qcsrc/common/items/item/ammo.qh index e1d493fe9..f240578b3 100644 --- a/qcsrc/common/items/item/ammo.qh +++ b/qcsrc/common/items/item/ammo.qh @@ -3,7 +3,7 @@ #include "pickup.qh" CLASS(Ammo, Pickup) #ifdef SVQC - ATTRIB(Ammo, m_pickupevalfunc, float(entity player, entity item), commodity_pickupevalfunc); + ATTRIB(Ammo, m_pickupevalfunc, float(entity player, entity item), ammo_pickupevalfunc); ATTRIB(Ammo, m_respawntime, float(), GET(g_pickup_respawntime_ammo)); ATTRIB(Ammo, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_ammo)); #endif @@ -24,7 +24,7 @@ REGISTER_ITEM(Bullets, Ammo) { this.m_name = "bullets"; this.m_icon = "ammo_bullets"; #ifdef SVQC - this.m_botvalue = 2000; + this.m_botvalue = 1500; this.m_itemid = IT_NAILS; #endif } @@ -40,7 +40,7 @@ REGISTER_ITEM(Cells, Ammo) { this.m_name = "cells"; this.m_icon = "ammo_cells"; #ifdef SVQC - this.m_botvalue = 2000; + this.m_botvalue = 1500; this.m_itemid = IT_CELLS; #endif } @@ -56,7 +56,7 @@ REGISTER_ITEM(Plasma, Ammo) { this.m_name = "plasma"; this.m_icon = "ammo_plasma"; #ifdef SVQC - this.m_botvalue = 2000; + this.m_botvalue = 1500; this.m_itemid = IT_PLASMA; #endif } @@ -72,7 +72,7 @@ REGISTER_ITEM(Rockets, Ammo) { this.m_name = "rockets"; this.m_icon = "ammo_rockets"; #ifdef SVQC - this.m_botvalue = 3000; + this.m_botvalue = 1500; this.m_itemid = IT_ROCKETS; #endif } @@ -88,7 +88,7 @@ REGISTER_ITEM(Shells, Ammo) { this.m_name = "shells"; this.m_icon = "ammo_shells"; #ifdef SVQC - this.m_botvalue = 500; + this.m_botvalue = 1000; this.m_itemid = IT_SHELLS; #endif } diff --git a/qcsrc/common/items/item/armor.qh b/qcsrc/common/items/item/armor.qh index 4b6b9fdf6..9fcd07634 100644 --- a/qcsrc/common/items/item/armor.qh +++ b/qcsrc/common/items/item/armor.qh @@ -5,7 +5,8 @@ CLASS(Armor, Pickup) #ifdef SVQC ATTRIB(Armor, m_mins, vector, '-16 -16 0'); ATTRIB(Armor, m_maxs, vector, '16 16 48'); - ATTRIB(Armor, m_pickupevalfunc, float(entity player, entity item), commodity_pickupevalfunc); + ATTRIB(Armor, m_pickupevalfunc, float(entity player, entity item), healtharmor_pickupevalfunc); + ATTRIB(Armor, m_botvalue, int, 3000); #endif ENDCLASS(Armor) @@ -26,7 +27,6 @@ REGISTER_ITEM(ArmorSmall, Armor) { this.m_name = "5 Armor"; this.m_icon = "armor"; #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_LOW; this.m_itemid = IT_ARMOR_SHARD; this.m_respawntime = GET(g_pickup_respawntime_short); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short); @@ -46,7 +46,6 @@ REGISTER_ITEM(ArmorMedium, Armor) { this.m_name = "25 Armor"; this.m_icon = "armor"; #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_MID; this.m_itemid = IT_ARMOR; this.m_respawntime = GET(g_pickup_respawntime_medium); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium); @@ -68,7 +67,6 @@ REGISTER_ITEM(ArmorBig, Armor) { this.m_color = '0 1 0'; this.m_waypoint = _("Big armor"); #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_HIGH; this.m_itemid = IT_ARMOR; this.m_respawntime = GET(g_pickup_respawntime_long); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long); @@ -92,7 +90,6 @@ REGISTER_ITEM(ArmorMega, Armor) { this.m_waypointblink = 2; #ifdef SVQC this.m_maxs = '16 16 70'; - this.m_botvalue = BOT_PICKUP_RATING_HIGH; this.m_itemid = IT_ARMOR; this.m_respawntime = GET(g_pickup_respawntime_long); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long); diff --git a/qcsrc/common/items/item/health.qh b/qcsrc/common/items/item/health.qh index f7915987e..e32d0ebbd 100644 --- a/qcsrc/common/items/item/health.qh +++ b/qcsrc/common/items/item/health.qh @@ -5,7 +5,8 @@ CLASS(Health, Pickup) #ifdef SVQC ATTRIB(Health, m_mins, vector, '-16 -16 0'); ATTRIB(Health, m_maxs, vector, '16 16 48'); - ATTRIB(Health, m_pickupevalfunc, float(entity player, entity item), commodity_pickupevalfunc); + ATTRIB(Health, m_pickupevalfunc, float(entity player, entity item), healtharmor_pickupevalfunc); + ATTRIB(Health, m_botvalue, int, 2500); #endif ENDCLASS(Health) @@ -26,7 +27,6 @@ REGISTER_ITEM(HealthSmall, Health) { this.m_name = "5 Health"; this.m_icon = "health"; #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_LOW; this.m_itemid = IT_5HP; this.m_respawntime = GET(g_pickup_respawntime_short); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short); @@ -46,7 +46,6 @@ REGISTER_ITEM(HealthMedium, Health) { this.m_name = "25 Health"; this.m_icon = "health"; #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_MID; this.m_itemid = IT_25HP; this.m_respawntime = GET(g_pickup_respawntime_short); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_short); @@ -68,7 +67,6 @@ REGISTER_ITEM(HealthBig, Health) { this.m_color = '1 0 0'; this.m_waypoint = _("Big health"); #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_MID; this.m_itemid = IT_25HP; this.m_respawntime = GET(g_pickup_respawntime_medium); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_medium); @@ -92,7 +90,6 @@ REGISTER_ITEM(HealthMega, Health) { this.m_waypointblink = 2; #ifdef SVQC this.m_maxs = '16 16 70'; - this.m_botvalue = BOT_PICKUP_RATING_HIGH; this.m_itemid = IT_HEALTH; this.m_respawntime = GET(g_pickup_respawntime_long); this.m_respawntimejitter = GET(g_pickup_respawntimejitter_long); diff --git a/qcsrc/common/items/item/jetpack.qh b/qcsrc/common/items/item/jetpack.qh index 8334c791a..5093234fb 100644 --- a/qcsrc/common/items/item/jetpack.qh +++ b/qcsrc/common/items/item/jetpack.qh @@ -26,8 +26,8 @@ REGISTER_ITEM(Jetpack, Powerup) { this.m_waypoint = _("Jet Pack"); this.m_waypointblink = 2; #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_LOW; - this.m_pickupevalfunc = commodity_pickupevalfunc; + this.m_botvalue = 3000; + this.m_pickupevalfunc = ammo_pickupevalfunc; #endif } @@ -42,7 +42,7 @@ REGISTER_ITEM(JetpackFuel, Ammo) { this.m_name = "Fuel"; this.m_icon = "ammo_fuel"; #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_LOW; + this.m_botvalue = 2000; this.m_itemid = IT_FUEL; #endif } @@ -61,8 +61,8 @@ REGISTER_ITEM(JetpackRegen, Powerup) { this.m_waypoint = _("Fuel regen"); this.m_waypointblink = 2; #ifdef SVQC - this.m_botvalue = BOT_PICKUP_RATING_LOW; + this.m_botvalue = 3000; this.m_itemid = IT_FUEL_REGEN; - this.m_pickupevalfunc = commodity_pickupevalfunc; + this.m_pickupevalfunc = ammo_pickupevalfunc; #endif } diff --git a/qcsrc/common/items/item/pickup.qh b/qcsrc/common/items/item/pickup.qh index 204a49921..af83fb9c8 100644 --- a/qcsrc/common/items/item/pickup.qh +++ b/qcsrc/common/items/item/pickup.qh @@ -17,11 +17,6 @@ PROPERTY(float, g_pickup_respawntimejitter_long) PROPERTY(float, g_pickup_respawntimejitter_powerup) #endif -// pickup ratings for bot logic -const int BOT_PICKUP_RATING_LOW = 2500; -const int BOT_PICKUP_RATING_MID = 5000; -const int BOT_PICKUP_RATING_HIGH = 10000; - #include #include #include diff --git a/qcsrc/common/items/item/powerup.qh b/qcsrc/common/items/item/powerup.qh index 80b1e6aff..aaec88eee 100644 --- a/qcsrc/common/items/item/powerup.qh +++ b/qcsrc/common/items/item/powerup.qh @@ -10,7 +10,7 @@ CLASS(Powerup, Pickup) #ifdef SVQC ATTRIB(Powerup, m_mins, vector, '-16 -16 0'); ATTRIB(Powerup, m_maxs, vector, '16 16 80'); - ATTRIB(Powerup, m_botvalue, int, 100000); + ATTRIB(Powerup, m_botvalue, int, 20000); ATTRIB(Powerup, m_itemflags, int, FL_POWERUP); ATTRIB(Powerup, m_respawntime, float(), GET(g_pickup_respawntime_powerup)); ATTRIB(Powerup, m_respawntimejitter, float(), GET(g_pickup_respawntimejitter_powerup)); diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 57a5bf579..4df42406d 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -350,7 +350,7 @@ void buff_Init(entity this) this.solid = SOLID_TRIGGER; this.flags = FL_ITEM; this.bot_pickup = true; - this.bot_pickupevalfunc = commodity_pickupevalfunc; + this.bot_pickupevalfunc = generic_pickupevalfunc; this.bot_pickupbasevalue = 1000; IL_PUSH(g_items, this); setthink(this, buff_Think); diff --git a/qcsrc/common/mutators/mutator/instagib/items.qh b/qcsrc/common/mutators/mutator/instagib/items.qh index 1efa4cbdc..d9f641d82 100644 --- a/qcsrc/common/mutators/mutator/instagib/items.qh +++ b/qcsrc/common/mutators/mutator/instagib/items.qh @@ -22,7 +22,7 @@ REGISTER_ITEM(VaporizerCells, Ammo) { this.m_name = "Vaporizer Ammo"; this.m_icon = "ammo_supercells"; #ifdef SVQC - this.m_botvalue = 100; + this.m_botvalue = 2000; this.m_itemid = IT_CELLS; this.m_respawntime = GET(instagib_respawntime_ammo); this.m_respawntimejitter = GET(instagib_respawntimejitter_ammo); diff --git a/qcsrc/common/mutators/mutator/overkill/hmg.qh b/qcsrc/common/mutators/mutator/overkill/hmg.qh index 7219fd1f8..99eb4c809 100644 --- a/qcsrc/common/mutators/mutator/overkill/hmg.qh +++ b/qcsrc/common/mutators/mutator/overkill/hmg.qh @@ -4,7 +4,7 @@ CLASS(HeavyMachineGun, Weapon) /* ammotype */ ATTRIB(HeavyMachineGun, ammo_field, .int, ammo_nails); /* impulse */ ATTRIB(HeavyMachineGun, impulse, int, 3); /* flags */ ATTRIB(HeavyMachineGun, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_SUPERWEAPON); -/* rating */ ATTRIB(HeavyMachineGun, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(HeavyMachineGun, bot_pickupbasevalue, float, 10000); /* color */ ATTRIB(HeavyMachineGun, wpcolor, vector, '0.5 0.5 0'); /* modelname */ ATTRIB(HeavyMachineGun, mdl, string, "ok_hmg"); #ifdef GAMEQC diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qh b/qcsrc/common/mutators/mutator/overkill/rpc.qh index 535fa5533..8de910102 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qh +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qh @@ -4,7 +4,7 @@ CLASS(RocketPropelledChainsaw, Weapon) /* ammotype */ ATTRIB(RocketPropelledChainsaw, ammo_field, .int, ammo_rockets); /* impulse */ ATTRIB(RocketPropelledChainsaw, impulse, int, 7); /* flags */ ATTRIB(RocketPropelledChainsaw, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_SUPERWEAPON); -/* rating */ ATTRIB(RocketPropelledChainsaw, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(RocketPropelledChainsaw, bot_pickupbasevalue, float, 10000); /* color */ ATTRIB(RocketPropelledChainsaw, wpcolor, vector, '0.5 0.5 0'); /* modelname */ ATTRIB(RocketPropelledChainsaw, mdl, string, "ok_rl"); #ifdef GAMEQC diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index a48bb7c8c..852a92814 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -949,133 +949,106 @@ float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickup float weapon_pickupevalfunc(entity player, entity item) { - float c; - int rating = item.bot_pickupbasevalue; - // See if I have it already if(player.weapons & item.weapons) { // If I can pick it up if(!item.spawnshieldtime) - c = 0; - else if(player.ammo_cells || player.ammo_shells || player.ammo_plasma || player.ammo_nails || player.ammo_rockets) - { - if (rating > 0) - rating = BOT_PICKUP_RATING_LOW * 0.5 * (1 + rating / BOT_PICKUP_RATING_HIGH); - // Skilled bots will grab more - c = 1 + bound(0, skill / 10, 1) * 0.5; - } - else - c = 0; - } - else - c = 1; - - if (c <= 0) - return 0; - - // If custom weapon priorities for bots is enabled rate most wanted weapons higher - if(bot_custom_weapon) - { - int best_ratio = 0; - int missing = 0; - - // evaluate weapon usefulness in all ranges - for(int list = 0; list < 3; list++) - { - int position = -1; - int wep_count = 0; - int wpn = item.weapon; - for (int j = 0; j < WEP_LAST; ++j) - { - int list_wpn = 0; - if (list == 0) list_wpn = bot_weapons_far[j]; - else if (list == 1) list_wpn = bot_weapons_mid[j]; - else list_wpn = bot_weapons_close[j]; - - if (weaponsInMap & Weapons_from(list_wpn).m_wepset) // only if available - { - if (list_wpn > 0) - wep_count++; - if (position == -1 && list_wpn == wpn) - position = wep_count; - } - } - if (position == -1) - { - missing++; - position = wep_count; // if missing assume last - } - if (wep_count) - { - if (!best_ratio || position / wep_count < best_ratio) - best_ratio = position / wep_count; - } - } - - if (missing < 3 && best_ratio) - c = c - best_ratio * 0.3; + return 0; + return ammo_pickupevalfunc(player, item); } - - return rating * c; + return item.bot_pickupbasevalue; } -float commodity_pickupevalfunc(entity player, entity item) +float ammo_pickupevalfunc(entity player, entity item) { bool need_shells = false, need_nails = false, need_rockets = false, need_cells = false, need_plasma = false, need_fuel = false; + entity wpn = NULL; float c = 0; + float rating = 0; // Detect needed ammo - FOREACH(Weapons, it != WEP_Null, { - if(!(player.weapons & (it.m_wepset))) - continue; + if(item.itemdef.instanceOfWeaponPickup) + { + entity ammo = NULL; + if(item.ammo_shells) { need_shells = true; ammo = ITEM_Shells; } + else if(item.ammo_nails) { need_nails = true; ammo = ITEM_Bullets; } + else if(item.ammo_rockets) { need_rockets = true; ammo = ITEM_Rockets; } + else if(item.ammo_cells) { need_cells = true; ammo = ITEM_Cells; } + else if(item.ammo_plasma) { need_plasma = true; ammo = ITEM_Plasma; } + else if(item.ammo_fuel) { need_fuel = true; ammo = ITEM_JetpackFuel; } - switch(it.ammo_field) - { - case ammo_shells: need_shells = true; break; - case ammo_nails: need_nails = true; break; - case ammo_rockets: need_rockets = true; break; - case ammo_cells: need_cells = true; break; - case ammo_plasma: need_plasma = true; break; - case ammo_fuel: need_fuel = true; break; - } - }); + if(!ammo) + return 0; + wpn = item; + rating = ammo.m_botvalue; + } + else + { + FOREACH(Weapons, it != WEP_Null, { + if(!(player.weapons & (it.m_wepset))) + continue; + + switch(it.ammo_field) + { + case ammo_shells: need_shells = true; break; + case ammo_shells: need_shells = true; break; + case ammo_nails: need_nails = true; break; + case ammo_rockets: need_rockets = true; break; + case ammo_cells: need_cells = true; break; + case ammo_plasma: need_plasma = true; break; + case ammo_fuel: need_fuel = true; break; + } + }); + rating = item.bot_pickupbasevalue; + } - // TODO: figure out if the player even has the weapon this ammo is for? - // may not affect strategy much though... - // find out how much more ammo/armor/health the player can hold if (need_shells) if (item.ammo_shells) if (player.ammo_shells < g_pickup_shells_max) - c = c + max(0, 1 - player.ammo_shells / g_pickup_shells_max); + c = (player.ammo_shells + item.ammo_shells) / player.ammo_shells; if (need_nails) if (item.ammo_nails) if (player.ammo_nails < g_pickup_nails_max) - c = c + max(0, 1 - player.ammo_nails / g_pickup_nails_max); + c = (player.ammo_nails + item.ammo_nails) / player.ammo_nails; if (need_rockets) if (item.ammo_rockets) if (player.ammo_rockets < g_pickup_rockets_max) - c = c + max(0, 1 - player.ammo_rockets / g_pickup_rockets_max); + c = (player.ammo_rockets + item.ammo_rockets) / player.ammo_rockets; if (need_cells) if (item.ammo_cells) if (player.ammo_cells < g_pickup_cells_max) - c = c + max(0, 1 - player.ammo_cells / g_pickup_cells_max); + c = (player.ammo_cells + item.ammo_cells) / player.ammo_cells; if (need_plasma) if (item.ammo_plasma) if (player.ammo_plasma < g_pickup_plasma_max) - c = c + max(0, 1 - player.ammo_plasma / g_pickup_plasma_max); + c = (player.ammo_plasma + item.ammo_plasma) / player.ammo_plasma; if (need_fuel) if (item.ammo_fuel) if (player.ammo_fuel < g_pickup_fuel_max) - c = c + max(0, 1 - player.ammo_fuel / g_pickup_fuel_max); + c = (player.ammo_fuel + item.ammo_fuel) / player.ammo_fuel; + + rating *= min(3, c); + if(wpn) + // Skilled bots will grab more + rating += wpn.bot_pickupbasevalue * (0.1 + 0.1 * bound(0, skill / 10, 1)); + return rating; +} + +float healtharmor_pickupevalfunc(entity player, entity item) +{ + float c = 0; + float rating = item.bot_pickupbasevalue; + if (item.armorvalue) if (player.armorvalue < item.max_armorvalue) - c = c + max(0, 1 - player.armorvalue / item.max_armorvalue); + c = (player.armorvalue + player.health + item.armorvalue) / (max(1, player.armorvalue + player.health)); if (item.health) if (player.health < item.max_health) - c = c + max(0, 1 - player.health / item.max_health); + c = (player.health + item.health) / (max(1, player.health)); - return item.bot_pickupbasevalue * c; + rating *= min(3, c); + return rating; } void Item_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) diff --git a/qcsrc/common/t_items.qh b/qcsrc/common/t_items.qh index 418ce3917..f5a310562 100644 --- a/qcsrc/common/t_items.qh +++ b/qcsrc/common/t_items.qh @@ -107,8 +107,8 @@ void UpdateItemAfterTeleport(entity this); float generic_pickupevalfunc(entity player, entity item);// {return item.bot_pickupbasevalue;} // WEAPONTODO float weapon_pickupevalfunc(entity player, entity item); - -float commodity_pickupevalfunc(entity player, entity item); +float ammo_pickupevalfunc(entity player, entity item); +float healtharmor_pickupevalfunc(entity player, entity item); .float is_item; .entity itemdef; diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 88ba1c768..b902cbe9a 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -4,7 +4,7 @@ CLASS(Arc, Weapon) /* ammotype */ ATTRIB(Arc, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Arc, impulse, int, 3); /* flags */ ATTRIB(Arc, spawnflags, int, WEP_FLAG_NORMAL); -/* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000); /* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1'); /* modelname */ ATTRIB(Arc, mdl, string, "arc"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index dbcddf1ad..e76117dc4 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -4,7 +4,7 @@ CLASS(Crylink, Weapon) /* ammotype */ ATTRIB(Crylink, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Crylink, impulse, int, 6); /* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB); -/* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000); /* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1'); /* modelname */ ATTRIB(Crylink, mdl, string, "crylink"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index a6473b392..ab86be4f8 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -4,7 +4,7 @@ CLASS(Devastator, Weapon) /* ammotype */ ATTRIB(Devastator, ammo_field, .int, ammo_rockets); /* impulse */ ATTRIB(Devastator, impulse, int, 9); /* flags */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(Devastator, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000); /* color */ ATTRIB(Devastator, wpcolor, vector, '1 1 0'); /* modelname */ ATTRIB(Devastator, mdl, string, "rl"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 46e46c240..0e8d272e0 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -4,7 +4,7 @@ CLASS(Electro, Weapon) /* ammotype */ ATTRIB(Electro, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Electro, impulse, int, 5); /* flags */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(Electro, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000); /* color */ ATTRIB(Electro, wpcolor, vector, '0 0.5 1'); /* modelname */ ATTRIB(Electro, mdl, string, "electro"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index dff721aa1..2add2e468 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -4,7 +4,7 @@ CLASS(Fireball, Weapon) /* ammotype */ //ATTRIB(Fireball, ammo_field, .int, ammo_none); /* impulse */ ATTRIB(Fireball, impulse, int, 9); /* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(Fireball, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000); /* color */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0'); /* modelname */ ATTRIB(Fireball, mdl, string, "fireball"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 897ad437f..f7b289278 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -4,7 +4,7 @@ CLASS(Hagar, Weapon) /* ammotype */ ATTRIB(Hagar, ammo_field, .int, ammo_rockets); /* impulse */ ATTRIB(Hagar, impulse, int, 8); /* flags */ ATTRIB(Hagar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(Hagar, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(Hagar, bot_pickupbasevalue, float, 6000); /* color */ ATTRIB(Hagar, wpcolor, vector, '1 1 0.5'); /* modelname */ ATTRIB(Hagar, mdl, string, "hagar"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 010ca4fe8..6e03b1041 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -4,7 +4,7 @@ CLASS(HLAC, Weapon) /* ammotype */ ATTRIB(HLAC, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(HLAC, impulse, int, 6); /* flags */ ATTRIB(HLAC, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(HLAC, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(HLAC, bot_pickupbasevalue, float, 4000); /* color */ ATTRIB(HLAC, wpcolor, vector, '0 1 0'); /* modelname */ ATTRIB(HLAC, mdl, string, "hlac"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 7344ba9d0..0d986e773 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -4,7 +4,7 @@ CLASS(MachineGun, Weapon) /* ammotype */ ATTRIB(MachineGun, ammo_field, .int, ammo_nails); /* impulse */ ATTRIB(MachineGun, impulse, int, 3); /* flags */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN); -/* rating */ ATTRIB(MachineGun, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(MachineGun, bot_pickupbasevalue, float, 7000); /* color */ ATTRIB(MachineGun, wpcolor, vector, '1 1 0'); /* modelname */ ATTRIB(MachineGun, mdl, string, "uzi"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 00f729b11..a6e8cac47 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -4,7 +4,7 @@ CLASS(MineLayer, Weapon) /* ammotype */ ATTRIB(MineLayer, ammo_field, .int, ammo_rockets); /* impulse */ ATTRIB(MineLayer, impulse, int, 4); /* flags */ ATTRIB(MineLayer, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(MineLayer, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(MineLayer, bot_pickupbasevalue, float, 7000); /* color */ ATTRIB(MineLayer, wpcolor, vector, '0.75 1 0'); /* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 56338da17..0ea0f1b1b 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -4,7 +4,7 @@ CLASS(Mortar, Weapon) /* ammotype */ ATTRIB(Mortar, ammo_field, .int, ammo_rockets); /* impulse */ ATTRIB(Mortar, impulse, int, 4); /* flags */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(Mortar, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(Mortar, bot_pickupbasevalue, float, 7000); /* color */ ATTRIB(Mortar, wpcolor, vector, '1 0 0'); /* modelname */ ATTRIB(Mortar, mdl, string, "gl"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index 37d8e0e23..d75b1fe8d 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -4,7 +4,7 @@ CLASS(Rifle, Weapon) /* ammotype */ ATTRIB(Rifle, ammo_field, .int, ammo_nails); /* impulse */ ATTRIB(Rifle, impulse, int, 7); /* flags */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN); -/* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000); /* color */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0'); /* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 20f5995e5..0f4891837 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -4,7 +4,7 @@ CLASS(Seeker, Weapon) /* ammotype */ ATTRIB(Seeker, ammo_field, .int, ammo_rockets); /* impulse */ ATTRIB(Seeker, impulse, int, 8); /* flags */ ATTRIB(Seeker, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(Seeker, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(Seeker, bot_pickupbasevalue, float, 5000); /* color */ ATTRIB(Seeker, wpcolor, vector, '0.5 1 0'); /* modelname */ ATTRIB(Seeker, mdl, string, "seeker"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 823aac11c..17d055fe4 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -4,7 +4,7 @@ CLASS(Shockwave, Weapon) /* ammotype */ //ATTRIB(Shockwave, ammo_field, .int, ammo_none); /* impulse */ ATTRIB(Shockwave, impulse, int, 2); /* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC); -/* rating */ ATTRIB(Shockwave, bot_pickupbasevalue, float, BOT_PICKUP_RATING_LOW); +/* rating */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000); /* color */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0'); /* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index f6d730fcb..e597665c5 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -4,7 +4,7 @@ CLASS(Shotgun, Weapon) /* ammotype */ ATTRIB(Shotgun, ammo_field, .int, ammo_shells); /* impulse */ ATTRIB(Shotgun, impulse, int, 2); /* flags */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC); -/* rating */ ATTRIB(Shotgun, bot_pickupbasevalue, float, BOT_PICKUP_RATING_LOW); +/* rating */ ATTRIB(Shotgun, bot_pickupbasevalue, float, 6000); /* color */ ATTRIB(Shotgun, wpcolor, vector, '0.5 0.25 0'); /* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 09d050833..988ee7355 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -3,7 +3,7 @@ CLASS(Tuba, Weapon) /* impulse */ ATTRIB(Tuba, impulse, int, 1); /* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH); -/* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID); +/* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000); /* color */ ATTRIB(Tuba, wpcolor, vector, '0 1 0'); /* modelname */ ATTRIB(Tuba, mdl, string, "tuba"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 3e2575838..de2edbeef 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -4,7 +4,7 @@ CLASS(Vaporizer, Weapon) /* ammotype */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Vaporizer, impulse, int, 7); /* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN); -/* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000); /* color */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1'); /* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex"); #ifdef GAMEQC diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 34d9fb8dd..abb84008e 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -4,7 +4,7 @@ CLASS(Vortex, Weapon) /* ammotype */ ATTRIB(Vortex, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Vortex, impulse, int, 7); /* flags */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN); -/* rating */ ATTRIB(Vortex, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH); +/* rating */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000); /* color */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1'); /* modelname */ ATTRIB(Vortex, mdl, string, "nex"); #ifdef GAMEQC diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 32559afbc..5f3bd4b39 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -1051,11 +1051,11 @@ void havocbot_goalrating_kh(entity this, float ratingscale_team, float ratingsca } } if(!head.owner) - navigation_routerating(this, head, ratingscale_dropped * BOT_PICKUP_RATING_HIGH, 100000); + navigation_routerating(this, head, ratingscale_dropped * 10000, 100000); else if(head.team == this.team) - navigation_routerating(this, head.owner, ratingscale_team * BOT_PICKUP_RATING_HIGH, 100000); + navigation_routerating(this, head.owner, ratingscale_team * 10000, 100000); else - navigation_routerating(this, head.owner, ratingscale_enemy * BOT_PICKUP_RATING_HIGH, 100000); + navigation_routerating(this, head.owner, ratingscale_enemy * 10000, 100000); } havocbot_goalrating_items(this, 1, this.origin, 10000);