🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

C++ Practice for familiarity

Started by
3 comments, last by shubham.puri.7742 2 years, 11 months ago

Hello,
I am new to C++ and would like to find some simple projects to practice some of the more unique things in C++. I recently picked up a book by Bjarne Stroustrup to get into it. I also want to get more familiar with Unreal Engine, but I am afraid to mess around with the Unreal keywords when I do not know C++.

Thanks for any feedback, I know the only way to get better is to do it and practice, but I am afraid to make progress in the wrong way.

Advertisement

MuggaSlie said:
I am afraid to make progress in the wrong way.

Don't be afraid to learn. Try things. Get things wrong. Learn.

-- Tom Sloper -- sloperama.com

Along with your copy of Stroustrup, there is the book STL Tutorial and Reference Guide: C++ Programming with the Standard Template Library by Musser, et al. You need to get this book. The books are a little old, so they don't cover the latest and greatest features of C++. To compensate, check out https://en.cppreference.com/w/cpp​ – for instance, check out filesystem support, or threading, or other stuff like that.

Learn about the STL, especially when it comes to iterators. If you find yourself using new[]/delete[], chances are good that you can replace that code with a std::vector – no more potential memory leaks. You'll also want to look up std::map, std::set, etc.

I'm not certain about Unreal Engine 5, but I've been advised that Unreal Engine 4 does not rely on the STL. Still, you should know the STL.

Whatever you do… DO NOT USE THE AUTO KEYWORD!!! YES I'M YELLING LOL…

@MuggaSlie You can follow Brian Overland's C++ Without Fear. The text is aimed at those with no programming knowledge and uses simple but fun projects spanning mathematical algorithms, data structures, and game programming. Once you are reasonably comfortable with C++, you can try implementing simple games on your own. A multiple-choice quiz game may be a good start. Try to incrementally add mechanics: Scoring and checkpoints (e.g. don't reset to 0 score if the player gets something wrong) can be good examples. Dice games can also be a good project, though depending on the game, you may be better off if you know data structures like vectors, stacks, and queues.

For Unreal with C++, perhaps the most instructive resource can be Unreal's own documentation. Don't start Unreal with C++ unless you have some familiarity with Unreal in Blueprint. It eases the learning curve because you would be familiar with some of Unreal's libraries. A specific tutorial aimed at learning Unreal's dialect of C++ is on the Unreal Engine YouTube channel, in which you learn to build a simple Battery Collector game. You can follow along and make modifications as you go to make the project your own. I worked on a variant where the player is pitted against AI bots competing for the same batteries (the AI code was adapted from Blueprint code I had used in another project).

This topic is closed to new replies.

Advertisement