September 23, 2019, 06:57:28 AM

Author Topic: Brute Force Pathfinding  (Read 591 times)

Offline Pakz

  • Full Member
  • ***
  • Posts: 161
    • My homepage
Brute Force Pathfinding
« on: January 29, 2018, 06:43:59 AM »
I coded this a while ago. I though that I would try to create a pathfinding method using Brute Force. The actual pathfinding is done by only adding up one possibility at a time. There are 4 directions in a path. Number 1 to 4(up,right,down,left) By starting with one character and building up from there every possible path is created.

There is a function that tests the current path if it reached the destination. Shortest Path found.

I noticed that I could only use a small map, and even then it can take a while(or time out) if the path is complex.

For really short paths this can be used I think.

Emscripten demo:
https://cromdesi.home.xs4all.nl/emscripten/bruteforcepathfinding/Untitled1.html

Monkey2 code here :
https://github.com/Pakz001/Monkey2examples/blob/master/Brute%20Force%20Pathfinding.monkey2