Learning C++ in Unreal Engine: Introduction

Julien Hora
tokyopixels
5 min readMay 22, 2024

--

Welcome to the Start of Your Unreal Engine Journey!

Are you excited to dive into the world of game development with Unreal Engine? Whether you’re an aspiring game developer or a seasoned programmer looking to expand your skills, this series will guide you through the basics of using C++ in Unreal Engine. By the end of this series, you’ll be equipped with the knowledge and skills to create your own games and interactive experiences.

Why Choose Unreal Engine?

Unreal Engine is the most powerful and one of the most widely used game engines in the industry. Known for its stunning graphics, extensive toolset, and versatility, Unreal Engine powers some of the most popular games and applications across various platforms. From AAA titles to indie games, Unreal Engine provides the tools needed to bring any of your creative vision to life.

Why Learn C++ in Unreal Engine

While Unreal Engine offers Blueprints, a visual scripting system that allows creators to create gameplay mechanics without writing code, mastering C++ unlocks the full potential of the engine. C++ provides:

  • Performance: C++ code runs faster and more efficiently, crucial for performance-critical applications.
  • Flexibility: C++ allows for more complex logic and customization beyond what Blueprints can achieve.
  • Control: With C++, you have complete control over your game’s mechanics, memory management, and system-level features.

What You’ll Learn in This Series

n this series, we’ll start with the basics and gradually move to more advanced topics. Here’s a sneak peek at what you can expect:

  1. Setting Up: Learn how to set up Unreal Engine and Visual Studio, the tools you need for C++ development.
  2. Project Structure: Understand the layout of an Unreal Engine project and the roles of different files and folders.
  3. C++ Fundamentals: Get acquainted with basic C++ syntax and concepts tailored for Unreal Engine.
  4. Creating Classes: Discover how to create and use C++ classes in Unreal Engine, including the use of important macros like UCLASS, UPROPERTY, and UFUNCTION.
  5. Integrating Blueprints: Learn how to integrate C++ code with Blueprints to leverage the strengths of both.
  6. Player Interaction: Implement player input and interactions using C++.
  7. Actors and Components: Work with Actors and Components, the building blocks of Unreal Engine games.
  8. Gameplay Programming: Dive into basic gameplay programming to create mechanics and game logic.
  9. Debugging and Optimization: Master techniques for debugging and optimizing your C++ code.
  10. Advanced Topics: Explore advanced C++ topics and best practices for Unreal Engine development.

Let’s Get Started!

Whether you’re starting from scratch or looking to deepen your existing knowledge, this series is designed to be approachable and practical. Each article will include hands-on examples, step-by-step instructions, and plenty of tips to help you along the way.

So, let’s embark on this exciting journey together and unlock the full potential of Unreal Engine with C++. Ready? Let’s dive in!

Setting Up Unreal Engine & Rider

Before we dive into coding, it’s essential to set up your development environment. This section will guide you through installing Unreal Engine and Rider.

Why Rider?

Well, because after using Visual Studio for a few years, I moved to Rider to benefit from its numerous advantages such as faster completion, a much better UX, and of course RiderLink which gives you a lot of insights on what is going on on the engine side with for example the possibility to see if a class or variable have been referenced in Blueprints, etc…

If you are not yet willing to spend on your IDE, you can of course follow the series using Visual Studio as it won’t make a difference in what you can do during this series.

Installing Unreal Engine

  1. Create an Epic Games Account: If you don’t already have an account, go to the Epic Games website and sign up for free.
  2. Download the Epic Games Launcher: Once you have an account, download and install the Epic Games Launcher from the same website.
  3. Install Unreal Engine:
  • Open the Epic Games Launcher.
  • Navigate to the “Unreal Engine” tab.
  • Click on the “Install Engine” button.
  • Choose the installation directory and options that suit your needs.
  • Click “Install” and wait for the process to complete.

Installing Rider

  1. Download Rider: Go to the JetBrains Rider website and download the free trial or purchase a license if you don’t already have one.
  2. Install Rider:
  • Run the Rider installer and follow the on-screen instructions to complete the installation.
  • Ensure you install the necessary plugins for Unreal Engine support during the installation process.

Setting Up Unreal Engine with Rider

  1. Launch Unreal Engine: Open the Epic Games Launcher, navigate to the “Unreal Engine” tab, and click “Launch”.
  2. Create a New Project:
    • In the Unreal Engine Project Browser, select New Project.
    • Choose Games and click Next.
    • Select a the Third Person Template.
    • Under Project Settings, ensure With Starter Content is selected.
    • Set the project to use C++ instead of Blueprint.
    • Choose a name and location for your project and click Create. I will call our project LearnPlusPlus, you can call it the same in order to follow along easily later on.
  3. Configure Rider:
  • Once the project is created, Unreal Engine will automatically generate project files.
  • Open the .uproject file in the project directory with Rider.
  • Rider will prompt you to install the necessary Unreal Engine and C++ support plugins if they are not already installed. Follow the prompts to complete the setup. When asked to install RiderLink, I recommend you install the plugin In Game rather than In Engine .
  • Lastly, in Unreal Engine, go to yourEditor Preferencesand type Source Code Editor in the search bar. Where you see Source Code Editor under the Accessor category, replace with Rider Uproject.

Verifying our Setup

  1. Build the Project: In Rider, select “Build” > “Build Solution” from the menu. Ensure the build completes without errors.
  2. Run the Project: Go back to Unreal Engine and click the “Play” button to run the project and verify that everything is working correctly. If you can move your character around and no error shows when you stop the game, then everything should be fine.

Troubleshooting Common Issues

  • Missing SDKs: If you encounter errors related to missing SDKs, make sure the Windows 10 SDK is installed. You can add it through the Rider installer or the Unreal Engine installer.
  • Intellisense Issues: If Intellisense (code completion and detection) isn’t working correctly in Rider, try rebuilding the project or restarting Rider.
  • Build Errors: Check the Output window in Rider for detailed error messages and ensure all necessary components are installed.

Conclusion

With Unreal Engine and Rider set up, you’re now ready to start coding in C++. This foundational step ensures you have the tools you need to follow along with the rest of this series. In the next article, we’ll explore the Unreal Engine project structure in detail, giving you a solid understanding of how everything fits together.

Stay tuned and happy coding!

--

--

Julien Hora
tokyopixels

Founder @ Dreamrunner Labs | Senior Software Engineer | Unreal Engine Generalist