• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Phyxx

a* question

3 posts in this topic

I have found the following pseudo c code for an a* search: priorityqueue Open list Closed AStarSearch s.g = 0 // s is the start node s.h = GoalDistEstimate( s ) s.f = s.g + s.h s.parent = null push s on Open while Open is not empty pop node n from Open // n has the lowest f if n is a goal node construct path return success for each successor n'' of n newg = n.g + cost(n,n'') if n'' is in Open or Closed, and n''.g <= newg skip n''.parent = n n''.g = newg n''.h = GoalDistEstimate( n'' ) n''.f = n''.g + n''.h if n'' is in Closed remove it from Closed if n'' is not yet in Open push n'' on Open push n onto Closed return failure // if no path found My problem is that the top node on the open list is supposed to be the one with the lowest f value. However (as far as I can see), nodes are added to the open list as they are evaluated, which is in the order that the child nodes of a partciular node are determined. i.e. If you have a square based tile map and the you check for child nodes in a clockwise fashion around the parent node the last node you will always evaluate will be the node with x = parent.x - 1 and y = parent.y, assuming you start with the top left hand child node. ------------- You start at 1 and the last child node you / 1 / 2 / 3 / evaluate is 8. ------------- / 8 / / 4 / ------------- / 7 / 6 / 5 / ------------- I can see no provision in the code to make sure that the top node on the open stack is the one with the lowest f value. It seems to always be the last child node you evaluate (in this case node 8 if it is valid and not already on either the closed or open list with a smaller f). Am I missing a really obvious step or implied step here? What am I not seeing?
0

Share this post


Link to post
Share on other sites
Sorry, that diagram sisn''t turn out like it shoudl have. I''ll try again.

[1] [2] [3]
[8] [ ] [4]
[7] [6] [5]

I hope this one displays properly
0

Share this post


Link to post
Share on other sites
Hello Phyxx,

I think that, the term
............ "pop node n from Open" .................
doesn''t mean that
"get the top node from Open"

Open is a [priority queue] not a [stack]. There''s a lot of way to implement a priority queue but the most common is using
[HEAP].

So, you should understand that term like this :

"search and get the node with lowest f value out of Open"
(remove that node from Open)

Pls show me if I make something wrong.

Best Regards.
DungDNA
Email : dung.dna@extramedia.com
0

Share this post


Link to post
Share on other sites
DungDNA is right. The container ''Priority Queue'' implies that items are sorted upon insertion (by their priority, hence the name) and therefore the item popped is the one with the lowest f value.
0

Share this post


Link to post
Share on other sites