Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

[RELEASED] SAP2D System 2019.1.2b (a* Pathfindingfor 2D games)

Discussion in 'Assets and Asset Store' started by MiSchneider, Apr 7, 2018.

  1. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8


    The SAP2D (Simple A * Pathfinding 2D) path search system is based on Astar algorithm – the shortest path between two points. This search system path you can use to write your own artificial intelligence systems that will help you implement enemies or a system of controlling a character in your 2D game.

    The system is very simple, so if you are not an advanced Unity user, you can easily and fast set up the SAP2D system.



    Also SAP2D System can be used in a 3d games. For example a GPS Navigation in your car like in a gta:

    SAP2D Features:
    - 2D Physics support
    - Manual Obstacles Editing
    - Dynamic Obstacles support
    - Built-in AI

    Assets Store Page
    Online Documentation
     
    Last edited: Apr 17, 2019 at 5:36 PM
  2. Pikarati

    Pikarati

    Joined:
    Apr 7, 2015
    Posts:
    3
    I am wondering if you could add support for Composite Collider 2D to the Dynamic Obstacle script?

    Thankyou
     
  3. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8
    Dynamic obstacles in SAP2D works not pretty nice, because the latest SAP2D build was in a Unity 5.2.5, composite colliders 2D was included in 5.6 version. But, you can fix it. To put simply you can add dynamic obstacle component in a base object wih composite collider component and add dynamic obstacle component in a children objects, also change them colliders to composite collider in a Coll 2D field in Dynamic obstacle script.

    This procces will fixed in the next SAP2D version.
     
  4. Pikarati

    Pikarati

    Joined:
    Apr 7, 2015
    Posts:
    3
    Ok thankyou.
     
  5. unity_ij-uBygkHoAdhw

    unity_ij-uBygkHoAdhw

    Joined:
    Oct 15, 2018
    Posts:
    3
    @MiSchneider In this system, is there a way to set waypoints in a larger map via clicking?
     
  6. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8
    Can you describe your question more detail? In this version the path calculates as a array of vectors. You can write your own script with placing waypoints by cliking and call FindPath method to calculate path to them (as movement in Dota 2). Did I understand you correctly?
     
    Last edited: Nov 23, 2018
  7. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    78
    Hi, this project is alive? thanks
     
  8. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8
    Of Course, I really work hard to release new version. Soon I post some spoilers about it, I hope... -_-
     
    gferrari likes this.
  9. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8
    SAP2D 2019.1b allows you to comfortably work with large pathfinding grids due to draw optimizations solutions. It means that SAP2D pathfinding system can be used in games like a Rimworld and etc, where your agents uses big map to find path. I think that awesome!

    For example I have 1000x1000 grid (1 million tiles)

     
    Last edited: Jan 27, 2019
  10. icore

    icore

    Joined:
    Sep 12, 2017
    Posts:
    2
    Honeycam 2019-02-12 19-15-14.gif What do you think of this bug?
    The purple square is a dynamic obstacle.
    The player has rigid body 2D, one call rider and code.
     
  11. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8
    It happened, because of dynamic obstacle calculation. The player moves very fast and dynamic obstacle doesn't calculate collisions in time. Try to add any tag to the player and also add this tag to Ignore Collision Tags list in the SAP2D Manager. It will help you.
     
    icore likes this.
  12. icore

    icore

    Joined:
    Sep 12, 2017
    Posts:
    2
    oh. Thanks. I solved it.
     
  13. Sicario7

    Sicario7

    Joined:
    Mar 3, 2019
    Posts:
    5
    I really like your path finding system! I have one question though. How would I make AI jump over obstacles? If you could help it would be greatly appreciated!
     
  14. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8
    Thanks. So... It's very difficult to calculate how AI will jump according with finded path. It is possible if your obstacles have fixed height. Maybe anybody will find a solution to calculate height of each obstcale and change the jump angle in realtime. I think that creating of jumping AI is unpossible with dynamic obstacles. I wrote some code to try to create jumping AI. I'm sure there is a more performant solution.

    You can write me your email if you want this project with my solution.
     
  15. MiSchneider

    MiSchneider

    Joined:
    Oct 28, 2017
    Posts:
    8

    [04.15.2019] SAP2D 2019.1.2b Update
    :
    - Added multigrid support.
    - Added big grids drawing optimisations.
    - Added new tool for manual obstacles editing mode.
    - Added API optimizations.
    - Added SAP2D About window.
    - Optimized pathfinding core.
    - Ignore Obstacles list changed to Obstacles Layer parameter.
    - Ignore Coners parameter changed to Cut Coners parameter.

    - Updated SAP2D Manager script.
    - Updated SAP2D Dynamic Obstacle script.
    - Updated Documentation.
    - Updated manual obstacles editing panel. Unwalkable tiles which placed by user saves in single scriptable object on User Data folder.