Opened 12 years ago

Last modified 8 years ago

#1468 new defect

Use the pathfinder to perform distance checks — at Version 6

Reported by: andrew123 Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords: pathfinding, patch, beta
Cc: Patch:

Description (last modified by Itms)

In this situation (acropolis map), workers finish a tree, and the closest one is downhill so they leave the base.

It would be nice to compute the actual move cost instead of the distance in this type of situation.

Change History (7)

by andrew123, 12 years ago

Attachment: screenshot0007.jpg added

comment:1 by historic_bruno, 12 years ago

It's hard to tell what's going on in your screenshot due to the perspective. In my tests, units always choose the nearest tree, but it may not be the shortest walking distance (it only tests straight line / as-the-crow-flies distance). This works well enough in most cases. Maybe the new pathfinder design will make it feasible to search for the nearest resource by walking distance.

comment:2 by FeXoR, 12 years ago

It is not always the best to get the resource closest to the depleted one gathered from before but to choose the resources of that type with the shortest distance to the building the resources are brought to. Since the first target to gather from is a player given command - and I think this should be higher priority than any wild guesses - it may still be the better choice to take the resource closest to the last on gathered from. However, the point the player gave the order to would be even better for minimizing the distance to - though that point would have to be stored somewhere then even if there's no entity left there.

comment:3 by Deiz, 12 years ago

The root issue being that the distance-to-target used is simply a comparison of positions. That case only works well for open maps, and come to think of it, it's probably a large part of why the AI tends to stumble majorly on Acropolis-style maps.

To my knowledge, the current pathfinder doesn't expose any distance information, so there's no trivial way to compute actual walking distance to a target.

comment:4 by Stan, 9 years ago

Keywords: pathfinder added
Milestone: BacklogAlpha 19

Pushing it to A19 since its related to pathfinder

comment:5 by Itms, 9 years ago

Keywords: pathfinding added; pathfinder removed

comment:6 by Itms, 9 years ago

Description: modified (diff)
Milestone: Alpha 19Backlog
Summary: Tree collector are leaving base when nearest tree plant is endedUse the pathfinder to perform distance checks
Note: See TracTickets for help on using tickets.