User Tag List

Results 1 to 6 of 6

Thread: [Beta] FindTheWay : All New A* Path Finding

  1. #1
    Clicker Install 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)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    505
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    [Beta] FindTheWay : All New A* Path Finding

    FindTheWay

    Click image for larger version. 

Name:	FindTheWay.png 
Views:	56 
Size:	85.5 KB 
ID:	31286

    Description

    A* Path Find, open source, 5X faster than Path Finding Object, planned for all runtime compatible.
    Currently it's Windows only, I'll start porting when features are stable, aka finish beta.

    This extension is still under development so if you find any issue or have suggestions, feel free to post here or open an issue here.

    Release page
    Source code

    Note: You need a compatible version of visual studio with C++ 20 support, as I used concept in one place for fun. Even if you rewrite it by require, C++ 17 is still needed as I used structured binding declaration.

    Doc

    Note: HTML in doc didn't display properly on GitHub, please download it and open with compatible editor.

    Click image for larger version. 

Name:	Appendix.png 
Views:	33 
Size:	69.7 KB 
ID:	31287

    Free and open source

    IMHO extensions, especially extensions that provide basic mechanisms, should be open-sourced, as it's frustrating to find some bug somewhere (or need some new feature) and the author may have left forum & lost source code, so it will never be fixed or takes a long time, you have to find a way to bypass bugs, even modify your game design, or implement it in another inefficient way.
    Although I cannot make everyone share their source code, but at least I can start from myself.

    A/C/E List

    Code:
    ## Action
    
    - Continue
      - *This extension put find/calc area in condition to check if params area valid. If you don't need following actions immediately, use this action to avoid fusion remove the empty event*
    - Set Stash
      - *with this on, path & area will be stashed, then retrieve it with out calculate if states are the same (map/zoc/ignore flag, etc.)*
      - *stash will be clear automatically once map updated*
      - *disable stash will clear everything stashed*
      - *disable this may slightly improve performance as the state hash process is skipped*
      - *disable this if you encounter hash collision*
    
    - Set Map
      - Set Map
      - Set Map By Object
    
      - Clear Map
    
    - Path
      - Iterate Path
    
    - Area
      - Create Object Zoc
        - *iterate zoc position for object, auto create zoc area, coord param is ignored*
      - Create Object Zoc By Name
        - *same as above*
      - Create Object Zoc By Event
        - *iterate zoc position for object, trigger `On Create Object Zoc` for you to create real zoc area*
    
      - Set Zoc By Object
      - Clear Zoc
    
      - Set Unit By Object
      - Clear Unit
    
      - Iterate Area
    
      - Create Area Once
      - Create Area By Name Once
    
      - Create AOE
        - *Create different AOE area, check appendix for type declaration*
    
    ## Condition
    
    - Map
      - Map Available
        - *extension maintains a internal class to handle everything. This class will be destructed then re-construct with new params in `Set Map` conditions. If params are invalid, those conditions will return false and all A/C/Es rely on this class will do nothing/return default value, use this to debug*
      - Check Map Cost At Coord
    
      - On Map Update
        - *once you update terrain or dynamic, extension won't update the map immediately as you may set multiple points*
        - *usually map is updated before find/calc area if needed, then this condition will be triggered*
    
    - Set Map
      - Set Map By Size
      - Set Map By Base64
      - Set Map By Picture
      - Set Map By Collision
        - *you can let extension retrieve collision of layers, or call `On Set Map By Collision` for each gird for you to check & set collisions directly*
    
      - On Set Map By Collision
    
    - Path
      - Path Found
      - Path Available
    
      - On Iterate Path
    
    - Area
      - Zoc Valid
        - *not at obstacle or unit*
        - *need to update unit before using*
      - Zoc At Area
        - *check if zoc at calculated area*
    
      - On Create Object Zoc
    
      - Calc Area
        - Line mode
          - no obstacle from start to the range (e.g., laser beam)
          - `allRange` & `allRangeAttackRange` are ignored in this mode
          - if `attack` is true, `ignore flag` will be taken into account
          - if `attack` is false, both map collision & all unit are taken into account, for skills that push/pull unit
        - Ring mode
          - if `allRange` is true, `range` will be used as move range, and `allRangeAttackRange` is used as maximum attack range, both move & attack area will be calculated in one short, e.g., danger zone of enemy.
    
      - On Iterate Area
      - On Iterate Attack Area
        - *if you `Calc Area` in all range mode, this condition will be true when iterate attack area in `On Iterate Area`*
    
      - Able to Iterate Area
        - *if you want create areas procedurally by `Iterate Area` with param once, this condition is here for you to check if it is able to iterate.*
    
    - Object
      - Select
        - Select All
          - *save fastloops when click on an area, move character to that point, then destroy all areas*
    
        - Object At Gird
        - Object At Coord
        - Object At Obstacle
    
        - Object At Object
          - *check if former object and the latter object has the same gird coord*
    
        - Pick One Object At Object
          - *only display one instance when overlapping itself*
    
      - Non-Select
        - No Object At Gird
        - No Object At Coord
    
    ## Expression
    
    - Iterate
      - *this values are shared by all `On ...` events, please do not nest them*
    
      - Get Iterate X
      - Get Iterate Y
      - Get Iterate Index
    
    - Gird
      - Get Gird Coord
      - Get Real Coord
    
    - Map
      - Get Map Cost
      - Get Map Base64
      - Get Map String
    
      - Get MapType Map
      - Get MapType Terrain
      - Get MapType Dynamic
    
      - Get Map Cost Path
      - Get Map Cost Obstacle
      - Get Map Cost Valid
    
    - Path
      - Get Step
        - the same as `Path Found` but return steps directly, save events when calculation AI
      - Get Step of Path
      - Get Step Coord of Path
    
    - Area
      - Get Ignore Flag
        - *`ignore` means this point doesn't treat as obstacle*
        - *A/C/E that requires this param need to update zoc/ally/enemy first to make ignore works properly*
    
      - Get Available Line Range

  2. #2
    Clicker Install 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)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    505
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    Next update will come with:

    - Isometric mode

    Click image for larger version. 

Name:	MHGK)7A_XZ}O({NL{DQDS95.png 
Views:	31 
Size:	88.1 KB 
ID:	31309

    - Debugger

    Click image for larger version. 

Name:	@132LV7BEF9HGK7@OZ3`QFA.png 
Views:	20 
Size:	47.1 KB 
ID:	31310

    - Create from surface & active

    Click image for larger version. 

Name:	_]P6V2`X8P_F]S4Y%[KIG]W.jpg 
Views:	17 
Size:	34.2 KB 
ID:	31311

    Click image for larger version. 

Name:	8PGBL{IIZ5T`@(_1]9W%4VP.png 
Views:	23 
Size:	54.9 KB 
ID:	31312

    - Create grid with one action

    Click image for larger version. 

Name:	_E74(EZAK9K[J530AHR8`2A.jpg 
Views:	21 
Size:	89.7 KB 
ID:	31313

    Click image for larger version. 

Name:	_77`D6`7KXR7_QZZ3G{AU(6.png 
Views:	13 
Size:	52.7 KB 
ID:	31314

    Click image for larger version. 

Name:	(RZUQD~5LO`HK@X}5(%_W2A.png 
Views:	26 
Size:	89.1 KB 
ID:	31315

    - other tweaks & optimize!

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator
    SirEatAlot's Avatar
    Join Date
    Oct 2010
    Location
    Stockholm, Sweden
    Posts
    449
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Very nice!

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleFirefly 3D ModuleInstall Creator Pro
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,672
    Mentioned
    34 Post(s)
    Tagged
    0 Thread(s)
    Looks very promising - thanks for making it open source.

  5. #5
    Clicker Install 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)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    505
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    [Update 220424]

    Release Page

    FindTheWay_220424

    What's new

    Android support!



    Note: SetMapByPicture, SetMapBySurface is unusable due to platform limitations

    isometric

    need not to care about coord conversion, extension will handle it all for you.



    debugger



    Disable incompatible A/C/Es



    new action

    - CreateAOEByName
    - CreateGrid
    - SetGridSize
    - SetMapByActive
    - SetMapBySurface

    Bug fix

    - memory Leak in SetMapByPicture
    - protection for null LPRO
    - protection for non active object
    - fix size_t layer = -1 overflow
    - fix default layer = 2
    - fix possible crash when loading from surface due to /MT
    - LPCTSTR->LPCWSTR
    - update map when output
    - don't stash if stash is off when finding

    Known issue

    If you encounter grid offset in android:



    please unzip ext and navigate to CRunFindTheWay.java

    Code:
    import static _3rdLib.ObjectCreationClass.GetEvtParam;
    import static RunLoop.CRun.OBSTACLE_TRANSPARENT;
    
    public class CRunFindTheWay extends CRunExtension {
        // TODO DEBUG
        private static final boolean DEBUG = true;
        // private static final boolean DEBUG = false;
    
        // Define ACE ID here
        // Condition
        final int CND_CONDITION_SMBS = 0;
        final int CND_CONDITION_SMBB = 1;
    then toggle DEBUG flag.

    Enjoy!

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator
    SirEatAlot's Avatar
    Join Date
    Oct 2010
    Location
    Stockholm, Sweden
    Posts
    449
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    really nice to see good debugger support, great work, much appreciated!

Similar Threads

  1. Path-finding to the closest object
    By Lukiester in forum Fusion 2.5
    Replies: 3
    Last Post: 30th August 2015, 06:49 AM
  2. Path Finding no extension needed - Example
    By Sparckman in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 9th June 2015, 07:53 PM
  3. Path Finding
    By AnD4D in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 8th May 2012, 04:47 PM
  4. How do i use the path finding extension?
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 13th October 2008, 12:52 AM
  5. PATH FINDING
    By imothep85 in forum Extension Developers Lobby
    Replies: 4
    Last Post: 10th February 2007, 02:02 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
  •