Jump to content

  • Log In with Google      Sign In   
  • Create Account

A star Tutorials - SFML


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 mypel16000   Members   -  Reputation: 46

Like
0Likes
Like

Posted 27 January 2013 - 09:31 AM

Hi, I am developing a game in C++ with SFML. I have got to the point where I need AI movement and path finding. I have heard that the way forward is using an A star algorithm, but there seems to be such little help on the internet. I have no knowledge of advanced C++ features such as maps, search cells...

 

Does anyone have some source code I can use for my game or a good tutorial on how to do it (I don't need a tutorial on the principles, I know them; I just don't know how to implement it on C++) I found a good code from 

 

http://code.activestate.com/recipes/577457-a-star-shortest-path-algorithm/

 

It works very nicely on its own, but as soon as I bring it onto my project in CodeBlocks it shows lots of compiler errors.

 

Come on, let's get some good stuff in here so that anyone googling this problem can have some good helo



Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9598

Like
4Likes
Like

Posted 27 January 2013 - 10:31 AM

I have no knowledge of advanced C++ features such as maps, search cells...

You also seem to have no knowledge of basic C++ features such as preprocessing, compiling and linking. Go back to the previous thread you made on A* and read the last post again. The way you are trying to integrate external code in your project is fundamentally flawed. You need to figure out how to create and use header files and put multiple source files in a project. If you don't understand advice you are getting in an existing conversation, ask questions rather than giving up and creating a new thread in hopes someone will spoon feed you the answer. Here's the main point you should be concentrating on from that last post: "It's generally a bad idea to #include a .cpp file. You should include only .h header files."

#3 EWClay   Members   -  Reputation: 659

Like
6Likes
Like

Posted 27 January 2013 - 11:40 AM

In the event that someone looking for help with A* does stumble on this thread, don't use that that code: it's awful, verging on ridiculous.

It would be better to understand the algorithm and write the code yourself. There's a good explanation here:

http://www.policyalmanac.org/games/aStarTutorial.htm




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS