Opened 5 years ago

Closed 5 years ago

#5541 closed defect (fixed)

Unit fleeing trying to go back to attacker when attacker moving in close proximity.

Reported by: Freagarach Owned by: wraitii
Priority: Should Have Milestone: Alpha 24
Component: Simulation Keywords: UnitAI, chasing, regression
Cc: wraitii Patch:

Description (last modified by Freagarach)

On A24 (rP22554).

When attacking a melee unit (B) on fleeing stance with a melee horse (A), sometimes, when unit A is close to unit B, unit B tries to go back towards unit A. Running into A's chasing arms again.

This is easy to verify:

  • Attack a melee unit on fleeing stance with a melee horse.
  • See the above described behaviour.

Attachments (1)

commands.txt (13.0 KB ) - added by Freagarach 5 years ago.
Replay.

Download all attachments as: .zip

Change History (8)

by Freagarach, 5 years ago

Attachment: commands.txt added

Replay.

comment:1 by wraitii, 5 years ago

I don't find it extremely clear how to reproduce this or what exactly you find wrong.

I do see an oddity sometimes with units trying to go back, I think that's going straight to target that predicts that target movement, putting the enemy predicted in front of us, which can perhaps be fixed.

comment:2 by Freagarach, 5 years ago

That is indeed what I meant. Unrelated to the second attack but only to the proximity of the chasing unit.

comment:3 by Freagarach, 5 years ago

Description: modified (diff)

comment:4 by Freagarach, 5 years ago

wraitii, I just checked the fleeing behaviour on A23b, this does not occur there, just for your information.

comment:5 by elexis, 5 years ago

Keywords: regression added

comment:6 by Freagarach, 5 years ago

Description: modified (diff)
Summary: Fleeing is weird.Unit fleeing trying to go back to attacker when attacker moving in close proximity.

comment:7 by wraitii, 5 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 22885:

Fix units sometimes turning around when fleeing (introduced by D1987/rP22431)

D1987/rP22431 introduced logic to predict the target movement, which fixed unit chasing. However, sometimes fleeing units would then predict that their target will end up in front of them, so they turned around towards the attacker.

This is fixed by not anticipating the position when it would cause the vector towards to target to change direction.

Reported By: Freagarach

Tested By: Freagarach

Fixes #5541

Differential Revision: https://code.wildfiregames.com/D2275

Note: See TracTickets for help on using tickets.