Skip to content

DungeonRoute: opt-in dynamic targeting (dungeon_route_dynamic_targeting)#11630

Open
Azortharion wants to merge 1 commit into
midnightfrom
dynamic-route-targeting
Open

DungeonRoute: opt-in dynamic targeting (dungeon_route_dynamic_targeting)#11630
Azortharion wants to merge 1 commit into
midnightfrom
dynamic-route-targeting

Conversation

@Azortharion

@Azortharion Azortharion commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Adds dungeon_route_dynamic_targeting (default 0). With the option off nothing changes: same-seed DPS is bit-identical to master across DungeonRoute, DungeonSlice, HecticAddCleave and Patchwerk test runs.

With it on, during DungeonRoute pulls:

  • player_t::acquire_target picks the living mob with the highest current HP instead of the first entry in target_non_sleeping_list. A 1s child event on the pull re-checks between deaths, and a 5% hysteresis band keeps the current target unless the candidate visibly leads it, so near-equal mobs dying together do not cause target flickering.
  • Actions are allowed to swap off a still-alive target when the priority mob changes. Channels in progress and explicit target_number lines still pin.
  • prioritydps counts damage into the current highest-hp mob instead of BOSS_-prefixed mobs.

Reasoning: the current behavior parks the player on the head of the HP-sorted spawn list until that mob dies, and the swap-with-back erase in target_non_sleeping_list then retargets to the smallest survivor rather than the next-biggest. A player pushing keys attacks whatever gates the end of the pull, which is the highest-hp mob at that moment, and equalized death times are the fastest clear since AoE is more efficient than single target. On a fitted ~30 min route with an MM hunter this measured route length -4.5%; a two-mob crossover pull went from deaths 91s apart to 1.6s apart and finished 17% sooner.

…ng=1 attacks the highest-current-hp mob (1s re-check) instead of the spawn-list head, and prioritydps counts damage into that mob instead of BOSS_ tags. Default off, no behavior change unless enabled.
@Azortharion
Azortharion force-pushed the dynamic-route-targeting branch from a2b3f86 to 6da84b7 Compare July 24, 2026 13:31
@Azortharion
Azortharion requested a review from gastank July 24, 2026 13:34
@renanthera

renanthera commented Jul 24, 2026

Copy link
Copy Markdown
Member

Why is this feature conditioned on the fight style being dungeon route? I feel like it'd be useful in all fight styles and the extra condition doesn't contribute anything.

This also can be handled in-apl with judicious use of targetif.

@Azortharion

Azortharion commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Why is this feature conditioned on the fight style being dungeon route? I feel like it'd be useful in all fight styles and the extra condition doesn't contribute anything.

This also can be handled in-apl with judicious use of targetif.

I was a bit terrified of making a PR/contribution that would have any effect on anything outside of the narrow scope of "Hunter stuff", so it was important for me to make this opt-in.

If y'all think it's good enough to branch out to other fight styles, all the better, but that was my reason for giving it a narrow scope.

Target_if goes a long way but will not, for example, re-target pets for BM Hunters and so on. It also makes the APL harder to read, I think.

Comment thread engine/player/player.cpp
if ( is_enemy() )
{
sim->active_enemies--;
sim->target_non_sleeping_list.find_and_erase_unordered( this );

@Jayezi Jayezi Jul 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would bet most of the gain from the new option would be covered by simply fixing this erase with one that preserves the order, assuming the existing smart targeting sort option is used it will correctly result in targeting down the highest to lowest mobs until dead (still only based on starting health order, but the post-fix gain of dynamically checking remaining hp would probably be minor in comparison).

Suggested change
sim->target_non_sleeping_list.find_and_erase( this );

Otherwise I share the same sentiment about having the apl be the authority on retargeting outside of inevitable retargets like invulvn, demise etc. Ideally apls get every chance to make sure they are not being forced into very suboptimal targets swaps, such as significant debuffs/dots maintained on targets that will be lost.

This would imo better be accomplished with whatever adjustment to apl capability is needed for it to be able to do the retargeting on its own terms and direct pets as needed, like the retarget_auto_attack action some classes use

retarget_auto_attack_t( player_t* player, util::string_view options_str ) :

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The erase is worth fixing regardless of this PR.

I measured your ordered version against the option (PR) on the six Hunter specs: on its own it's a minority of the gain (-0.3% to +3.2% by spec, against +4.4% to +10.6% for the option), and it doesn't touch pets or the prioritydps accounting. Default, opt-in, or not at all is the maintainers' call. I built it opt-in and off by default, so it costs nothing to leave in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants