Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize first time vs. refresh aggro calls from NPCEvent handler #430

Open
MikeJeffers opened this issue Nov 11, 2021 · 0 comments
Open
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

Comments

@MikeJeffers
Copy link

MikeJeffers commented Nov 11, 2021

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.

@MikeJeffers MikeJeffers added performance Difficulty: Moderate This issue is non-trivial but still well-defined but maybe broader scope Priority: Low This ticket is not part of any forseen need or upcoming roadmap item labels Nov 11, 2021
@clouths clouths moved this to BACKLOG in Game Server Dec 17, 2023
@clouths clouths moved this from BACKLOG to Checkup in Game Server Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: Checkup
Development

No branches or pull requests

1 participant