Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

Pathfinding program in c++ has uncommon, evil bug - please help me find it!

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

I suppose this could have been posted under the AI section... but it really has more to do with the actual language. The interface should be fairly intuitive: I wrote a pathfinding program in c++ for a 2d coordinate system where the user specifies an initial position, destination, and map file (stores spaces that are clear/blocked from movement). The program then loops, moving the position to get closer to the destination, without going through blocked spaces, showing the movement graphically, and taking (approximately) the shortest route. There is this strange bug where occasionally the movement coordinate will move through a clipped square. If you like, would you please help me figure out the problem? The source is here: http://home.comcast.net/~silverphyre673/ and is the only link (besides the email address) on the page. The program will actually be useful, once its done, to people making games - see the readme (I will protect it under the GPL). Your help is very much appreciated! Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Compiled it, wanted to let you know I got this error.


v2.cpp: In function `void pause()':
v2.cpp:12: error: new declaration `void pause()'
/usr/include/unistd.h:414: error: ambiguates old declaration `int pause()'


Under SUSE, so I changed the name of pause.

Share this post


Link to post
Share on other sites
Quote:
Original post by silverphyre673
I suppose this could have been posted under the AI section... but it really has more to do with the actual language. The interface should be fairly intuitive:

I wrote a pathfinding program in c++ for a 2d coordinate system where the user specifies an initial position, destination, and map file (stores spaces that are clear/blocked from movement). The program then loops, moving the position to get closer to the destination, without going through blocked spaces, showing the movement graphically, and taking (approximately) the shortest route. There is this strange bug where occasionally the movement coordinate will move through a clipped square. If you like, would you please help me figure out the problem? The source is here:
http://home.comcast.net/~silverphyre673/

and is the only link (besides the email address) on the page. The program will actually be useful, once its done, to people making games - see the readme (I will protect it under the GPL). Your help is very much appreciated! Thanks.


I haven't looked at the source (no time), but from what i see, you've got a problem in your move-maker.

Make sure that moves that are impossible, arn't considered. (so then you don't get the bug).

From,
Nice coder

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!