Just want to give heads up about the current progresses on this.
I've been working the past hours on another possible way to represent grid tiles regards to these conditions:
- Tiles can either be fully walkable/fully unwalkable.
- Tiles can be partially walkable, meaning that they can be crossed in specific directions.
- The overall should remain simpler.
As Lua (5.1) do not have a native bitwise operations library (and I didn't want to rely on an external C lib), I used David Manura's bit.numerlua module, from wich I ripped some functions i needed (bit.band, bit.bor, see file attached - note that I don't know much of bitwise operations, i'll be happy to have some feedback about that, thanks).
I made lots of changes internally. Well the algorithm remains the same (A* + Jump Point Search), but on the top of that, some rules to discard expanding search process on nodes that cannot be crossed in specific directions.
The results are clearly awesome. See the relevant screenshots below.
On this first series of screenshots, you can see the pathfinder in action, with diagonal moves allowed. Note that on the second screenshot, one tile was found passable following the north-south direction, then the pathfinder chooses it.
Here is the same situation, with only straight moves allowed.
Side note, I haven't released this modified version yet, as i'm actually trying to design a simple public interface that will let the user alter easily tiles passability rules, without having to mess with bitwise ops... Once I get this done, i'll be pushing it on a separated branch on Github repository.
Thanks reading.