Page MenuHomeWildfire Games

UnitMotion - Additional chasing fixes
ClosedPublic

Authored by wraitii on Jan 27 2021, 3:58 PM.

Details

Reviewers
None
Commits
rP24800: UnitMotion - Additional chasing fixes
Trac Tickets
#5936
Summary

Using a better test map, I've noticed two subsequent issues with chasing.

  • First, units take turn while turning, and though rP24708 gave some additional leeway, this still wasn't enough sometimes. I've added a check to skip the first long waypoint in some cases, which should avoid the worst of the problem.
  • Secondly, and I didn't notice this in rP24708, because units predict the target's position if their ID is higher (see D3230), but the problem only exists while processing movements, the "PathingUpdateNeeded" check failed on PathResult in some cases. This meant the "follow known bad path" hack activated, and that led units to have sub-optimal speed, which made it impossible to get in range of the 'direct movement' mechanic, which meant chasing failed.

The latter issue is fixed by:

  • Removing a 'distance' modulation introduced in rP22474 which I don't really understand / doesn't seem necessary (no words in the commit message).
  • Making sure that the interpolation doesn't take place outside of its designated area, using a boolean. It's ugly, but meh.
Test Plan

Still run the test map.

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

wraitii created this revision.Jan 27 2021, 3:58 PM
wraitii requested review of this revision.Jan 27 2021, 4:11 PM
wraitii added inline comments.Jan 27 2021, 4:23 PM
source/simulation2/components/CCmpUnitMotion.cpp
1376 ↗(On Diff #15721)

Can't follow a known-bad path if there's no path to follow. I'm tempted to make this 1 waypoint anyways.

1382 ↗(On Diff #15721)

This is the bit from rP22474. Don't really see why it would be here, but it effectively reduces all distance estimates by DIRECT_PATH_RANGE, which just seems wrong.

(straight pathfing doesn't care anyways, it replaces the waypoints regardless, so this path recompilation logic is not needed)

wraitii updated this revision to Diff 15731.Jan 27 2021, 6:48 PM

Rerun on CI

Build is green

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2_dbg.a(precompiled.o) has no symbols
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.framewor

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

wraitii updated this revision to Diff 15740.Jan 27 2021, 8:05 PM

Remove unused variable

This revision was not accepted when it landed; it landed in state Needs Review.Jan 27 2021, 8:13 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.

Build is green

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2_dbg.a(precompiled.o) has no symbols
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.framewor

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