Page MenuHomeWildfire Games

Unit Motion: Revert vertex pathfinder changes from 2015 or so
ClosedPublic

Authored by wraitii on May 7 2017, 10:42 AM.

Details

Reviewers
Itms
temple
elexis
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22465: Vertex pathfinder: add the domain edges back to improve behaviour (reverts…
Summary

This adds back the "domain" edges to the short/vertex pathfinder. Not having them leads to weird paths in a few edge cases, and this particularly breaks with the new group-walk manager I'm implementing for D13.

I believe this is more or less a reversion to 2015 state.

Test Plan

Order a few units to walk around with the pathfinder overlay applied and noticed the domain edges have appeared. Test pathing, should work.

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.May 7 2017, 10:42 AM
Stan added a subscriber: Stan.May 7 2017, 1:20 PM
Stan added inline comments.
source/simulation2/components/CCmpPathfinder_Vertex.cpp
559 ↗(On Diff #1705)

Comments start with caps.

560 ↗(On Diff #1705)

I think you can get rid of "The" as it's general. The whole sentence doesn't feel really english though.

Vulcan added a subscriber: Vulcan.May 7 2017, 3:30 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/1049/ for more details.

@Itms this is still buggy and should be easily mergeable.

wraitii added a reviewer: Restricted Owners Package.Nov 1 2017, 6:01 PM
temple added a subscriber: temple.Nov 6 2017, 6:11 PM
temple added inline comments.
source/simulation2/components/CCmpPathfinder_Vertex.cpp
561–564 ↗(On Diff #1705)

In rP17197 you added epsilons here, are they needed again?
In rP17224 your removed these lines to fix #3593, will that become a bug again?

628 ↗(On Diff #1705)

QUADRANT_TR, I assume

wraitii added inline comments.Nov 6 2017, 6:58 PM
source/simulation2/components/CCmpPathfinder_Vertex.cpp
561–564 ↗(On Diff #1705)

Hm, the epsilons might be needed again, I honestly have no idea.

Re rP17224, I am quite positive that this was the result of other odd behaviour in the unit Motion that has since been changed (or at least will be changed in D13), but I honestly have no idea.

I think this might still introduce an odd behaviour where units cannot cross a wall of other units though... I actually haven't tested that entirely, so I'll need to do it.

temple added a comment.Nov 6 2017, 8:09 PM

I was just cleaning up my screenshots and saw an example of the unlocked but closed gate bug, where units keep trying to get around a wall that they can't actually get around. (It's the enemy's gate, so it won't open for this unit.) So the gate's probably acting the same as a wall of units, and what should happen in this case is the short path should say impossible to reach, thus get a bigger range or give up. But instead because there's no domain edges it paths around the wall, outside the domain. When that short path fails because the unit runs into the wall, he asks for another short path which repeats all of this in the other direction.

(Haven't actually tested that adding back the domain edges fixes that, it's just my reading of the code.)

temple added a comment.Nov 6 2017, 8:19 PM

(Maybe could add the domain square to the debug overlay.)

Yeah that's the bug alright.

You can see the domain edges by using the pathfinder overlay, but it only keeps one path so your unit has to be the only one moving (kind of annoying).

In D443#39934, @wraitii wrote:

You can see the domain edges by using the pathfinder overlay, but it only keeps one path so your unit has to be the only one moving (kind of annoying).

Right, sorry. I was thinking in a22 where the domain edges don't exist.

I tried the patch, looks fine, and I agree we should be restricting the paths to inside the domain square.
I don't think epsilons have any purpose.
Units can get stuck but that has to be fixed in unit motion, not here.

source/simulation2/components/CCmpPathfinder_Vertex.cpp
565 ↗(On Diff #1705)

extra newline

623 ↗(On Diff #1705)

should be two lines imo

624 ↗(On Diff #1705)

same

wraitii updated this revision to Diff 4367.Nov 25 2017, 3:24 PM

Fix issues.

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...
temple accepted this revision.Nov 26 2017, 2:23 AM

Unit motion has problems of course, but I think it's correct to use domain edges here.

This revision is now accepted and ready to land.Nov 26 2017, 2:23 AM
wraitii added a comment.EditedNov 26 2017, 9:38 AM

Given my past experiences with the pathfinder, I'd rather commit this along D13 once it's ready, instead of risking breaking the game weirdly/in new ways in the meantime, as I haven't tested it extensively without D13 (and current pathfinder works well enough that I don't want to lose time doing that.)

Thanks @temple for the reviews.

elexis resigned from this revision.Dec 12 2017, 8:21 PM

Went digging a bit. I think this was removed in the first place because large obstructoions / chains of large obstructions can make short paths fails, resulting in stuck units with svn, and it's better to act a bit wonky than to get stuck.

The issue of 'units getting stuck when short paths can't be returned' was indeed fixed in D13, so I don't think this should be committed until the fundamentals of D13 are.

wraitii updated this revision to Diff 8053.May 18 2019, 11:23 AM
wraitii retitled this revision from D13 prerequisite 7: Revert vertex pathfinder changes from 2015 or so to Unit Motion: Revert vertex pathfinder changes from 2015 or so.

Rebased. This works well with my other unitMotion patches, though it doesn't fix the "unit go to weird places instead of the shortest path" problem which I thought it might :/
.

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/1431/display/redirect

elexis added a subscriber: elexis.May 18 2019, 11:33 AM

changes from 2015 or so

would be good to replace it with a specific reference

wraitii added a comment.EditedJul 13 2019, 5:48 PM

It's actually a revert of rP17224, which is in 2015 :p . The original issue should not be happening with the latest UM changes, since the long-range pathfinder will correctly be called in case of pathing failures.

This revision was automatically updated to reflect the committed changes.