Hi. I'm projecting a builder game of sorts, and I'm having doubts on the core pathfinding function. Lemme explain:
I have an environment defined by an array with two Z levels. The first one is for tiles (1 or 0), the other one is for entities (by ID).
The environment is defined by either 4x4 rooms, 2x4 corridors, or 3x3 corners. All connections are on a grid.
I want an entity to first scan for points where it wants to go and then plot possible paths to said destinations. Once it has done that, decide for the shortest path (eg, "I'm at 3,5, there's a point at 10,6 and another one at 6,10, which one is the shortest accounting for the shape of the playing field?).
The pathfinding function included in construct2 is not really cutting it for me, because it moves the sprite along a grid. What I want is to run it for every possible destination, and return a length in tiles *before* moving it, as the game will be rendering every .3 seconds and I need the entities to move one tile every time the game renders. I would also need to be able to stop it and re-run it if the path became obstructed while the entity is on the move.
Really filthy casual developer here, so any pointers would be appreciated.
Thanks.