Revert "Make AutoScaleActivity further configurable (#766)" (#798)

This reverts commit 66f0cf27d3.
This commit is contained in:
bash
2024-12-19 00:41:33 +01:00
committed by GitHub
parent 66f0cf27d3
commit ea1ec98645
4 changed files with 13 additions and 40 deletions

View File

@@ -1530,19 +1530,9 @@ AiPlayerbot.BotActiveAloneForceWhenInGuild = 1
# Specify smart scaling is enabled or not.
# The default is 1. When enabled (smart) scales the 'BotActiveAlone' value.
# Only when botLevel is between WhenMinLevel and WhenMaxLevel.
#
# AiPlayerbot.botActiveAloneDiff
# Method: 1 - Check against average Diff
# Method: 2 - Check against Max Diff (spikes)
#
# LimitFloor - No active bot decrease below this DIFF
# LimitCeiling - Max active bot decrease above this DIFF
AiPlayerbot.botActiveAloneSmartScale = 1
AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel = 1
AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel = 80
AiPlayerbot.botActiveAloneSmartScaleDiffMethod = 2
AiPlayerbot.botActiveAloneSmartScaleDiffLimitFloor = 40
AiPlayerbot.botActiveAloneSmartScaleDiffLimitCeiling = 150
# Premade spell to avoid (undetected spells)
# spellid-radius, ...
@@ -1553,6 +1543,7 @@ AiPlayerbot.MaxRandomBotsPriceChangeInterval = 172800
AiPlayerbot.MinRandomBotChangeStrategyTime = 180
AiPlayerbot.MaxRandomBotChangeStrategyTime = 720
# How often tasks are changed
AiPlayerbot.MinGuildTaskChangeTime = 172800
AiPlayerbot.MaxGuildTaskChangeTime = 432000

View File

@@ -4352,22 +4352,10 @@ bool PlayerbotAI::AllowActivity(ActivityType activityType, bool checkNow)
uint32 PlayerbotAI::AutoScaleActivity(uint32 mod)
{
uint32 diffLimitFloor = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitFloor;
uint32 diffLimitCeil = sPlayerbotAIConfig->botActiveAloneSmartScaleDiffLimitCeiling;
uint32 chkDiff = (sPlayerbotAIConfig->botActiveAloneSmartScaleDiffMethod == 2)
? sWorldUpdateTime.GetMaxUpdateTime()
: sWorldUpdateTime.GetAverageUpdateTime();
uint32 maxDiff = sWorldUpdateTime.GetAverageUpdateTime();
if (diffLimitFloor > diffLimitCeil)
diffLimitFloor = diffLimitCeil;
if (chkDiff <= diffLimitFloor) return mod;
if (chkDiff >= diffLimitCeil) return 0;
uint32 diffRange = diffLimitCeil - diffLimitFloor;
double spread = (double)diffRange / 5; // Calculate the equal spread between each number /w 5 steps
if (chkDiff > diffLimitFloor + (4 * spread))
if (maxDiff > 500) return 0;
if (maxDiff > 250)
{
if (Map* map = bot->GetMap())
{
@@ -4387,10 +4375,10 @@ uint32 PlayerbotAI::AutoScaleActivity(uint32 mod)
return (mod * 1) / 10;
}
if (chkDiff > diffLimitFloor + (3 * spread)) return (mod * 2) / 10;
if (chkDiff > diffLimitFloor + (2 * spread)) return (mod * 4) / 10;
if (chkDiff > diffLimitFloor + (1 * spread)) return (mod * 7) / 10;
if (chkDiff > diffLimitFloor + (0 * spread)) return (mod * 9) / 10;
if (maxDiff > 200) return (mod * 3) / 10;
if (maxDiff > 150) return (mod * 5) / 10;
if (maxDiff > 100) return (mod * 6) / 10;
if (maxDiff > 75) return (mod * 9) / 10;
return mod;
}

View File

@@ -476,11 +476,10 @@ bool PlayerbotAIConfig::Initialize()
BotActiveAloneForceWhenIsFriend = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenIsFriend", 1);
BotActiveAloneForceWhenInGuild = sConfigMgr->GetOption<bool>("AiPlayerbot.BotActiveAloneForceWhenInGuild", 1);
botActiveAloneSmartScale = sConfigMgr->GetOption<bool>("AiPlayerbot.botActiveAloneSmartScale", 1);
botActiveAloneSmartScaleDiffMethod = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAloneSmartScaleDiffMethod", 2);
botActiveAloneSmartScaleDiffLimitFloor = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAloneSmartScaleDiffLimitFloor", 40);
botActiveAloneSmartScaleDiffLimitCeiling = sConfigMgr->GetOption<int32>("AiPlayerbot.BotActiveAloneSmartScaleDiffLimitCeiling", 150);
botActiveAloneSmartScaleWhenMinLevel = sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1);
botActiveAloneSmartScaleWhenMaxLevel = sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel", 80);
botActiveAloneSmartScaleWhenMinLevel =
sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMinLevel", 1);
botActiveAloneSmartScaleWhenMaxLevel =
sConfigMgr->GetOption<uint32>("AiPlayerbot.botActiveAloneSmartScaleWhenMaxLevel", 80);
randombotsWalkingRPG = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG", false);
randombotsWalkingRPGInDoors = sConfigMgr->GetOption<bool>("AiPlayerbot.RandombotsWalkingRPG.InDoors", false);

View File

@@ -263,20 +263,15 @@ public:
bool disableRandomLevels;
uint32 playerbotsXPrate;
bool disableDeathKnightLogin;
uint32 botActiveAlone;
uint32 BotActiveAloneForceWhenInRadius;
bool BotActiveAloneForceWhenInZone;
bool BotActiveAloneForceWhenInMap;
bool BotActiveAloneForceWhenIsFriend;
bool BotActiveAloneForceWhenInGuild;
bool BotActiveAloneForceWhenInGuild;
bool botActiveAloneSmartScale;
uint32 botActiveAloneSmartScaleWhenMinLevel;
uint32 botActiveAloneSmartScaleWhenMaxLevel;
uint32 botActiveAloneSmartScaleDiffMethod;
uint32 botActiveAloneSmartScaleDiffLimitFloor;
uint32 botActiveAloneSmartScaleDiffLimitCeiling;
bool freeMethodLoot;
int32 lootRollLevel;