The first thing we need to do is make a new project.
You will need to have the Epic Games Launcher and Unreal Engine 4 installed to follow along with this tutorial. If you don't already, install them here. You'll want the Publishing License. For this tutorial, I'm using version 4.24 of the Engine, but the code used here should work for earlier versions too. You will also need Visual Studio, an IDE for writing and building our program. Follow the instructions here to get set up.
Make a Project
To create a new project, open up the Epic Games Launcher, navigate to the Unreal Engine tab, and launch the Engine by clicking the Launch button next to the version of your choice.
Give the Engine a moment to load.
Configure Project Specs
Once the Engine opens up, you should see a screen which lists your current projects and gives you an option to create a new project, like this one:
Follow the prompts to create a Blank new project. On the Project Settings page, we need two specific configurations:
- The project type should be set to C++. This means we can use both C++ and Blueprints.
- Enable StarterContent. It comes with all sorts of assets that we can use to get cracking without having to worry about creating or sourcing them ourselves.
Everything else can be left at default.
Name and Place Your Project
Give any name you want to the project. I'll be naming my project Toro and will be using that name throughout.
Then pick a place for your project by clicking the ... icon next to the project path and browsing to your desired folder. It just needs to be a top-level directory (like UE4Projects). The Engine will create your new project in a folder of its own named after the project.
If you have the space, I recommend placing the project on a solid state drive (SSD) as opposed to a hard drive (HDD). Your load and build times will be much faster.
By the end, your project settings should look something like this:
Hit Create Project and sit back as the Engine creates a new project for you.
Explore the Project
When the project is ready, you should see two things:
- An instance of the Unreal Engine 4 Editor showing a default level.
- A Visual Studio window containing your project's code solution.
The Unreal Editor (often just called the Editor) is the defining feature of Unreal Engine 4. It provides a graphical interface for dragging and dropping assets into the game world, scripting custom shaders, writing game logic using visual nodes in Blueprint assets, and much more. Take a few minutes to click around the Editor and see what you can find in the various menus.
Once closed, you can open the Editor by going to your project folder and double-clicking Toro.uproject.
Visual Studio is an integrated development environment (IDE, for short) that allows you to see all of your project's code files in one place, edit those code files, and build an executable program from the code. In the Solution Explorer panel, you'll see an Engine folder which contains the Unreal Engine 4 program. The program is prebuilt when you install the Engine from the Epic Games website, so we won't need to do anything with that.
You'll also see a Games folder that contains a program with your project's name and a sub-folder called Source, which actually holds all of the
.cpp files that we'll use in our game. Again, take a few minutes to click through files to see what's in here.
Once closed, you can open Visual Studio by going to your project folder and double-clicking Toro.sln.
Create a Play Level
Although the default chairs are great and all, we have no need for sitting in our raw, unadulterated tower defense universe. Let's make a new level unsoiled by the fineries of chairdom that will serve as the battleground for our epic clash.
Along the top left corner of the Editor, find the File menu and click New Level. Use the Default option provided in the dialog that pops up.
And voila! We have a new, mostly empty level waiting to be filled with gore and destruction. Let's call it Play and save it under a new folder called Maps, like so: Content/Maps/Play.
Last, find the Edit menu at the top left corner of the Editor, and navigate to Project Settings. Find the Maps and Modes section, and in there set the value of
EditorStartupMap to Play. As the name suggests, when we start the Editor next time, our Play level will open by default.
Add Marketplace Content
The last thing we need to do to set the stage for our development journey is pull in external content from the Unreal Engine 4 Marketplace. The Marketplace is a place for Epic and independent developers to sell plugins, assets, and other nifty things that you can use to make your own game. Even better, a fair amount of things on there are 100% free. We'll be using one of these free assets for our project. The Animation Starter Pack comes with a basic humanoid skeletal mesh and animations for idling, running, and shooting. It's perfect for our needs!
To use it, click the link above to add it to your account (again: it's free). Once it's added to your account, go back to the Epic Games Launcher and under the Library tab you should now see a Vault section with a thumbnail for the Animation Starter Pack. Click the Add to Project button and add it to Toro. This will download the assets and place them in your project under the Content folder.
That's it! Our project is all set up.