Jump to content

Artificial Intelligence - Bot path finding


Toady
 Share

Recommended Posts

Some pointers:

Overestimating Heuristic Cost:

Using a heuristic that routinely overestimates (the distance cost) by a little usually results in faster searches with reasonable paths.

If making the world bigger you could decouple the path finding data from the search space.

This would reduce memory consumption.

#)

Yes I know about this. Yet this would violate the shortest path rule. I may add an option to overestimate the heuristic in the future.

www.itoady.com

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

Link to comment
Share on other sites

hey could you possible add a spot in the script where we can put in our own little character to follow the path instead of a blue square? or mention the line number this is on

Edited by Mast3rpyr0
Link to comment
Share on other sites

hey could you possible add a spot in the script where we can put in our own little character to follow the path instead of a blue square? or mention the line number this is on

The GUI is just to see whats happening. Adding a character is out of scope. However, you can easily take this script and turn it into something you like.

www.itoady.com

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

Link to comment
Share on other sites

When running the latest version, I get this error:

C:\Programming\toady.au3(127,63) : WARNING: $closedList_data: possibly used before declaration.
                    Dim $searchedNodes[UBound($closedList_data)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

The program runs, but doing this:

Posted Image

Doesn't work??

Link to comment
Share on other sites

When running the latest version, I get this error:

C:\Programming\toady.au3(127,63) : WARNING: $closedList_data: possibly used before declaration.
                    Dim $searchedNodes[UBound($closedList_data)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

The program runs, but doing this:

Doesn't work??

It does work, try actually making something. Dont pay attention to that warning its something in the gui.

www.itoady.com

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

Link to comment
Share on other sites

hey is there coordinates for the top left corner of the user selected start area in a variable?

EDIT: i found $start_handel[1] and [2] but they dont seem to do what im looking for

Edited by Mast3rpyr0
Link to comment
Share on other sites

hey is there coordinates for the top left corner of the user selected start area in a variable?

Yes each square has its own (array type) with its coordinate in index 0. In the GUI example the top left corner is "1,1".

Does this answer your question?

www.itoady.com

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

Link to comment
Share on other sites

not quite. like when i select the start button and click on a square it turns it green and sets that area as the start area. i need to know the coordinates for the start area.

Like here

$start_handel[0] = $msg
                $start_handel[1] = $sel_X
                $start_handel[2] = $sel_Y        
                GUICtrlSetBkColor($msg,0x00ff00)
                $data[$sel_X - 1][$sel_Y - 1] = "s"

is this what i need to use?

Edited by Mast3rpyr0
Link to comment
Share on other sites

i used index 1 and 2 for the x and y coordinates and it placed the object at 1,1. should i use index 0 for both coordinates?

EDIT: Oo wait a minute, the coordinates arent set as pixels they are set as grid boxes arent they.

Edited by Mast3rpyr0
Link to comment
Share on other sites

i used index 1 and 2 for the x and y coordinates and it placed the object at 1,1. should i use index 0 for both coordinates?

EDIT: Oo wait a minute, the coordinates arent set as pixels they are set as grid boxes arent they.

lol yes. Each box is a label.

www.itoady.com

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

Link to comment
Share on other sites

ok and this is what moves it?

GUICtrlSetPos($label,$temp[2] * 25,$temp[1] * 25)
GUICtrlSetBkColor(-1,0xccffff)

EDIT: The heck with it. i was trying to add a character but it wont move right and when it did it made the program slow and didnt delete the image from where it was before.

Edited by Mast3rpyr0
Link to comment
Share on other sites

update:

~ 40% faster for each node searched. :rolleyes::rambo::x

Therefor, previous version had ~470 ms to search all nodes in a 15x15 open grid.

This version had ~170 ms!... A large difference, 300 ms! Now if autoit had pointers.. hmmm.

Edited by Toady

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...