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
Core/Movement: Correct the allowed distance to target before a repositioning is necessary. #20173 #21193
Core/Movement: Correct the allowed distance to target before a repositioning is necessary. #20173 #21193
Conversation
The interesting research here is to decide if the distance should be adjusted depending on the target situation. Or even, make an algorithm to search for the most suitable point to move, that is, the point in which it should be attacking the target, not the one that is closer. Many ideas come, yet regarding this PR, I think its a nice improvement to the current situation. Though take a look into what I said first, making the distance sort of dynamic depending on the situation. |
Slightly unrelated to the PR: I was thinking a couple of days ago if we should use the result of MeleeAttacks/Spells about the target being out of range/out of LoS and handle it next update instead of proactively checking every now and then (100 ms) if the target is still in range/in LoS. For now reducing the distance sounds good enough. Could you please change the "4.0f / 3.0f" magic numbers to something more self-explainatory ? even a #define keeping the same formula would be good, at first sight it's not clear what 4 and 3 mean in that context. |
b8caae8
to
648ed25
Compare
I made a mistake in the new distance to check. It is fixed now. This guarantees that the target will always be in melee range. @ccrs I'm not sure I understand what you mean in the first part. @jackpoz Regarding the magic numbers, it is no longer need after latest changes. Regarding your first point, it could be an interesting optimization. The only downside that I see is that if the chaser and the target have the same speed, the target will be able to kite the mover by alternating between moving and stopping (thus getting in and out of range, making the attack miss time to attack). Which is a downside of the current implemenation as well. |
6805c7a
to
94cc016
Compare
…tioning is necessary. TrinityCore#20173 Also getting rid of the wordserveur config parameter 'TargetPosRecalculateRange' since it is no longer needed.
94cc016
to
8c168a9
Compare
All the remaining points are solved. Imo, it's ready to be merged. Will merge in a few days if no further comments. |
What I meant is, whats better, moving to the point in which we exactly are in melee range, or move half the distance closer so the repositioning is less likely? That is, if the conditions are met, we detect a slope or obstacles or w/e. But like I said, this is a nice improvement for current state. |
@ccrs It's already the case: NPCs move at |
Correct the allowed distance to target before a repositioning is necessary. #20173
Also getting rid of the wordserver config parameter 'TargetPosRecalculateRange' since it is no longer needed.
Changes proposed:
Let's say a creature needs to AA a non-moving unit:
The waiting is an optimization, used in order to reduce the number of times the path is recomputed when the target is moving. The issue is as follow: the threshold's value was too high. The target could move away to a certain distance, outside of melee range and the mover will not reposition.
With this PR, this is now fixed. The threshold new value is correctly set to the melee attack range.
I'm also talking about the issue HERE and HERE.
Target branch(es):
master. Maybe?
Issues addressed: Closes #20173
Tests performed: Tested IG with a melee attacker (The Lich King in The Frozen Throne)
Known issues and TODO list: