Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Potential/Flowfield pathfinding #35

Closed
Barsonax opened this issue Oct 30, 2017 · 1 comment
Closed

Implement Potential/Flowfield pathfinding #35

Barsonax opened this issue Oct 30, 2017 · 1 comment
Assignees
Milestone

Comments

@Barsonax
Copy link
Owner

Barsonax commented Oct 30, 2017

Summary

Implement flow and potential field pathfinding. The flowfield should be created by using the potential field.

Analysis

Both:

  • Efficient multi agent pathfinding.
  • Robust in the sense that if a unit somehow gets pushed from the path it will find its way back without problems.
  • The naïve implementation that will calculate the field for the entire map will use up more cpu and memory than necessary. This could be made more efficient by only doing a high level hierarchical astar search to determine which parts of the map are needed. Caching fields will also be more complex as you could have a incomplete field. However this requires a lot more work as no such nodenetwork or algorithm has been implemented yet in pathfindax. For now stick to the simple implementation.
  • Can and should be cached based on the targetnode, clearance and agentsize (the startnode does not matter). This will reduce memory usage and increase performance.

PotentiaField:

  • Less performant than flowfields since the actual heading at a position has to be calculated by checking all neighbours and picking the one with the highest potential. Still this are just a couple of array lookups so its still quite fast. The difference might even be unnoticeable in many cases.
  • Dynamic pathfinding if agents can emit their own potential field that's added to the potential field values when figuring out the heading.

FlowField:

  • Highly performant once the field has been calculated. Getting the heading for a particular agent at a particular position is basically an array lookup.
  • if you constrain the directions to 248 different directions and 1 for the Vector.Zero then it will only take 1 byte per node to store a flowfield if you use a separate lookup array for these values.
  • Basically what you would get if you asked the heading of every node in a potential field and store this in an array.
@Barsonax Barsonax added this to the v1.7 milestone Oct 30, 2017
Barsonax added a commit that referenced this issue Oct 31, 2017
Barsonax added a commit that referenced this issue Nov 1, 2017
Barsonax added a commit that referenced this issue Nov 2, 2017
Barsonax added a commit that referenced this issue Nov 2, 2017
Barsonax added a commit that referenced this issue Nov 3, 2017
…etter cohesion. Remove nongrid and grid pathfinder proxies as only 1 is needed now
Barsonax added a commit that referenced this issue Nov 3, 2017
Barsonax added a commit that referenced this issue Nov 8, 2017
@Barsonax Barsonax changed the title Implement hierarchical pathfinding Implement Flowfield pathfinding Nov 9, 2017
Barsonax added a commit that referenced this issue Nov 10, 2017
Barsonax added a commit that referenced this issue Nov 12, 2017
Barsonax added a commit that referenced this issue Nov 13, 2017
Barsonax added a commit that referenced this issue Nov 16, 2017
Barsonax added a commit that referenced this issue Nov 16, 2017
Barsonax added a commit that referenced this issue Nov 16, 2017
…istance so the GCost values are now always normalized. Changed the dynamic potentials to use a nonlinear function. Still have to tweak and cleanup this further.
Barsonax added a commit that referenced this issue Nov 17, 2017
Barsonax added a commit that referenced this issue Nov 17, 2017
Barsonax added a commit that referenced this issue Nov 17, 2017
Barsonax added a commit that referenced this issue Nov 17, 2017
Barsonax added a commit that referenced this issue Nov 17, 2017
Barsonax added a commit that referenced this issue Nov 18, 2017
Barsonax added a commit that referenced this issue Nov 18, 2017
Barsonax added a commit that referenced this issue Nov 18, 2017
…e to a pathfindercomponent and fixed unit tests
@Barsonax Barsonax changed the title Implement Flowfield pathfinding Implement Potential/Flowfield pathfinding Nov 19, 2017
@Barsonax Barsonax self-assigned this Nov 19, 2017
@Barsonax
Copy link
Owner Author

Implemented

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

No branches or pull requests

1 participant