Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Unreal Engine 4.X

You're reading from   Mastering Unreal Engine 4.X Master the art of building AAA games with Unreal Engine

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785883569
Length 384 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Muhammad A.Moniem Muhammad A.Moniem
Author Profile Icon Muhammad A.Moniem
Muhammad A.Moniem
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Preparing for a Big Project 2. Setting Up Your Warrior FREE CHAPTER 3. Designing Your Playground 4. The Road to Thinkable AI 5. Adding Collectables 6. The Magic of Particles 7. Enhancing the Visual Quality 8. Cinematics and In-Game Cutscenes 9. Implementing the Game UI 10. Save the Game Progress 11. Controlling Gameplay via Data Tables 12. Ear Candy 13. Profiling the Game Performance 14. Packaging the Game Index

Creating a C++ project

With the goals set, let's get started by launching the Unreal launcher. If you already have an Unreal Editor instance running, that is not a problem; just choose to make a new project from within the File menu and that will launch the proper screen of the launcher. Otherwise inside the launcher, just hit the Launch button of the editor version you want. After a few seconds of loading, the editor project selection window will appear. Do the following:

  1. Switch to the New Project tab.
  2. Under New Project, switch to the C++ subtab.
  3. Choose a Basic Code project type.
  4. Set the target to Desktop/Console as that's our target!
  5. Set the quality to Maximum Quality.
  6. Remove the starter content, it will not be useful at all.
  7. Give your project a name, but make sure to remember that name, as a lot of the code will be using it. Mine is called Bellz. I would say go ahead and name your project with the same name so you can easily follow along with the tutorial without any confusion or naming conflicts.
  8. Finally hit Create Project!
Creating a C++ project

If that was your first time creating a code project (which I guess is the case for the book's target audience), the project will take quite a time, it is not going to appear within a second like the other blueprint-based projects.

A C++-based project needs to copy some header files, build a Visual Studio solution/project (or Xcode if you are running on Mac), add the necessary code to the project, build files, inputs, the engine, and so on, and then finally run the Visual Studio command-line tool to compile and launch the project editor.

Now that you have a basic project, shall we go ahead and learn more about the C++ game project structure?

Yes!

But why?

Well, an Unreal project could increase to a crazy size at some point, especially if you are going to source-control your project using Git or SVN. You have to be wary about the space, as some free hosting services put a limit on the file type and file size you are using within your repository.

By opening the game project folder you will have these files and folders; some new files and folders might appear in the future as long as we keep adding stuff to the project. This is what I had by the end of the project:

Creating a C++ project

While the folder is full of subfolders and files, it makes much more sense to break it all down. If you understand how the project directory works, it will be easy to understand how the game director works, and how you can optimize the size of the project.

  • Binaries: This folder holds .dll files and executables that will be autogenerated during the compilation time.
  • Build: A folder for all the necessary files to build the editor or the game itself.
  • Config: A whole folder for the configuration files, basically a bunch of text files that hold a lot of the settings you set for the project and the game from within the project setting and the editor settings. You can do changes here, but it is not that easy to locate exactly what you want. However, it's a good place to search for the causes of problems.
  • Content: The Content folder hosts all the assets, blueprints, maps, Marketplace assets and any other item you use to build your game. Any folder you create inside your editor to hold some assets will end up inside the Content folder. Code files will not be included inside the content, in case your game is based on C++ not blueprints.
  • Intermediate: The majority of the files underneath this folder are temporary files, all of them being generated while building the game or the engine, which means deleting this folder's content will not affect you, as all the content will be regenerated as soon as you build.
  • Saved: The Saved folder contains lots of different saved files, some are backups that are saved every once in a while, some are autosaved copies of the assets, and other files are the save data of the game itself (saved using the save API).
  • Source: This folder contains all the game code. Any C++ classes you are going to add in the future for the project will end up in this folder.
  • PNGImage: The icon file for the project, which has the same name as the project; it is not necessary for it to represent the final build, but will be mainly used to visualize the project at the Unreal Launcher library section. Keep in mind that this image must be a square of 192 by 192 pixels. You can change it either by directly replacing it, or through the project settings.
  • SQLFile: This is an .sdf format file named with the project name; you don't have to worry that much about it, as Visual Studio will be generating a new one every time you open the solution.
  • Visual Studio solution: The Visual Studio solution for the game code has the same name as the project. You can open it directly, or you can launch it from within the Unreal Editor itself through the File menu. Keep in mind that the project options section of the File menu is very dynamic. If you have a C++-based project (such as the one we are creating) the menu will always give you two main options, the first to refresh the Visual Studio project and the second to open the Visual Studio project.
    Creating a C++ project

    But if you made a blueprint-based project, and at some point you wanted to convert it to a code file, you will find that the project options of the File menu display only one option for the Visual Studio, which is Generate Visual Studio Project.

    Creating a C++ project
  • Unreal Engine Project: An Unreal Engine project file that has the same name as the project and has the extension *.uproject. You can easily open the project using it, either by double-clicking on it or by browsing for it from the Unreal Launcher.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image