Any up-to-date C++ Tutorials for Unreal Engine

Hey there,

I recently made the switch from Unity to Unreal Engine and I am quite enoying it at the moment. However, having a bit of programming experience (C#, Python and a basic understanding of C++) I would like to dive into C++ programming in Unity.

The problem is: I have some ebooks covering this topic but the tutorials seem pretty outdated. I read the same about the Epic C++ tutorials (no offence guys, you are doing a great job) in this forums.
Plus there seem to be little to none (and if, also outdated) youtube videos regarding Unreal Engine C++ development.

Are there decent, any up-to-date (and free) tutorials for complete beginners to teach you C++ programming in Unreal Engine 4? It’s more about the framework than about the language, since I know plain C++.

Any help is highly appreciated!

Thanks in advance!

Someone really needs to write a Dummies Guide that’s mostly time-proof. I sure could have used it to begin with because there’s a *lot *of relevant documentation but not all of it matters at that point.

There is a big list of gotchas that will trip up anyone no matter how familiar they are with C++. You can divine them by panning through all of the documentation but the best way to find out what you need to know is just to write some code and get people to review it. Do some stuff, toss it in here and we’ll try to point out things you didn’t know about.

The framework documentation is actually rather up-to-date, it’s more the nitty-gritty C++ stuff that tends to fall behind (mainly when Include What You Use - IWYU - broke a lot of previous tutorials). 9 times out of 10, if you’re using a tutorial and it doesn’t work, you’re just missing an include.

The common framework pitfalls seem to be:

  • Unreal Build Tool (UBT) - This reads all the .Build.cs files and generates the appropriate projects / dependencies for your module. You run it by simply right clicking on your UPROJECT file and selecting “Generate Visual Studio Project Files”. If you need to use another module (Niagara, GameplayAbilities, etc), you need to add it to your .Build.cs and re-run the UBT.
  • Unreal Header Tool (UHT) - This is executed any time you build code. UHT reads all header files looking for UPROPERTY, UFUNCTION, UCLASS, etc., and generates the boilerplate code that matches what you specified in those values (it outputs it to MyClass.generated.h). UHT is the secret sauce that separates UE4 C++ from normal C++ (although it’s still normal C++ in the end).
  • Garbage Collection (GC) - UE4 tracks object lifetime ENTIRELY through UPROPERTY values. Meaning if a field that is marked as a UPROPERTY is pointing at a memory value that was allocated with NewObject<> or SpawnActor<>, it will not get cleaned up. To delete memory of those objects, you simply “leak” them by setting any field pointing to them to null. The GC manager has a hash table of all objects ever allocated, so it’ll figure out if no one is pointing to it and delete things for you.

Any other questions you may have, simply ask.