This was definitely more a couple days than a couple hours
(and there are still fixes and additions to do...)
good news: the "easy algorithm" works good, and I think the engine is quite handy
bad news: not sure it's cross platform... need your help to make sure see below
Here the mfa with a little example included:
How it works
calculates a path between 2 points in a square grid environment,
detecting backdrop obstacles
The engine is embedded in the "easy path engine" object behaviour,
to port in your application, just need to borrow this object and the "easy path array" object.
(in easy path engine alt. values):
just enter GRID X and GRID Y size
and select if you need 4 or 8 directions
How to use
The engine currently contains three main functions.
To use those, you must invoke them and pass to them the required parameters.
Invoking a function here means launching a loop with its specific name 1 times.
Passing parameters here means setting engine object's required alt. values just prior to invoke the loop.
After calling the functions, you'll get a different output, depending on the function invoked.
List of currently available functions:
this function calculates a path between my_ and target_ coordinates
must be run in order to use any of the other function
(creates an entry in the array with all pathfinding steps)
-node_color: RGB coefficient
-flag 0 on: active path (off blits path) </ currently not working, must be kept off behaviour to use it I fear
-flag 1 on: show only remaining path (off show all)
-you can alter easy_path object blend coefficient to alter path translucency
-flag255 on: clear blitted path
flag 0 off= blits path onto background
flag 0 on= creates a path of active objects nodes
flag 255 on= deletes selected object's blit path
Now, I've bought two exporters just few months ago and almost never used,
so I still have never investigated on limitations, and I have no clue on what may be broken...
but something clearly is
You can try HTML5 version here:
(brokes when selecting multiple objects
broken blit-path color)
But single pathfinding works, so I guess -at least- pathfinding code works good,
I should probably check for object selection issues in the example code,
any hint on what usually brokes HTML5 exports?
I actually don't own and android device, so I tested on a PC emulator...
and pathfinding works - but hangs very often!
Any suggestions on what are the most common issues to check in order to fix it for android?
And there are overall other problems to fix (i.e. not-reachable zones hang the system with endless loops...)
and much more tests to do for performances (bigger levels, more objects)
but it's been a quick ride and in the future I'll work more to improve this
meanwhile, any suggestion or input (on the exporters or anything else) is much appreciated