[performance] new baseline (#644)

This commit is contained in:
bash
2024-10-29 01:15:26 +01:00
committed by GitHub
parent b061f0016c
commit 3cd68c6dec
8 changed files with 115 additions and 172 deletions

View File

@@ -292,11 +292,6 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/)
if (!sPlayerbotAIConfig->randomBotAutologin || !sPlayerbotAIConfig->enabled)
return;
if (sPlayerbotAIConfig->botActiveAloneSmartScale)
{
ScaleBotActivity();
}
uint32 maxAllowedBotCount = GetEventValue(0, "bot_count");
if (!maxAllowedBotCount || (maxAllowedBotCount < sPlayerbotAIConfig->minRandomBots ||
maxAllowedBotCount > sPlayerbotAIConfig->maxRandomBots))
@@ -318,6 +313,7 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/)
// when server is balancing bots then boost (decrease value of) the nextCheckDelay till
// onlineBotCount reached the AllowedBotCount.
setIsBotInitCompleted(onlineBotCount < maxAllowedBotCount);
uint32 updateIntervalTurboBoost = onlineBotCount < maxAllowedBotCount ? 1 : sPlayerbotAIConfig->randomBotUpdateInterval;
SetNextCheckDelay(updateIntervalTurboBoost * (onlineBotFocus + 25) * 10);
@@ -402,27 +398,6 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/)
}
}
void RandomPlayerbotMgr::ScaleBotActivity()
{
float activityPercentage = getActivityPercentage();
// if (activityPercentage >= 100.0f || activityPercentage <= 0.0f) pid.reset(); //Stop integer buildup during
// max/min activity
// % increase/decrease wanted diff , avg diff
float activityPercentageMod = pid.calculate(sRandomPlayerbotMgr->GetPlayers().empty() ?
sPlayerbotAIConfig->botActiveAloneSmartScaleDiffEmpty :
sPlayerbotAIConfig->botActiveAloneSmartScaleDiffWithPlayer,
sWorldUpdateTime.GetAverageUpdateTime());
activityPercentage = activityPercentageMod + 50;
// Cap the percentage between 0 and 100.
activityPercentage = std::max(0.0f, std::min(100.0f, activityPercentage));
setActivityPercentage(activityPercentage);
}
uint32 RandomPlayerbotMgr::AddRandomBots()
{
uint32 maxAllowedBotCount = GetEventValue(0, "bot_count");