Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Trucks get stuck around structures instead of proceeding to next destination #3050

Closed
wzdev-ci opened this issue Jan 10, 2012 · 20 comments
Closed

Comments

@wzdev-ci
Copy link
Contributor

keyword_Pathfinding resolution_fixed type_bug | by JDW


Order a whole bunch of trucks to build five factories or five research facilities in a straight row. Some trucks get stuck at the completed structure while the rest of the structures proceed to the remaining orders in queue.

Version SDL


Issue migrated from trac:3050 at 2022-04-16 08:46:41 -0700

@wzdev-ci
Copy link
Contributor Author

JDW uploaded file wz2100-20120110_191851-Sk-ColosseumWZ-T1.jpg (160.3 KiB)

wz2100-20120110_191851-Sk-ColosseumWZ-T1.jpg

@wzdev-ci
Copy link
Contributor Author

JDW uploaded file wz2100-20120110_192541-Sk-ColosseumWZ-T1.jpg (156.4 KiB)

wz2100-20120110_192541-Sk-ColosseumWZ-T1.jpg

@wzdev-ci
Copy link
Contributor Author

cybersphinx changed title from Trucks get stuck around structures instead of proceeding to next destination to Units want to reach their destination exactly and often fail

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


I think this is one manifestation of a generic pathfinding problem.

For example, load the savegame, the selected group has two waypoints, one to the right, one to the left. They go towards the right, and while the first unit to reach it then goes on to the next one, the remaining units shuffle around it for quite a while. In this case, they will eventually proceed to the second waypoint (except for the last unit, which seems quite content staying at the first), but I've seen cases where the group shuffles around for minutes never getting anywhere.

Another example similar to JDW's: Select group 0 (the three trucks), make them return to HQ and shift-click somewhere else. They will shuffle around the border of the HQ's baseplate for minutes, not reaching the center, and basically ignore the next waypoint.

@wzdev-ci
Copy link
Contributor Author

cybersphinx uploaded file Kansas City Shuffle.zip (48.9 KiB)

@wzdev-ci
Copy link
Contributor Author

Cyp commented


Actually, I was in that test game.

The trucks were pathfinding (seen with Control+M) through the structure on the way to the next one.

I suspect it's due to the trucks ignoring any structures on the source tile, and the trucks somehow having ended up slightly on top of the previous structure, at the time of doing pathfinding to the next structure.

(P.S. I'm pretty sure this particular issue is unrelated to whether the backend is Qt or SDL. I was using the Qt backend, though.)

@wzdev-ci
Copy link
Contributor Author

cybersphinx changed title from Units want to reach their destination exactly and often fail to Trucks get stuck around structures instead of proceeding to next destination

@wzdev-ci
Copy link
Contributor Author

cybersphinx commented


I think the basic problem is the same as #2996, maybe needs a different solution though.

@wzdev-ci
Copy link
Contributor Author

Cyp commented


Only ignore buildings at pathfinding destination, not source.

Trucks would build a factory, then pathfind through it on the way to the next
factory, and get stuck driving into the newly-built factory.

See 0119eda53f11d2aa5d3e3ccc82203c6657812039.

Fixes #3050.

  • Changeset: [/changeset/9cdcadc266ddfa2526a21a4174d4185ca7cc6868 9cdcadc266ddfa2526a21a4174d4185ca7cc6868]
  • URL: [9]cdcadc266ddfa2526a21a4174d4185ca7cc6868

@wzdev-ci
Copy link
Contributor Author

Cyp changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

Cyp changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

NoQ changed status from closed to reopened

@wzdev-ci
Copy link
Contributor Author

NoQ changed resolution from fixed to ``

@wzdev-ci
Copy link
Contributor Author

NoQ commented


I keep seeing this problem in the latest git; i think trucks mostly get stuck when they try to construct modules.

@wzdev-ci
Copy link
Contributor Author

NoQ commented


I think i only see this in my javascript AI tests, not in real game. Might it be that the problem remains only when DORDER_BUILD orders are issued via javascript?

@wzdev-ci
Copy link
Contributor Author

Cyp changed status from reopened to closed

@wzdev-ci
Copy link
Contributor Author

Cyp changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

Cyp commented


Fix trucks trying to drive into completed buildings instead of towards the building site.

More generally, check that the returned pathfinding result is for the correct
destination, rather than an old pathfinding job to a previous destination, leading
to the droid thinking it was going to the new destination when it really wasn't.

Droids were doing pathfinding, and occasionally they would pathfind to a building,
which happens to get completed in the same update, so next update they would try
to pathfind to the new building in the queue, but receive the path to the completed
building. They would then continue to drive into the old building, until arriving
at the new building (which never happens).

Probably fixes other issues with droids mysteriously going the wrong way.

Fixes #3050 again (different bug, but similar symptom).

  • Changeset: [/changeset/89e0a8f538e55d7cd8a604e2ae6125884bc7a7ec 89e0a8f538e55d7cd8a604e2ae6125884bc7a7ec]
  • URL: [89]e0a8f538e55d7cd8a604e2ae6125884bc7a7ec

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 4, 2012

Cyp commented


Only ignore buildings at pathfinding destination, not source.

Trucks would build a factory, then pathfind through it on the way to the next
factory, and get stuck driving into the newly-built factory.

See 0119eda53f11d2aa5d3e3ccc82203c6657812039.

Fixes #3050.

  • Changeset: [/changeset/9cdcadc266ddfa2526a21a4174d4185ca7cc6868 9cdcadc266ddfa2526a21a4174d4185ca7cc6868]
  • URL: [9]cdcadc266ddfa2526a21a4174d4185ca7cc6868

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Aug 4, 2012

Cyp commented


Fix trucks trying to drive into completed buildings instead of towards the building site.

More generally, check that the returned pathfinding result is for the correct
destination, rather than an old pathfinding job to a previous destination, leading
to the droid thinking it was going to the new destination when it really wasn't.

Droids were doing pathfinding, and occasionally they would pathfind to a building,
which happens to get completed in the same update, so next update they would try
to pathfind to the new building in the queue, but receive the path to the completed
building. They would then continue to drive into the old building, until arriving
at the new building (which never happens).

Probably fixes other issues with droids mysteriously going the wrong way.

Fixes #3050 again (different bug, but similar symptom).

  • Changeset: [/changeset/89e0a8f538e55d7cd8a604e2ae6125884bc7a7ec 89e0a8f538e55d7cd8a604e2ae6125884bc7a7ec]
  • URL: [89]e0a8f538e55d7cd8a604e2ae6125884bc7a7ec

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant