Intrafoundation Software
Making Atomic Warfare Fun Again
 

Need a shoulder to cry on while trying to convince Windows to properly work with our software? Just want to chat about something related to the site? Feel free to use the forums slash news slash blog.

(Unsolicited commercial spam will be deleted, obviously.)

[Looking for something?]
Looking for something?
This is thread 237. The complete list of threads is available on the main forums page.
Subject: Pathfinder2d: Where is the shortest path saved?
Author: Todd Coleman
Date/Time: 11/8/2003 12:05:08 AM (237.0)
Just a quick question. I`m using some of the Pathfinder2d code in a web-based, real-time strategy game. I`ve basically pulled the AStarHeapInteger code out and ported it to C#. That doesn`t take too much brainpower. Just neuter the pointer references and a couple other miner tweaks here and there and it`s ready to go.
However, I`ve tried my hardest to understand just what I had to to port it over. I have other things to code and I didn`t want to have to sit down and understand the whole process of pathfinding.
What I`m trying to find is the path after it has been calculated (FindPath). Where is it stored? (nodes, routes, ??) Is it stored in yx where I will << and & the data to get the coords?

Any help would be appreciated. If I have to, I`m sure come Monday, I`ll piece it all together myself.
Subject: RE:Pathfinder2d: Where is the shortest path saved?
Author: Lewis Sellers
Date/Time: 11/10/2003 1:10:11 PM (238.237)
A good question. (Tries to remember.) As I recall, what I did was that since I had to reference the map data anyway, I stored final movement for that method in routes. The heap/nodes are only used when computing the path.

(Thinking back.)

The routes are stored (I believe for that method) in reverse order, ie from end to start (a by product how how the routes are generated). So to use them you have to compute the beginning point then flip directions around 180.

There actually is go in there that already does that as a final operation before the pathfinding ends. Don`t have access to the code at the moment, but it should be about the last function in the AStarHeapInteger class (I think).

Help at all?

(Note: I`ve been gearing up to take the Java certificate exams so I was seriously thinking about ripping that same alg out and porting a simple, clear version to Java for the experience.)

--min


REPLY
Author:
Subject:
Your
Message:
Email: (optional)
(Note: For safety all HTML in your message text may be printed exactly as you typed it.)
top