Advanced C++

Started by
4 comments, last by redw0lf 11 years ago

Hi there,

September last year I started to learn C++ for game programming. I have got on pretty well, I finished a youtube series of tutorials and through my own research and help from some forums I have developed some very good projects which I'm proud of. The problem has come now that I'm trying to develop an A star Algorithm program. I can understand the theory, but I just cannot code it or understand recipes.

I am looking for some advanced C++ tutorials,

I know all the functions, classes, data types and all that simple stuff, what I want to learn is some things like maps, nodes, advanced poiters, vectors... Things which those simple tutorials don't teach.

Any help, links, blogs...?

Advertisement

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

I highly recommend you read the book "data structures for game programmers"

Hi there,

September last year I started to learn C++ for game programming. I have got on pretty well, I finished a youtube series of tutorials and through my own research and help from some forums I have developed some very good projects which I'm proud of. The problem has come now that I'm trying to develop an A star Algorithm program. I can understand the theory, but I just cannot code it or understand recipes.

I am looking for some advanced C++ tutorials,

I know all the functions, classes, data types and all that simple stuff, what I want to learn is some things like maps, nodes, advanced poiters, vectors... Things which those simple tutorials don't teach.

Any help, links, blogs...?

What id suggest is start doing/working instead of watching and chilling out!

Do stuff! in tutorial you only learn so much...

For example here is what i made with just starting and putting stuff together.

I had no clue how to make a game like this when i started out, it was painful but now i can redo it all in such better way because i learned so much from mistakes i made, and they hurt all the way thru.

Here is a post to the game BTW: http://www.gamedev.net/topic/641117-check-up-the-wanderer/

@BaneTrapper

Yes, that's the advice everyone used to give me, so I started developing a game, and, you are right. After developing something simple, I was able to add a lot of features to my game engine! However, I believe that A* pathfinding algorithm is somewhat too complex to just think it through. I've been trying to implement someone else's, but it uses queues, maps, nodes and thinks I have no idea what they mean. I'm trying to read Bjarne Stroustrup¡s C++ book, but it's too long and mixes the stuff i know with what i dont...

Learning the A* algorithm, right from beginning can be very confusing. If you haven't used/programmed similar algorithm. What helps to understand this kind of algorithms is to actually USE the algorithms, but do not program it our implement it, rather draw it with pen and paper. E.g. draw some points and connect these points with lines. Then add some numbers to the lines, they will be the distances or the actual costs, which are needed to travel from one node to the other. Then select a start node and a finish node. Try to find the shortest path between start and finish node. Write down the paths and your thought progress in a format like: Start at Node 1 go 25 to Node 2 and so until you reached your goal. Then think on strategies, e.g. on how to select the shortest path, a simple method would be to only use the shortest distance which is available, if you do so you may end up at the start or taking loops, then you may think of something like, i do not want to visit nodes again i have already visited and so on. Think of more different methods to improve your path, e.g. look a step a head and calculate the minimum distance for two steps. If you think you have found a good strategy to do so you have created some kind of heuristic.

Then try to implement the stuff you have created with the help of your favourite programming language, you should come close to the solution of the a* algorithms.

Learning by doing is always the best method but to know what you are doing, you should at least have a little knowledge about what you are doing.

Also as far as the different complex data types are concerned, they are basically derived from more simpler ones. E.g. a queue is a list where you always read the first element and store items at the end. A map is more or less something like a dictionary, where you have a key, e.g. a string and an attached value to the key. This value could be a string as well, if you may think in localization you could have one map for every language. In this case the key may be only a simple string e.g. BTN_FIGHT_TEXT and the value would then hold the string "Fight" for the english version... At least for this basic knowledge books are very good, because they explain this stuff in detail they also allow you to peak at them if you are uncertain. As far as the knowledge on the handling goes the best thing is to just use these data structures.

do! develop! create! - visit my scripters-corner.net

This topic is closed to new replies.

Advertisement