Advertisement

isometric map A* questions!!!

Started by June 17, 2003 01:36 PM
2 comments, last by Out of Sync 21 years, 5 months ago
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]
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!
Ulf

[edited by - UlfLivoff on June 23, 2003 6:53:04 PM]
Advertisement
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]
I used this tutorial :
A*
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 openlistPath = NULLwhile ( more nodes to search) {find element (E) with least cost in the openlist remove E from openlistadd E to closedlistif ( E is goalnode) {Path = BuildPathbreak }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 Nif (N is not on openlist) add N to openlistif (N is on closedlist) remove N from closedlist} for} whilereturn Pathend function 



Hope it helps!

Ulf

This topic is closed to new replies.

Advertisement