path finding
now here is the problem...
i have a map... the map is implemented on a grid matrix (lets say, 200 by 200)
every square can have 3 values: me, empty, blocked
me - is the unit that wants to go from block a to block b
empty - a block that me can step in
blocked - a block that me cant step in
now i use a a path finding algorithm to find a path from a to b... it gives me back a list of blocks each block in the list is adjacent to next block in the list on the map...
meaning, if 5,5 is on the list the next node on the list can be one of the folowing:
5,4
4,5
5,6
6,5
6,6
4,4
4,6
6,4
now... I can divide the list into segments of a streight line... a streight line is defined as a line that is not bending in angle of over 18 degrees.
now... given a list like the one i described, i want to find out the begining and ending point of each segmant.
plz plz plz help me...
i am stuck on this problem for over a month now
if my explaination is not clear plz say so... i''ll try tomorrow to post a better one (with a picture example)
Hey, take a look on A* algorithm, it works very well and finds the best path.
--------------------------
Rory Gallagher blues will never die.
---------------------------
Que que foi, que que foi, O que eh que hah?
--------------------------
Rory Gallagher blues will never die.
---------------------------
Que que foi, que que foi, O que eh que hah?
i have a path...(i really used the a* algorithm)
but now i want the unit to move along this path, and face the direction she is moving to.
but now i want the unit to move along this path, and face the direction she is moving to.
up!
plz help me... i am really desperate...
i am looking for answer for over a month now (a dr. in mathematics and a graduate in computer science sat with me one day for over 4 hours and we couldn''t find anything satisfactionable)
plz help me... i am really desperate...
i am looking for answer for over a month now (a dr. in mathematics and a graduate in computer science sat with me one day for over 4 hours and we couldn''t find anything satisfactionable)
Surely you must know the location of each block? It shouldnt be hard to subract the players position vector from the location vector thus giving you the vector between the two? - simply turn your player to face the target position and walk forward untill you are within a given range of it then switch to the next point on the path?
That is what you mean isnt it?
Be a bit clearer and Im sure youll b=get better replies
That is what you mean isnt it?
Be a bit clearer and Im sure youll b=get better replies
quote:Original post by RatLord
Be a bit clearer and Im sure youll b=get better replies
I find this funny because I know exactly how that typo got there.
OP: To reiterate the point, you need to write in a much clearer fashion. Your post doesn''t really ellaborate on your exact problem...When you say "a grid" and "squares" you imply a mazelike structure, but that doesn''t really fit with the 18o angle thing. A picture would be a real helper here. If you''ve been working on this for a month, you''ve probably developed a little shorthand when describing the problem. Try to make it simple to visualize for someone who may not have seen this problem before. That''s the only way you can be sure to get fresh eyes on the subject.
Hope this helps
_____________________________
And the Phoenix shall rise from the ashes...
--Thunder_Hawk -- ¦þ
______________________________
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement