🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

A* variable terrain costs

Started by
5 comments, last by XXChester 13 years ago
Hello all, I am not looking for code I am simply looking for a resource on the subject. The only resource I am able to find is http://www.policyalm...tarTutorial.htm which is what I based my A* implementation on. However afer implementing the variable terrain costs based on the "Notes on implementation" section I cannot seem to figure out how to get it to work properly so I am just looking for a second resource to try and approach it differently or get a second take. I have googled it a couple times and different ways over the past hour so I think I must be looking for the "non-industry" term because I am not finding anything.

Thanks.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

Advertisement

Hello all, I am not looking for code I am simply looking for a resource on the subject. The only resource I am able to find is http://www.policyalm...tarTutorial.htm which is what I based my A* implementation on.

I am just looking for a second resource to try and approach it differently or get a second take. I have googled it a couple times and different ways over the past hour so I think I must be looking for the "non-industry" term because I am not finding anything.




How about both references and implementation? http://www.google.com/search?q=astar+implementation%20source pulls up source code with explanations written in several programming languages.



Hello all, I am not looking for code I am simply looking for a resource on the subject. The only resource I am able to find is http://www.policyalm...tarTutorial.htm which is what I based my A* implementation on. However afer implementing the variable terrain costs based on the "Notes on implementation" section I cannot seem to figure out how to get it to work properly so I am just looking for a second resource to try and approach it differently or get a second take. I have googled it a couple times and different ways over the past hour so I think I must be looking for the "non-industry" term because I am not finding anything.

Thanks.



It would probably be easier if you could show how you are calculating your cost as well as describing in more detail what things you want considered in your path finding. It could be as simple as scaling the distance based on the terrain's type.
There are any number of solutions to this, ranging from simple to highly generic and powerfully abstract. We're not really in a position to decide what's most appropriate for you, so some additional details about your map representation, implementation method, and so on would be very helpful.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Don't think in terms of length of your edges, think in terms of the cost of moving through them (e.g. time). So find in your code where you are assembling the cost of your path so far and add in the cost of each node instead of assuming that each is = 1.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Thanks everyone for your replies, I think I have found the problem and I will write back in a couple days about my progress. I think the problem is in my shortest path calculation because when I manually add up the tiles I can see that it should not be choosing the variable terrain tiles, it should go around, but it blows right through them.

Thanks for the quick replies and I will let you know.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

Thanks guys for trying to help. I actually ended up figuring out the problem on my way home today so didn't end up checking out any of the resources etc. The problem was that I was looping through my closed node list to determine the distance travelled from the start but this was wrong because I should've been going through the parent nodes via node.parent. As soon as I changed this the variable terrain began working like a charm with my many tests. Gave you all a +1 though for trying to help to show that I appreciate it and I am confident that if I looked over the resources linked or answered with my code that you asked for you would've helped.

Thanks again.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

This topic is closed to new replies.

Advertisement