Improved the performance and intelligence of resource harvesting by
refactoring the Harvesters' pathfinding. Now they in first place assess which is the closest resource inside their search area and then a path is calculated Changed the way harvesters find resources by always trying to find the closest resource to their refinery. Changed the strategy of finding to find resources in Annulus.
This commit is contained in:
@@ -110,6 +110,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
public bool Debug { get; set; }
|
||||
string id;
|
||||
protected Func<CPos, int> heuristic;
|
||||
protected Func<CPos, bool> isGoal;
|
||||
|
||||
// This member is used to compute the ID of PathSearch.
|
||||
// Essentially, it represents a collection of the initial
|
||||
@@ -194,8 +195,7 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
|
||||
public bool IsTarget(CPos location)
|
||||
{
|
||||
var locInfo = Graph[location];
|
||||
return locInfo.EstimatedTotal - locInfo.CostSoFar == 0;
|
||||
return isGoal(location);
|
||||
}
|
||||
|
||||
public abstract CPos Expand();
|
||||
|
||||
Reference in New Issue
Block a user