Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 11:47:48 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)A* Demo and Explanation
Pages: [1]
Print
Author Topic: A* Demo and Explanation  (Read 1163 times)
aschearer
Level 1
*



View Profile WWW
« on: February 18, 2009, 12:19:55 AM »

I'm sure most of you are already well versed in path finding and A* but for the rest of you I thought you might be interested in a demo I made which lets you easily visualize how A* works and how you can use it in a game. (In fact the demo is just the debug build of my Null Op game!) I've also included an explanation of what A* is and how you can implement a modified version similar to what I used for my game. Anyway, let me know what you think!

Visualize pathfinding with A*
Logged

My site: Spotted Zebra
Michelle Disraeli
Level 0
**


View Profile
« Reply #1 on: February 18, 2009, 11:31:23 AM »

To be honest, I think you are complicating things by calling the second variable 'weight', rather than the more standard "estimated cost to goal". This gets especially important when each move can have it's own cost, since people often use cost and weight interchangeably in pathfinding.

In particular, it is important that this variable only contain probable values, not known ones - so I found it a bit strange that you added the known danger of the cell to this, rather than the cost. Further, you seem to be only adding the danger of that cell, rather than the estimated total danger remaining.

Other than that, it's a good tutorial, I think. You might want to extend it with details on minimising the returned route (see the gamasutra links in the other thread).
Logged
aschearer
Level 1
*



View Profile WWW
« Reply #2 on: February 18, 2009, 11:36:24 AM »

Thanks for the feedback Michelle, very useful. I opted to call it weight because I personally think that "estimated cost to target" is rather verbose, but you're right it's more accurate. I think I also conflated the sense of "cost to target" and the impact of the metadata which could be potentially more confusing.

Quote
In particular, it is important that this variable only contain probable values, not known ones - so I found it a bit strange that you added the known danger of the cell to this, rather than the cost. Further, you seem to be only adding the danger of that cell, rather than the estimated total danger remaining.

Perhaps I wasn't clear in the post but the goal is to add the estimated cost to target and estimated danger of a cell when calculating the h-value.

Anyway, I'll have to dig around and find that article you mention and thanks for your thoughtful response!
Logged

My site: Spotted Zebra
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic