Sorry, if it is mentioned somewhere, but searching the forum i did not find general facts about it. (only the "there should be better pathfinding ingame"-threads without proposals)
And also excuse my bad english, please.
There seems to be 2 different coordinate-systems used ingame: "tiles" and "real" - coordinates.
Building uses the "tiles" and pathfinding and moving the "real". But also there never 2 units on 1 tile together. Only because they are mainly at the border of tile it seems they share one.
As far as i perceived the pathfinding works with the real coordinates and to avoid collisions with structures the units move mainly on the apart side of the neighbored tile. But there are no units bigger then a tile (correct me if wrong) and no structures reaches over in other tiles so collision is excluded by passing through the tile midway also.
And now my suggestions:
If a collision is detected and not easily solved, the unit(s) retreats to the middle of tile and from this position a new path is generated. So the involved unit(s) has a distance to the point of collision and maybe the next path is not leading to collision. This could solve "traffic jam".
The endpoints of movement should be in the middle of a tile, so a unit passing a neighbored tile cant collide so easily.
Likewise all striking points in path (corners, bottlenecks or the like) should be in the middle.
Maybe there should be some "checkpoints" in the path, from where the route to next point is checked for barriers and if one a new partial path is generated.
Sadly i have no idea of the sourcecode and sparsely in programming...
path finding
-
Kaldera
- Trained

- Posts: 49
- Joined: 20 Jun 2008, 22:04
- Location: Germany
path finding
Windows 7 RC / Athlon 64 X2 / NVIDIA GeForce 8600 GT
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: path finding
There is no limitation that there can only be one unit on a tile at any time. In fact, I think cyborgs can easily do this.
I do not think merely trying to get to the tile center and recalculate the same paths will do much good.
The biggest problems with path-finding at the moment are, I believe, that sometimes units get stuck, and that sometimes units collide into a huge tangle because some units try to get out of the base while others try to return to repair. We need to establish some kind of anti-congestion strategy, like for example congestion weighting for tiles and adding such weights to path-finding when generating routes, and adding right of way rules, for example that units returning for repair must yield if they meet units that are on their way to fight.
I do not think merely trying to get to the tile center and recalculate the same paths will do much good.
The biggest problems with path-finding at the moment are, I believe, that sometimes units get stuck, and that sometimes units collide into a huge tangle because some units try to get out of the base while others try to return to repair. We need to establish some kind of anti-congestion strategy, like for example congestion weighting for tiles and adding such weights to path-finding when generating routes, and adding right of way rules, for example that units returning for repair must yield if they meet units that are on their way to fight.
-
Kaldera
- Trained

- Posts: 49
- Joined: 20 Jun 2008, 22:04
- Location: Germany
Re: path finding
You are right. After trying about an hour i got managed to have 2 cyborgs standing on one tile, but not other units.Per wrote:There is no limitation that there can only be one unit on a tile at any time. In fact, I think cyborgs can easily do this.
Now i have found the developer-wiki: http://developer.wz2100.net/wiki/PathFinding
"traffic rules" seems to be a good way, but where yield the minor unit to? That is the main question i think. Mostly they got stuck because they collide. And so there must be a better handling for this situation first. Or an strategy to avoid collisions anyway.
Windows 7 RC / Athlon 64 X2 / NVIDIA GeForce 8600 GT
-
whippersnapper
- Regular

- Posts: 1183
- Joined: 21 Feb 2007, 15:46
Re: path finding
.
-- PF probs are not all reducible to collision detection or "rules of the road"..
-- Many attributable to that part of Unit AI which I call "ranging-detection-response" behavior.
-- Let me give an example.
-- Trucks range to un-capped oil resources. If they detect within 4 tiles and there is no close access path
they will get stuck at that spot trying to reach the unreachable and if enough trucks are captured on that
event horizon then they can precipitate a long-jam of other units just trying to make their way through
that passage. In the making of new maps this is easily dealt with by the know-how of the map makers in
their placement of oil resources. In the case of legacy maps - short of re-placing or creating access ramps
I don't know what the solution would be short of altering the "ranging metrics" with a "time-cut-off"..
-- Much PF probs can be dealt with preemptively in the map-making phase through the use of balanced
player ID assignment placements. I have yet to see any map maker deliberately make use of this power
in their designs working within EW. Too bad because it really does not have to fall on the shoulders of
PF source code evolution to substantively mitigate most of these PF issues - map makers do indeed have
the tools in EW get the job done.
- Regards, whipper
.
-- PF probs are not all reducible to collision detection or "rules of the road"..
-- Many attributable to that part of Unit AI which I call "ranging-detection-response" behavior.
-- Let me give an example.
-- Trucks range to un-capped oil resources. If they detect within 4 tiles and there is no close access path
they will get stuck at that spot trying to reach the unreachable and if enough trucks are captured on that
event horizon then they can precipitate a long-jam of other units just trying to make their way through
that passage. In the making of new maps this is easily dealt with by the know-how of the map makers in
their placement of oil resources. In the case of legacy maps - short of re-placing or creating access ramps
I don't know what the solution would be short of altering the "ranging metrics" with a "time-cut-off"..
-- Much PF probs can be dealt with preemptively in the map-making phase through the use of balanced
player ID assignment placements. I have yet to see any map maker deliberately make use of this power
in their designs working within EW. Too bad because it really does not have to fall on the shoulders of
PF source code evolution to substantively mitigate most of these PF issues - map makers do indeed have
the tools in EW get the job done.
- Regards, whipper
.
.
"I need no warrant for being, and no word of sanction upon my being. I am the warrant and the sanction." Anthem
"Art is the selective recreation of reality according to the artist's metaphysical value judgments." A. Rand
.
"I need no warrant for being, and no word of sanction upon my being. I am the warrant and the sanction." Anthem
"Art is the selective recreation of reality according to the artist's metaphysical value judgments." A. Rand
.