Jump to content

Artificial Intelligence - Bot path finding


Toady
 Share

Recommended Posts

WOW, this is amazing.

i had no idea autoit could do this!

My own pocket emo http://www.mindistortion.net/pocketemo/?da...1-7-2-0-0-1-0-0LOL[quote name='beerman' post='399180' date='Sep 6 2007, 08:45 AM']I have learned, never think inside the box. The moment you have a bright idea, and stand up to quickly exclaiming, "Eureka, I have it!". You will knock yourself out, from bashing your head on the inside of the box as you stand... So in conclusion it is always safer to think outside the box. :)[/quote]

Link to comment
Share on other sites

  • 2 weeks later...

welll...

If DllStructGetData($data[$x][$y - 1], "value") <> "x" And Not _IsInClosedList($closedlist, $data[$x][$y - 1]) And Not _IsInOpenList($openlist, $data[$x][$y - 1]) Then

If DllStructGetData($data[$x][^ ERROR

:<

My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity
Link to comment
Share on other sites

welll...

If DllStructGetData($data[$x][$y - 1], "value") <> "x" And Not _IsInClosedList($closedlist, $data[$x][$y - 1]) And Not _IsInOpenList($openlist, $data[$x][$y - 1]) Then

If DllStructGetData($data[$x][^ ERROR

:<

your using an OLD version, get the newest one.

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

  • 3 weeks later...

Ok, I'm really happy, and quite glad I read through these before just posting in help. This is pretty much exactly what I was looking for, I was planning on trying to figure out the whole system starting at "my only experience is batch files" (Though I have made some rather entertaining ones, once I d/led every song Frank Sinatra ever sang just to prank my mom, wrote a batch that would run a media playlist, shuffling through until every song had been played, and locking the pc with a picture of sinatra displayed on the monitor. Unfortunately I didn't get the nice reaction such a prank deserves, and instead she just clicked a few times, gave up and walked off, it was dissappointing.)

Anyway, THANK YOU FOR BEING AWESOME! I'll still need to figure it out and tweak it around for what I was working on, but having a design to look at helps tremendously.

Link to comment
Share on other sites

Ok, I'm really happy, and quite glad I read through these before just posting in help. This is pretty much exactly what I was looking for, I was planning on trying to figure out the whole system starting at "my only experience is batch files" (Though I have made some rather entertaining ones, once I d/led every song Frank Sinatra ever sang just to prank my mom, wrote a batch that would run a media playlist, shuffling through until every song had been played, and locking the pc with a picture of sinatra displayed on the monitor. Unfortunately I didn't get the nice reaction such a prank deserves, and instead she just clicked a few times, gave up and walked off, it was dissappointing.)

Anyway, THANK YOU FOR BEING AWESOME! I'll still need to figure it out and tweak it around for what I was working on, but having a design to look at helps tremendously.

Cool, glad you enjoy using it. If you are planning on using this then I suggest downloading Astar_StarterKit.au3 script. It should get you started in the right direction. The GUI example script version is coupled with the internal code so I don't recommend going from that.

The Astar_StarterKit.au3 script has step by step examples showing you how it all works. From your PM you sent. This should work for you. But if your planning on doing this for a website then I suggest re-writing this in javascript. That would take some time though.

The meat of this A* Searching algorithm can't directly be described from just viewing the script. You may need to understand how the algorithm works. Such as why it uses an "Open" and "Closed" list to find the path. For that purpose, read this artical. You could easily (at least IMO) take what I have coded and add checkpoints. Just have each checkpoint set as the Goal when searching for them. If you could, post a proposal on what your trying to accomplish step by step so I could help you in getting started if you like.

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...

It's fantastic!!!

I implemented it in my game, thank you.

I found one error: if the start and the goal are near then the array $path has dimension 1, but the coordinate are reversed y,x instead x,y.

A question: Can I have only the first 2 elements of $path without calculate the whole array?

Thank you for give us the source!!

A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]
Link to comment
Share on other sites

The source at the first page is updated??

Thank you for info.

_AddAdjacents_Openlist($map, $openlist, $closedlist, $current_node, $goal_node) ;add all possible adjacents to openlist
$i=1    
While $i<=2 ;while goal is not in closed list, or open list is not empty
$i+=1       
If UBound($openlist) = 1 Then ExitLoop ;if open list is empty then no path found
        $current_node = _GetLowest_F_Cost_Node($openlist) ;pick node with lowest F cost
        _ArrayAdd($closedlist, $current_node[0]) ;add current node to closedlist
        _AddAdjacents_Openlist($map, $openlist, $closedlist, $current_node, $goal_node) ;add all possible adjacents to openlist
        If $current_node[0] = $goal_node[0] Then ExitLoop ;if current node is goal then path is found!
    WEnd

It is correct or not?

Edited by Fabry
A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]
Link to comment
Share on other sites

Then you dont really need this whole shabang lol. Let me explain.

Start with a node, let it be your starting location. Then on each adjacent node next to the starting location (north, easy, south, west), calculate its "F" cost. Look at _AddAdjacents_Openlist(), youll see what I mean.

$path[1] is the lowest "F" cost of all the adjacent nodes to the $path[0]

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...