Optimize first time vs. refresh aggro calls from NPCEvent handler #430
Labels
Difficulty: Moderate
This issue is non-trivial but still well-defined but maybe broader scope
performance
Priority: Low
This ticket is not part of any forseen need or upcoming roadmap item
This: https://github.com/OpenPerpetuum/PerpetuumServer/blob/Development/src/Perpetuum/Services/EventServices/EventProcessors/NpcSpawnEventHandlers/NpcReinforcementSpawner.cs#L115-L124
Gets called every update from here:
https://github.com/OpenPerpetuum/PerpetuumServer/blob/Development/src/Perpetuum/Services/EventServices/EventProcessors/NpcSpawnEventHandlers/NpcReinforcementSpawner.cs#L62-L77
Where the update is debounced messages from onDamage to a Boss npc.
However, this eventually calls into code that further communicates aggro to all NPC's in the
@group
of the npc the threat was added to.Basically this is a N^3 maybe 4 loop of threat adding that can get out of hand with larger wave spawns and larger player groups on the threat manager of the boss.
Spreading the aggro once on spawn is good, refreshing the aggro to the wave-npcs when the boss is attacked (but maybe the wave-spawned NPCs have since dropped aggro on some player) is good. But worst case this is doing a lot of redundant threat increasing when it may not be necessary.
Test carefully to ensure aggro on waves is not lost completely and players can evade the waves and attack the boss directly.
The text was updated successfully, but these errors were encountered: