User Tag List

Page 1 of 21 1 2 3 11 ... LastLast
Results 1 to 10 of 205

Thread: Easy Pathfinding Widget (extensionless)

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)

    Lightbulb Easy Pathfinding Widget (extensionless)

    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:
    Attachment 18107


    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.

    Presetting
    (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:


    "pathfind"


    required arguments:
    -object_ID
    -my_X
    -my_Y
    -target_X
    -target_Y

    output:
    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)


    "path_steps"

    required arguments:
    -object_ID
    -my_X
    -my_Y

    output:
    -OUT_total_steps
    -OUT_next_X
    -OUT_next_Y
    -OUT_current_step


    "show_path"


    required arguments:
    -object_ID
    -my_X
    -my_Y

    optional arguments:
    -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

    output:
    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



    Exporters:
    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:
    http://lizardking.co/easy_path_widget/
    (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?

    Android:
    https://www.dropbox.com/s/b3a32tyqcp...droid.apk?dl=0
    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

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,420
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    There seems to be a bug (pardon the pun) with the bottom active, if you set a path with another active then double click the bottom active it heads for the left top corner and ignores the walls. Awesome example none the less

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,112
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    crazy stuff! great work mate.

    I don't have time to look at it closely or test on Android, but just having a glance through the behavior of the easy pathfind engine, there are quite a lot of fast loops... loops seem to be pretty taxing on the Android exporter.. it looks like some of them could be taken out (like print path) I'm not sure if it would be enough to save it though.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Thanks for your input guys!
    There are still many bugs and I'm sorry to bring up such a rushed example,
    but I thought it was nice and promising so shared it even if a little in early stage

    @ Aenever:
    Yeah, sometimes someone misses and heads to top left, will look into that!
    This should be more a "example" fault (and more because I made it for multiple objects at the same time)
    rather then a proper "engine" fault, there are probably better ways to take advantage of the engine output
    and use it in pathfinding than the one I used in the example

    @ DaveC:
    Yeah, there are definitely many fastloops in there!
    Do you think having many fastloops may be causing the "system failure" on Android?
    If this is the reason, can't see no way to make it work on Android, sadly
    Print path is surely optional, but I don't think the other tasks can be performed without "some" loops

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Awesome example as usual, Schrodinger.
    I tested the apk on my Samsung Galaxy Note II.

    I didn't test the apk you provided since it gave me an error 'same name/conflicting signature is already installed', I generated a new apk from the original file with the following specs: build api 22, opengl es 3.0.

    The example works with stable FPS (59/60), but it crashes frequently. I noticed the following things:

    - for the first touches, as long as they are done on a cell that is not too distant from the active spider, the example work flawlessly. Sometimes after the first 2 touches the spider doesn't move anymore (it looks like it trembles, ignoring any subsequent touch)
    - when you touch a cell that is too distant from the active spider, the example always crashes, also at the first touch. (Maybe there are too many loops involved?)

    If you need me to test other examples, let me know!

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Thank you very much Faber!
    I will try building with your same specs and see how it behaves on the android emulator.
    These frequent crashes are the main problem for sure,
    but the fact that a correct path is anyway created makes me think it can be fixed.

    The problem seems related to longer loops, indeed, maybe the limited capabilities of devices can't handle this?
    Is anyone aware of limitations in looping, something like max number of operations per iteration / max number of iterations...?
    Also, is there any issue with arrays and android I should be aware of?

    The "trembling spider" I think is due to the last path step not being in sync with item current step,
    It happens also on windows build sometimes, I'll have to check if it's a fault of the engine or of the example!

    I'll probably try start "simpler" on the exported examples,
    and make a pathfind code for a single object,
    in order to see if/when things broke and get more esily where the issue may be.


    Btw, I've had another idea to implement:
    I'll probably add a "make trail" function,
    would create a series of numbered/signed "trail items" to follow for each object,
    thus making the pathfinding code more solid,
    reduce the "fastloop" calls to only one per path (against one per path step),
    and make adding a pathfind code as quick as a couple events.
    But I'll need an extra object to embed with the engine, to make things cleaner and avoid overcoding,
    and this would probably be bad with exporters, again, because I've often heard they are not so good with object creation

    I'll test this but not before monday I fear...


    EDIT:
    meanwhile, a slightly improved mfa here:
    Attachment 18110
    (avoid same paths being blitted multiple times, as wrongly happened in previous example, making things messy)

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,420
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Legendary example and generosity

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    > The problem seems related to longer loops, indeed, maybe the limited capabilities of devices can't handle this?
    > Is anyone aware of limitations in looping, something like max number of operations per iteration / max number of iterations...?

    I'm no expert in this field so I cannot give a definitive answer to this. But I remember that I tried to converted to apk Sketchy A* pathfinding's example (which is extensionless, as well) and it wasn't subject to crashes, even with longer paths, only to an unbearable slowness/low FPS on mobile platform.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Thanks aenever too kind,
    I'm actually having fun doing this and it was overall rather quick to do,
    happy to share if useful
    (And also taking advantage of other's expertise in exporters!)


    @ faber: I've seen Sketchy's wonderful example before but I don't have that right now,
    and I've never checked in depth the method he used (and can't seem to find that example in his downloads anymore)
    but I can remember/guess he is using a lot of loops too, so this may very well be good news!

    Today I'm short of time, but hopefully tomorrow I will try removing extra things (like blitting)
    and tune down the example's multi-object code,
    will try to catch where conflicting things lurk

    Also, is anyone aware of problems with behaviours and exporters?
    I remember first quick exporting test gave better results when I took out the code from the pathfinding object behaviour,
    both for HTML5 and Android.

    (sorry if these questions maybe should be posted in exporters forum, but I'm asking for general hints on most/all exporters)

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    MEHRDAD's Avatar
    Join Date
    Jan 2009
    Location
    Iran
    Posts
    465
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great works schrodinger
    I tested it with Flash exporter and i didn't see any bug. Also it works for me on Sony Z1 too.

    This is a great engine for pathfinding solution on Fusion as cross platform.
    Thanks so much

Page 1 of 21 1 2 3 11 ... LastLast

Similar Threads

  1. Multiple pathfinding with Pathfinding Object
    By Erkabubben in forum Fusion 2.5
    Replies: 12
    Last Post: 16th July 2017, 07:54 PM
  2. Pathfinding
    By Limyr in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th November 2012, 09:58 PM
  3. pathfinding example
    By method72 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th June 2012, 08:23 PM
  4. 3D menu Widget - Wild Widget Contest entry
    By Czentnar in forum Widgets
    Replies: 16
    Last Post: 26th March 2011, 12:51 AM
  5. The Digit Widget [WIP] (multi-widget)
    By Raylax in forum Widgets
    Replies: 1
    Last Post: 13th December 2008, 11:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •