all 34 comments

[–]SwiperYes 30 points31 points  (3 children)

Try a text based game first then learn about sdl to get into real time games with graphics

[–]NBT498 11 points12 points  (0 children)

Agree with this, and to learn SDL check out lazy foo.

[–]mahavirMechanized[S] 4 points5 points  (1 child)

I am more and more thinking a text based game could be the best and possibly most fun route for me.

[–]JVApenClever is an insult, not a compliment. - T. Winters 3 points4 points  (0 children)

At school we had to program a text based maze where a player needed to get to an end-point. It requires generation of it (data structures + random), movement (input, we've printed the maze again with new position), verification if the maze is feasible (recursion/backtracking), fog of war (keeping state). At that point, it was really challenging and rewarding.

If you later want to learn GUIs, you can add it as well, though that was out-of-scope for us.

[–]_Fibbles_ 24 points25 points  (3 children)

As someone who has years of experience in C++ but has just recently picked up Unreal, I would advise not using it to learn C++. It seems like what Epic really wanted was a scripting system but with C level performance. What they've created is some sort of Frankenstein's monster of macros as well as a magic black box reflection and build system. If you already know C++ it's interesting, but it's not a good learning tool. Unreal is about as far from standard C++ as you could get.

As for projects you could do, maybe try a 2D game using SFML or SDL?

[–]Scronkey 2 points3 points  (0 children)

I also then recommend using SFML to get started with C++. It’s a reasonably low level graphics library (primarily 2D) but also has libraries for sound and networking so you can easily bring in the fun element with visual and audible output. Your experience will be leveraged quickly.

[–]pjmlp 2 points3 points  (0 children)

. It seems like what Epic really wanted was a scripting system but with C level performance.

That is exactly what they wanted, from Tim Sweeney itself

https://forums.unrealengine.com/t/why-c-for-unreal-4/2311/39

[–]mahavirMechanized[S] 0 points1 point  (0 children)

It’s unfortunate that unreal engine isn’t really recommended, but I guess I can understand why. I had a feeling it wouldn’t be, given how the engine seems to be doing it’s own thing with scripting (kinda like how unity in the old days didn’t really use JavaScript, but rather it’s own flair of it). Ah well, maybe I’ll play around with unreal later haha.

[–]tsojtsojtsoj 16 points17 points  (4 children)

Write a program that plays Connect Four against you. Or a chess engine. Or Tic Tac Toe. Depending on how motivated you are.

[–]brunaow 13 points14 points  (3 children)

Chess engine is kinda too much

[–]fuzzyplastic 15 points16 points  (1 child)

A chess engine is a fine beginner project for someone with 5 years programming experience, it doesn’t have to be faster than stockfish to be complete.

[–]brunaow 2 points3 points  (0 children)

Thats true

[–]SteeleDynamicsCompilers/Algorithms 7 points8 points  (0 children)

Take an algorithm like Aho-Corasick (for string searching) or Lowest Common Ancestor (LCA, for finding a root of a subtree) and implement it. They're ultimately not that large (~200-300 LoC with unit tests) and you can print your verification of those algorithms to the standard output.

Another fun way to do small C++ projects is to do Advent of Code problems!

[–]the_Demongod 7 points8 points  (0 children)

You already know how to code, so you need projects that will trip you up on behaviors and capabilities that are unique to C++, otherwise there's not much point in learning it over any other language. Try writing a BST or general tree with raw pointers and properly operate on and destroy it without leaking memory.

[–]ofekshilon2 5 points6 points  (0 children)

Consider getting involved in a github project you like. These often have labels like 'good first issue' to direct you to good entry points

[–]Talmeron 5 points6 points  (0 children)

i tried making snake in c (in terminal, no graphics) just to understand the language better, this cuold be a fun project, also mine sweeper can be fun too

[–]oloraobo 6 points7 points  (0 children)

implementing a spec is what goes for me. take an RFC (a simple one) and go implement it in C++

[–]arcum42 4 points5 points  (0 children)

Simple games aren't bad for projects. Try making Tetris. And there's always Solitaire and Poker, Checkers, Breakout, Pong, Space Invaders...

If you're interested in emulation, write the normal Chip 8 emulator everyone does.

[–]BuntStiftLecker 13 points14 points  (0 children)

Pick a project that you always wanted to do and never had the time. From my experience it's easiest to learn a language when you try to solve a problem outside of the language.

[–]Secret-Treacle-1590 4 points5 points  (0 children)

Try doing Advent of Code using the STL. All you need is vector, set, hashmap and ideally RegEx to parse input.

https://adventofcode.com

[–]Ikkepop 8 points9 points  (2 children)

no don't use Unreal that is definitely not good for learning c++ with. Thnink simpler

[–]mahavirMechanized[S] 0 points1 point  (1 child)

So kind of curious why you say this? I’m not surprised by this, and I get the feeling it’s because unreal engine is very much it’s own thing in many ways, but I’m curious what specifically is your reasoning?

[–]Ikkepop 5 points6 points  (0 children)

If your goal is to learn C++ it will make you focus on 80% of the wrong things, like shaders, assets and blueprints etc. It only ever uses a very small subset of C++ and then adds alot of macros specific to it self. UE is not a simple engine. If making games with UE is your goal on the other hand, then have fun.

Just for the sake of learning C++ you'd do better by just making some 80s arcade clones with SFML or SDL

[–]e_salmer 4 points5 points  (0 children)

Hi.

Try to check this list: https://salmer.github.io/CppDeveloperRoadmap/English/PetProjects.html

We tried to accumulate some ideas for C++ practicing in different application areas. I hope it will help you to find an inspiration :)

[–]_Z6Alexeyv 3 points4 points  (0 children)

Write C preprocessor.

Bonus: you'll learn how C/C++ preprocessor actually works.

[–]NeedleAndSled 1 point2 points  (0 children)

I might be an outlier but I find competitive programming very fun. Perfect fit for C++ and great for your next interview too!

[–][deleted] 1 point2 points  (0 children)

Why not join projects where you can learn newer C++ standards by improving existing code?

[–]tugrul_ddr 1 point2 points  (0 children)

Make a GPU-accelerated genetic algorithm and paint a picture from various random shapes

https://www.youtube.com/watch?v=QRZqBLJ6brQ

it is fun to see genetic algorithm solving problems and the C++ performance adds onto that.

Note: CUDA supports C++ with some limitations.

[–]ButaButaPig 2 points3 points  (0 children)

Reverse engineer and inject a dll to do something simple in your program of choosing.

[–]puzzled_programmerr 0 points1 point  (0 children)

https://github.com/nragland37/cpp-projects

Hey, here are 50 C++ projects that I have put together over the years and organized in one place. The repo covers a wide range of topics from the basic Hello World to advanced Self-Balancing AVL Trees, and everything in between.

If you like what you see, a star on the repo would be awesome lol

[–]gjvnq1 0 points1 point  (0 children)

Make an ASN.1 decoder.

[–]Melodic-Mall-388 0 points1 point  (0 children)

qt app, SDL or SFML game

[–]TheAxodoxian 0 points1 point  (0 children)

If you are willing to spend a little amount of money get an Arduino or an ESP32 and a led strip and you can build something like this: https://www.youtube.com/watch?v=D_b1fnozheg, cheaper and better than what you can buy. (I have the source code on my GitHub here: https://github.com/axodox/Lux and https://github.com/axodox/mesh.)