User Tag List

Page 8 of 21 FirstFirst ... 6 7 8 9 10 18 ... LastLast
Results 71 to 80 of 205

Thread: Easy Pathfinding Widget (extensionless)

  1. #71
    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)
    Try this then, will scan columns (only vertically)
    searching nearest empty cell from clicked target point:

    easy_path_widget_near_Y.mfa

    if your level setup is like your image, should work OK,

    but if you click on upper obstacles of the middle wall, for bottom characters, this won't work
    (because nearest empty cell will be above, in the unreachable zone)

    anyway, if you know what you want from each level,
    it's likely you can obtain it without modifying the pathfinding code,
    (that would be pretty complex to encompass all possible situations)
    but just shifting the target coordinate, like in this example

  2. #72
    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)
    Hey Schrodinger I don't need to empty cells in bottom for THIS room so I filled all of down with obstacles and works perfect now
    I'll use previous modified your examples for another rooms and it's enough for the best result think so.If I had serious another problem write here again.

    I'm really appreciate for your hard works

  3. #73
    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 I think it's going to be the quickest solution,
    making some "hard coded" tricks to fit your level design.

    I think there can be a clean all-range solution inside pathfinding,
    allowing to find nearest non obstacle in path to target obstacle cell
    (>> telling the engine to ignore every -but only- the adjacent obstacle cells to target obstacle cell *should* work, I think)
    but doing so would require some nasty modifications,
    and would be more intensive for the processor too.

    So if you can go with these spot-on solutions, maybe is better for now.

    Glad it was useful, thanks!

  4. #74
    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)
    Ok . sure .Your right . I'll try and ask if I had problem .
    Thanks again .

  5. #75
    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)
    Problem in turning :
    Before character get target if we click an empty block (2 or less or more block) before target we see a wrong turning . Also it seems doing in front of character too . Please press a few click toward a front of target ( or a empty block back too) . You see a sudden turning .
    This issue appear more sometimes not always.

  6. #76
    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)
    I see what you mean, it happens because when you poll for a new path,
    the engine will output all path steps, including starting step (the grid cell where the player is actually in)
    but if the player already got past the center of the cell
    its first step will head toward the center of the cell he is in
    thus resulting in it going shortly backwards, and then heading forward again

    There is a quick fix you can apply for this:



    just add event line 38 before the "follow_node" loop
    it will simply "skip" step 0, so that player will always head to step 1 as first move

    should do the job!

  7. #77
    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!!!. It's fixed now .
    Another questions : Sometimes I want character walking automatically and don't accept any click anymore. For example click on exit object and character leave room with walking. I made this:

    "Target" is overlapping "Exit object" > "Bug" : set internal flag 0 on

    Character walking and pass of Exit object now. But I have two problem :
    1) How do I get stop character when it not overlapping with exit object ? Negate for up code doesn't work
    2) Player pass from obstacles with up code .
    How can I fix this issues?
    ---------------
    Another issue:
    I click on the obstacles like down image .Character move to "This engine" instead "Right place" .Can you fix it?



    --------------
    Chase problem :
    How can I make chase NPC character (Follow) with one empty cell in front or back or down or up or same current player with full random start move and random direction relative to main character?

    Sorry for many requests
    Thanks a lot for your helps Schrodinger

  8. #78
    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)
    You need to stop a character while chasing a path, correct?
    With latest examples we're testing I'd say this is the safest way:

    whenever you want to stop a character (bug)
    >>> set its flag 0 off (this is the flag used in the example to tell if it's following a path)
    >>> set its flag 1 off (this is the flag used in the example to tell if it's moving)
    >>> destroy object "Path node" ---> if you have only one character, there's no scoping to do and you can safely just "destroy",
    otherwise you should destroy the specific path node with the "path_ID" you need to remove (= fixed value of bug object in the example)


    issue 2 (image)
    eh! that's a bit difficult unfortunately
    This lies inside the "maybe better hardcoding a solution" category we were talking about some posts ago
    as a general solution is difficult to think, and potentially intensive.
    I would suggest trying something like this:

    test_path.jpg

    user click on green zone
    >>> pathfind to (x coordinate of first empty grid cells at right of green zone), (ymouse)

    user click on violet zone
    >>> pathfind to (xmouse), (y coordinate of first empty grid cells below violet zone)

    Would require "hard coding" various zones though.
    Again, I think some general solution for this situation could be found,
    but it's quite time consuming and I don't know if/when I could try and can't grant on final result


    chase problem
    :
    I'm sorry I didn't understand what you would need to do here ,
    could you try rephrasing or maybe making a picture?

  9. #79
    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 again Schrodinger problem one solved

    Issue 2 : Unfortunately I couldn't open file attachment . I have invalid Attachment specified.

    For chase problem Please let me more clear:

    Sometimes we want NPC (None Player Character) follow main player. For example he find a friend and chase it in continue of game . I only want a follower for chase main character in full random position and random start move relative to move of main player . similar it:
    If radius of main player is more than 40 pixel > NPC chase main player as walking
    when main character is stop with random stop position(front or back to main character) and random direction

    Sorry for bad English

  10. #80
    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)
    issue 2 - sorry, I was timed out while typing, and copy-pasted the message I was writing,
    the image must have been lost in this way, now I've updated previous post


    chase:
    OK, now I got it, I think this could be coded good without pathfinding:
    simplest idea could be doing something like a "ghost" player following same steps as main player, but delayed by some cell
    like, every grid cell - you could even use the follow path code, when player reaches a "node"-
    append text "x00y00|" (with actual coordinates) to a string, and while player moves, have the "ghost player(s)" chase these checkpoints contextually and in subsequent order

    This would result in no randomness in start/end position though,
    but you would have the big advantage of walking in a surely-correct path,
    since it would have been already walked by the player.

    Another idea, firing a pathfinding code to the chasing character with the same destination target as the player, when the player reaches node 2 (this will delay by two cells)
    and destroying following character nodes when its node number = total nodes -2
    again, this won't give the randomness in positions, unless you add some other tricks
    (a simple one could be shifting target end position to left or right of player, after checking if these cells are empty)

    I could maybe do an example of second idea if you need, should be quick enough I guess (hope ).
    First one is simple to do too, and lighter (not requiring pathfinding), but would need a little more code and a string tokenizer.


    EDIT________

    here's an example of second idea:

    easy_path_widget_follow_player.mfa

    (see "chase player" events lines 44/49)
    chaser is the currently not-selected bug
    will follow a path to one random non-obstacle cell adjacent the target position of player
    starting when player has already gone two steps in its path

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