User Tag List

Results 1 to 5 of 5

Thread: Circumventing the Pathfinding bug

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Circumventing the Pathfinding bug

    Hi there,

    I'm making a turn-based strategy game, and am using the Pathfinding object just fine. However, I've run up against the bug that other people have noticed before - namely, when it can't find a path, it crashes the application.

    I've attached a screenshot of my problem:



    What I want to have happen is to get rid of the blue movement squares that are on the other side of the barrier - they ought to be inacessible, but I'm not sure how to go about reliably destroying them. I would have checked whether a path could be found to them, but of course that's where the bug comes in to play.

    So does anyone know of any alternatives I could try to get rid of inacessible movement squares? Any help would be really appreciated.

    Cheers.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Circumventing the Pathfinding bug

    I check to see if a square is inaccessible using the overlay object. Every square is represented by 1 pixel, and I use loops do a flood fill on the source square/pixel and check to see if it has changed the colour of the potential destination square/pixel. Might not be the most efficient method, but it works.
    .:::.Joshtek.:::.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Circumventing the Pathfinding bug

    Ah, cool, thanks for that, I'll give it a go!

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Circumventing the Pathfinding bug

    This may seem quite unrelated, but I'm just trying a different way of doing things, and was wondering if anyone knew of a simple way to detect exactly how many of a single object is currently overlapping a different object.

    So for example, if you have three A, and they are all overlapping B, how could you get MMF to detect that three of them are overlapping?

    Thanks!

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Circumventing the Pathfinding bug

    You can use the select object to retrieve how many objects matched the conditions.
    The following code would count how many A's were overlapping any B's:
    [events]
    *A is overlapping B
    -Set counter to (Select Object) number of 'A' that matched conditions.
    [/events]
    So if you had 10 A's and 10 B's and 3 A's were overlapping one B and 2 more were overlapping another it would put 5 in the counter.

    To get how many B's were overlapping each A you would need a loop, like this:
    [events]
    *Always
    -Spread Value 0 in Alt Z of 'A'
    *Always
    -Start Loop "Overlap"
    *On Loop "Overlap"
    +Alt Z of 'A' = loop index("Overlap")
    +B is overlapping A
    -Set Alt A of 'A' to (Select Object) number of 'B' that matched conditions.
    [/events]

Similar Threads

  1. 2.5 pathfinding
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 8th December 2013, 12:20 PM
  2. Pathfinding
    By Limyr in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th November 2012, 09:58 PM
  3. pathfinding
    By graboide in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 9th October 2012, 11:33 AM
  4. iso pathfinding
    By Horn in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 11th June 2007, 10:37 PM
  5. Pathfinding
    By willy in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 11th September 2006, 04:24 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
  •