AStar Pathfinding

Home Forums Monkey 2 Code Library AStar Pathfinding

Tagged: 

This topic contains 2 replies, has 3 voices, and was last updated by  Hezkore 2 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8574

    impixi
    Participant

    The following example calculates paths through a 2d integer array using the AStar search algorithm.

    Theory:

    https://en.wikipedia.org/wiki/A*_search_algorithm

    #8580

    Pakz
    Participant

    Nice!

    I looked through the code and noticed it does not do terrain cost. It does handle diagonal and non diagonal.

    I discovered that the simple flood or seed fill is also a good and simpler way to make pathfinding. I think I remember a gdc video where this was also tipped.

    #10069

    Hezkore
    Participant

    I’m no good at math or algorithms, but this is my modified version with tile ‘cost’.
    Use the mouse wheel to change the cost of the tile under the mouse.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.