Jump to content
  • Advertisement


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

Out of Sync

isometric map A* questions!!!

This topic is 5653 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, i have real trouble with my a* pathfinding code... i use an isometric map (like Starcraft or C&C3 Tiberian Sun). can anyone post some pseudocode and/or post some links to this topic, remember i need it for an isometric map, not squares. all links i have visited make me confused! thanks [edited by - Out of Sync on June 18, 2003 6:30:27 PM]

Share this post

Link to post
Share on other sites
Hi, I can post the answers I got to my basic A* star problem here, he he

It doesn't matter that the game is *drawn* isometric like c&c you can still represent it in a 2D 'box' array.

What's important is how you generate your 'children' (perhaps you got that mixed up with the isometric-part) children is the fields you can get to from the current field (or node, as it is often called).

If you only can move up,down,left, right then you get 4 children. If you can move diagonally as well, then you will get 8 children.

How you *draw* it on the screen (2D, 3D, isometric, orthogonal projection or whatever) doesn't matter at all for the pathfinding.

I suggest you start with a smal 10x10 node pathfinding as an independent project just to get the hang of it - it's pretty tricky!

Good luck!

[edited by - UlfLivoff on June 23, 2003 6:53:04 PM]

Share this post

Link to post
Share on other sites
hi again,

first thanks to UlfLivoff for your opinion, i think i try an independent project...
it seems also that the heuristic is wrong, can anyone tell me what kind of heuristic to use?
i don't understand the "Propagate Down" funtion used in most a*-sources, too.

[edited by - Out of Sync on June 24, 2003 10:17:01 AM]

Share this post

Link to post
Share on other sites
I used this tutorial :
There''s a part of the tutorial that explains "heuristic" as well.

Janharal posted his pseudocode, and I got it to work

Here it is:

FindPath(startnode, goalnode)
add startnode to openlist
Path = NULL
while ( more nodes to search) {
find element (E) with least cost in the openlist
remove E from openlist
add E to closedlist
if ( E is goalnode) {
Path = BuildPath
for each neighbour N of E {
calculate cost so far (newG)
if (N is on openlist || N is on closedlist) {
if (existingG <= newG) continue
calculate estimated total cost (f) for N
if (N is not on openlist) add N to openlist
if (N is on closedlist) remove N from closedlist
} for
} while
return Path
end function

Hope it helps!


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!