Skip to content

Conversation

@D8H
Copy link
Collaborator

@D8H D8H commented Feb 21, 2021

(this PR is based on the PR for isometry, so it can't be merged, it's just to open the discussion)

This is a custom build of GDevelop 5 beta 110 with this change:
https://www.dropbox.com/s/mp5sry99aflw9yv/gdevelop-iso-path-beta110-2021-05-16.7z?dl=1

I did some refactoring on the path finding behavior.
I split a code that was in a mono-block into this:

  • AStarPathFinder is the path finding algo alone
  • NodeEvaluator says which node is passable and it's cost
  • GridGraph is the graph data structure
  • Grid hold the grid model:
    how nodes must be linked to one another
    coordinates <-> node index mapping

The whole thing is independent from the PathFindingRuntimeBehavior so it will allow to write new extensions based on the path finding.

  • the grid interface allows to implements other grids like hexagonal grids for instance.
  • the NodeEvaluator allows to define what make a good path. So other strategy can be implemented. For instance, let say you want to implement an extension for enemies that avoid light you would only have to implement a new evaluator that tweak the cost and rely on the existing one for collisions.

PathFindingCD

@D8H D8H force-pushed the RefactorPathFinding branch 7 times, most recently from 6418d54 to 9ba67f5 Compare March 3, 2021 00:40
@D8H D8H force-pushed the RefactorPathFinding branch 2 times, most recently from a3f381c to 24867c5 Compare March 14, 2021 18:16
@D8H D8H force-pushed the RefactorPathFinding branch 2 times, most recently from 9e28a6f to bb2dcab Compare March 26, 2021 21:07
@D8H D8H marked this pull request as ready for review March 26, 2021 21:14
@D8H D8H requested a review from 4ian as a code owner March 26, 2021 21:14
@D8H D8H force-pushed the RefactorPathFinding branch from bb2dcab to e203c32 Compare April 5, 2021 11:44
@D8H D8H force-pushed the RefactorPathFinding branch from e203c32 to c1e849e Compare May 14, 2021 12:13
D8H added 10 commits June 10, 2021 01:29
Make tests more concise


Run format on tests


Report changes from legacy tests on new tests


Add the collisionMethod property in the maze example


Clean debug code


Run format


Move the test function in describe


Fix documentation


Deduce the isometric angle from the cell dimensions


Correct the cell height when choosing isometry

And raise an explicit exception
Fix Ploygon.deepClone typing
@D8H D8H force-pushed the RefactorPathFinding branch from c1e849e to ad3ccfe Compare June 9, 2021 23:38
@D8H D8H changed the title Refactor of the Path Finding extension [PathFinding] Refactor Jun 10, 2021
@D8H D8H marked this pull request as draft June 10, 2021 20:53
@4ian 4ian force-pushed the master branch 2 times, most recently from 8a32fc5 to 846afd9 Compare August 30, 2025 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant