Jump to content
  • Advertisement

Archived

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

jimywang

contour tracing obstacle avoidance question

This topic is 5154 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

ive learnd a technique which is mentioned in windows game programming guru called contour tracing.it is basically said that when object hits a obstacle then trace around the edge of the obstacle until a clear path is found.i tried it in my game but found a serious problem with it.image the suitation is like this
-------------------
        |  *     |
        |        |
        ----  ----
        A
 
where * is the player and A is the place AI got stuck on.how on earth the AI gonna know the right way of doing it is to trace the wall around the right rather than to the left and trace forever?i would be really appreciated if anyone can give me an advie.thanks. [edited by - jimywang on April 14, 2004 5:51:37 PM] [fixed the code box -Si] [edited by - SiCrane on April 14, 2004 6:33:43 PM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You could make a maxiumum trace amount, and then trace the other way. Just say like,

int traceLeft()
{
...
if pixelsTraced > maxTrace then
{
traceRight;
return 0;
}
...
return openPoint;
}

Or something along those lines.

Share this post


Link to post
Share on other sites
"how on earth the AI gonna know the right way of doing it is to trace the wall around the right rather than to the left…."

WHO told it to trace to the left??



Stevie

Don''t follow me, I''m lost.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!