Toady Posted July 2, 2007 Author Share Posted July 2, 2007 Description change. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
gianfun Posted July 7, 2007 Share Posted July 7, 2007 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 More sharing options...
Busti Posted July 21, 2007 Share Posted July 21, 2007 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 More sharing options...
Toady Posted July 21, 2007 Author Share Posted July 21, 2007 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 More sharing options...
Busti Posted July 21, 2007 Share Posted July 21, 2007 wow, its fucking nice !!! *thumbs up* 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 More sharing options...
Learning4once Posted August 12, 2007 Share Posted August 12, 2007 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 More sharing options...
Toady Posted August 13, 2007 Author Share Posted August 13, 2007 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 More sharing options...
lordofthestrings Posted August 21, 2007 Share Posted August 21, 2007 the first versions didn't seem to work for me, but now I see this in action I must admit there's plenty to learn from this script.. verry nice work Toady.. Link to comment Share on other sites More sharing options...
Toady Posted September 6, 2007 Author Share Posted September 6, 2007 Wow, the new release of Autoit 3.2.6.0 makes this incredibly fast. Must be the improvements on the SRE engine. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
SqueakyNeb Posted September 8, 2007 Share Posted September 8, 2007 This is a really cool program and fun to play around with. However i think you should make a larger grid with smaller squares and add a mass terrain change feature (i.e. click and drag for rectangle areas or for any square the mouse moves over) Link to comment Share on other sites More sharing options...
Fabry Posted December 26, 2007 Share Posted December 26, 2007 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 More sharing options...
Toady Posted December 27, 2007 Author Share Posted December 27, 2007 Hey thx, Im not seeing the reversed x,y thing your describing. I thought I fixed that a long time ago. What do you mean the first two elements in $path? www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Fabry Posted December 27, 2007 Share Posted December 27, 2007 I need only $path[0] and $path[1], not the whole $path, it takes long enaugh. 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 More sharing options...
Toady Posted December 28, 2007 Author Share Posted December 28, 2007 If you want the first two elements in the $path array then just modify the _FindPath() function. Just make the While loop return after two passes. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Fabry Posted December 28, 2007 Share Posted December 28, 2007 (edited) 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 December 28, 2007 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 More sharing options...
Toady Posted December 28, 2007 Author Share Posted December 28, 2007 Well $path[0] is always the starting location and $path[1] will always be the next cell beside the starting location. So once the closed list has two items, its time to return. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Fabry Posted December 28, 2007 Share Posted December 28, 2007 (edited) Now my bot it's stupid it doesn't find the path. Sometime return only $path[0]. Edited December 28, 2007 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 More sharing options...
Toady Posted December 28, 2007 Author Share Posted December 28, 2007 Im curious on what your trying to accomplish here. Your just want to know the next move from a starting location with respect to going to a final goal? www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Fabry Posted December 28, 2007 Share Posted December 28, 2007 Yes!!! 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 More sharing options...
Toady Posted December 28, 2007 Author Share Posted December 28, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now