User Tag List

Page 7 of 21 FirstFirst ... 5 6 7 8 9 17 ... LastLast
Results 61 to 70 of 205

Thread: Easy Pathfinding Widget (extensionless)

  1. #61
    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)
    Yes this is a "design" choice, because an unreachable cell or area could led to "ambiguities" in paths,
    but something could be tried, depending on exactly what you need,
    when you click on an obstacle you would like the character to pathfind to the last step in path before that obstacle?

    Would require some modification to the engine.

    If you need it let me know, I may take a look during the week I guess.

  2. #62
    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)
    when you click on an obstacle you would like the character to pathfind to the last step in path before that obstacle?
    Exactly. And keep last direction too and stick to obstacle.Please modify it for turn character walking example that you made it for me. I want use it for an adventure point and click game like Monkey Island .It's important while user want click anywhere even on non walkable areas (obstacles).

    Thanks so much for your hard works schrodinger. It's really brilliant source .

  3. #63
    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)
    Mmmm looks like it's definitely not trivial

    We should tell the engine to ignore obstacles - but which ones should he ignore?
    Only the last ones --> ones adjacent to the target point?
    But then again --- up to which extent?

    I.e. consider following example, you want to pathfind to the "red square"
    but where should the character stop, here?

    path1.jpg

    or here?

    path2.jpg

    or...?

    Somewhere along nearest "non obstacle" cell found around the target maybe,
    but this again could led to errors i.e. if nearest non-obstacle cell is on the opposite side of a wall,
    character would make all way to the other side when you would (maybe) expect it to stop in the front of the wall..

    Something can be tried along these lines but it's a bit of work and not sure about results.

    Simplest approach would be switching the pathfinding target cell when one clicks on an obstacle,
    firing a loop to test all adjacent cells until a non-obstacle is found, and then fire the pathfind to that cell.

    I could provide an example for this, but the risk is this wouldn't be correct in all situations.

    If someone has other ideas to suggest they would be welcome

  4. #64
    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)
    For a point and click adventure game, people expect the path finding won't be 100% correct, especially if you click to walk to an area where you can't travel. I think the solution of finding the nearest empty cell would suffice. When I'm playing a point and click adventure, I find myself constantly clicking and adjusting the destination of the player, because they never walk exactly how you'd expect. Careful map-design would also avoid any major problems, I've never seen a point and click game with hugely elaborate maze like rooms.. it's generally just a couple of obstacles and some bounding walls.

  5. #65
    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)
    Yeah, you're definitely right,
    my latest adventures played dates back to Day of the Tentacle probably,
    I had fun back then with many lucas titles and can't remember complex paths in any of those.
    Not sure if most of them had pathfinding at all, either? Maybe yes... and maybe with pretty big grids.

    Will put up the example (hopefully) tomorrow trying this way and see what happens!
    -if you think it would be suitable, Mehrdad-

  6. #66
    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)
    Yes . It's right .Find nearest empty cell is Ok. Please only add click on obstacles for move to nearest cell. Adventure gamers clicks on all of the rooms. You suppose we have a simple room with a wall. user click on wall as it's obstacle and character go and stop under target.

    Thanks again

  7. #67
    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)
    Ok just added a pretty quick "spiral checking" code,
    will check all adjacent cells in a spiral
    and find first non obstacle to pass to the pathfinding code

    checking will proceed in counter clockwise direction, in this way:



    So if you click on the "X" cell, the first non-obstacle position found will be the bottom-right one you see above (last one pointed by the arrow)

    you can customize the dimension of this spiral checking just by changing "find_empty_cell" fastloop number of iterations
    (in the code below is 4= 9x9 cells checked)

    Here's the example, the spiral code lies in the aptly named group:



    As you see, this suffers from the issue I was mentioning:
    since the spiral always starts from the bottom right cell,
    will end up targeting cells on the opposite sides of walls from the ones you would like more.

    But as DaveC says, this may not be an issue in an adventure game like yours,
    when obstacle zones are big and paths are plains.

    I hope you don't need it for "closed" zones also,
    because I think it would be a bit more complex to setup
    (the approach I would suggest is filling closed zones you may have with "dummy" obstacles)

  8. #68
    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)
    Thanks a lot Schrodinger
    It's nice but I still have problem with wall problem. Please make room with a only one line straight empty cell for walking left and right .Other cells with full of obstacles. Now it accept below obstacles for move and upper obstacles haven't reaction.Also it doesn't stand exactly under the click .

  9. #69
    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)
    this is probably because you should extend the spiral dimension (fire loop 10-20 times) to encompass wider obstacle area,
    but this will led to undesired results, as shifting too far on the bottom right
    could be possibly fixed by testing distance also and choosing nearest free empty cell to player

    But would result in additional processing,
    this approach is likely more suitable for smaller "chunks" of obstacles.

    If your game is like you described,
    i.e. a straight line with full obstacle above and below,
    I wold use a completely different approach,
    like saving Xmouse
    and testing nearest free Y below or above
    it's simpler than the spiral and lighter
    but would fit only this specific situation

    then you could use combined approaches tailored on your game zones

    if you can provide a sketch of how your game level would look like
    (just black for obstacle and white for empty)
    I can maybe think something else more suitable / provide another example

  10. #70
    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)
    I easiest way for left and right in the one of room :



    My game have 640X360 resolution ( Maybe 2x later 1280X720 HD)
    I tested it in your example . please fill up and down of scene with obstacles with a empty line cell like the image.

Page 7 of 21 FirstFirst ... 5 6 7 8 9 17 ... 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
  •