Page MenuHomeWildfire Games

Fix Attacked message in IDLE
ClosedPublic

Authored by Silier on Jan 31 2021, 3:58 PM.

Details

Summary

Issue described in #5945.
Unit finishing the order such as walking, will reach destination and if attacked, imediately reacts to the attacker.
Hovewer, more desireble is for unit to look around since entering idle state and pick the target if any using preference and then react to attacker.
This issue rised up after finding of new targets have been moved from enter to timer to avoid infinite loops after alwaysenterstate logic removal.

Only downside here is unit will receive few hits before reacting as we are waiting to the timer first. This happens only if unit goes idle.

Test Plan

Notice that in the replay, hero will not any longer target cc but units around him.
Sadly it will go oos soon but effect is clearly fixed.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Silier published this revision for review.Jan 31 2021, 3:58 PM
Silier created this revision.

Build is green

builderr-debug-macos.txt
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking.
ld: warning: text-based stu

See https://jenkins.wildfiregames.com/job/macos-differential/3126/display/redirect for more details.

I'm not sure we should wait for idleness to react actually. That few hits may be more annoying in a pitched battle than the described edge-case.

I'm not sure we should wait for idleness to react actually. That few hits may be more annoying in a pitched battle than the described edge-case.

Units wouldn't end up in IDLE from the ATTACKING state though, so in a pitched battle this likely wouldn't be an issue.

Silier added a comment.Feb 1 2021, 2:11 PM

imagine soldier walking to the pitch battle and as soon as arrives it gets shot by some archer far behind melee troops, it will march towards the archer instead of picking units around him at first.

Freagarach accepted this revision.Feb 1 2021, 2:21 PM

Point taken. We'll see the exact consequences I guess.

This revision is now accepted and ready to land.Feb 1 2021, 2:21 PM
This revision was automatically updated to reflect the committed changes.