Hi, constructers. I`m experimenting with pathfinding and trying to make some oldschool rpg-style (grid) movement. I have no problems with grid movement, no problems with pathfinding, but no success with combining first and second.
Anyone have any idea how to make character to find path and move along it by grids, not smooth and directly?
I'm having the same kind of problem while combinating grid movement with pathfinding..
I didnt test it yet but maybe one idea could be:
once the path is found you store inside an array all the nodes positions (using NodeCount, NodeAtX etc.. to find them) and then you round these positions according to your grid size (es. 32x32 grid each position is changed to: (floor(x/32)*32)+16 etc..
in this way you obtain a list of nodes positions aligned with the grid and you can have the player move along them.
very frustrating though..
Develop games in your browser. Powerful, performant & highly capable.
Something that I have found and enjoy is the plugin found here:
Its "fast pathfinder." the difference is that the regular one finds a path that's wide enough by calculating a pixel by pixel path.
Fast pathfinder calculates blocking on a grid that you designate the size of. I really like how it works. Check it out.