2019-09-19 17:40 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006206Spring engineGeneralpublic2019-05-08 10:41
ReporterGoogle_Frog 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version104.0 +git 
Summary0006206: 104.0.1-1752-g139d66b develop Units move towards too-distant path waypoints
DescriptionI have some units that skip nearby path waypoints to move towards distant points in bad situations. This causes them to try to path over a steep cliff.
Additional InformationGame: https://github.com/GoogleFrog/SpringCraft/commit/67ab51434ebb267a830a9906bc93e6bbf2c3f04b
Map: http://zero-k.info/Maps/Detail/55567
TagsNo tags attached.
Checked infolog.txt for lua ErrorsYes
Attached Files

-Relationships
+Relationships

-Notes

~0019946

Google_Frog (reporter)

The issued goes away with avoidMobilesOnPath = false. When units are set to avoid mobiles they change their heading, which possibly makes this check fail more often: https://github.com/spring/spring/blob/develop/rts/Sim/MoveTypes/GroundMoveType.cpp#L1571

My current theory is that there is a typo on this line, that the 'and' should be an 'or': https://github.com/spring/spring/blob/develop/rts/Sim/MoveTypes/GroundMoveType.cpp#L1594

Changing the 'and' to an 'or' seems to resolve the issue without breaking the intended behaviour. I assume that the intended behaviour is for units to skip waypoints along unobstructed terrain without skipping over corners they they need to take.

~0019947

Google_Frog (reporter)

The issue also occurs in ZK with 104.0.1-1156-gb72a9cc maintenance. I think it is a bit harder to notice on units with low turn rates.

~0019948

Kloot (developer)

Does not smell like a typo: if the range-test fails but skipping the waypoint is still allowed (e.g. because cwp happens to be within SQUARE_SIZE elmos of pos), CanSetNextWayPoint should not return false.

I may create a branch for this if you want to run ZK on it.

~0019949

Google_Frog (reporter)

In that case perhaps the required check is:
!((pos - cwp).SqLength() <= Square(SQUARE_SIZE)) && (!rangeTest || !(pos - cwp).dot(flatFrontDir) < 0.0f)

Nobody has noticed this so far so I don't see the need to proliferate the branches.

~0019984

Google_Frog (reporter)

I made a PR: https://github.com/spring/spring/pull/455/files
+Notes

-Issue History
Date Modified Username Field Change
2019-04-18 06:14 Google_Frog New Issue
2019-04-18 06:14 Google_Frog File Added: pathing.jpg
2019-04-18 10:23 Google_Frog File Added: andOrResolution.jpg
2019-04-18 10:23 Google_Frog Note Added: 0019946
2019-04-18 10:28 Google_Frog File Added: zkTerrainTurnIssue.jpg
2019-04-18 10:28 Google_Frog Note Added: 0019947
2019-04-18 12:13 Kloot Note Added: 0019948
2019-04-18 15:09 Google_Frog Note Added: 0019949
2019-05-07 05:08 Google_Frog Note Added: 0019984
2019-05-08 10:41 Kloot Status new => resolved
2019-05-08 10:41 Kloot Resolution open => fixed
2019-05-08 10:41 Kloot Fixed in Version => 104.0 +git
+Issue History