#### Archived

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

# path finding

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

## Recommended Posts

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)

"SO!!"

##### Share on other sites
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?

##### Share on other sites
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.

##### Share on other sites
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)

##### Share on other sites
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

##### Share on other sites
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 -- ¦þ
______________________________

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 29
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002290
×