[performance] server_and_bot_init_phase_patch2 (#653)

This commit is contained in:
bash
2024-10-29 14:26:18 +01:00
committed by GitHub
parent 76994ae3c0
commit b83cdf2057

View File

@@ -4254,7 +4254,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
} }
// Bots do not need to move using PathGenerator. // Bots do not need to move using PathGenerator.
if (activityType == DETAILED_MOVE_ACTIVITY) return false; //if (activityType == DETAILED_MOVE_ACTIVITY) return false;
// All exceptions are now done, below is the code to have a specified % of bots // All exceptions are now done, below is the code to have a specified % of bots
// active at all times. The default is 10%. With 0.1% of all bots going active // active at all times. The default is 10%. With 0.1% of all bots going active
@@ -4307,21 +4307,18 @@ uint32 PlayerbotAI::SmartScaleActivity(ActivePiorityType type, uint32 botActiveA
case ActivePiorityType::PLAYER_FRIEND: case ActivePiorityType::PLAYER_FRIEND:
case ActivePiorityType::PLAYER_GUILD: case ActivePiorityType::PLAYER_GUILD:
case ActivePiorityType::IN_ACTIVE_MAP: case ActivePiorityType::IN_ACTIVE_MAP:
if (maxDiff > 200) return 10; if (maxDiff > 200) return 25;
if (maxDiff > 150) return 25;
if (maxDiff > 100) return 50; if (maxDiff > 100) return 50;
if (maxDiff > 50) return 80; if (maxDiff > 50) return 80;
break; break;
case ActivePiorityType::IN_VERY_ACTIVE_AREA: // Many bots nearby. Do not do heavy area checks. case ActivePiorityType::IN_VERY_ACTIVE_AREA: // Many bots nearby. Do not do heavy area checks.
case ActivePiorityType::IN_NOT_ACTIVE_MAP: case ActivePiorityType::IN_NOT_ACTIVE_MAP:
if (maxDiff > 100) return 10; if (maxDiff > 100) return 25;
if (maxDiff > 50) return 25; if (maxDiff > 50) return 50;
else return 30;
case ActivePiorityType::IN_EMPTY_SERVER: case ActivePiorityType::IN_EMPTY_SERVER:
return 10; return 25;
default: default:
if (maxDiff > 200) return 10; if (maxDiff > 200) return 25;
if (maxDiff > 150) return 25;
if (maxDiff > 100) return 50; if (maxDiff > 100) return 50;
break; break;
} }