6.0 KiB
Part 1 (C++): Project Setup
← Back to Index | Next: Part 2 (C++) - Create the Player →
Overview
This is the C++ version of Part 1. Unlike the Blueprint tutorial which creates a Blueprint-only project, we'll create a C++ project from the start. This enables:
- ✅ Copy-paste variable definitions instead of clicking UI
- ✅ Version control friendly (readable diffs)
- ✅ Faster development (define 12 variables in 30 seconds vs 15 minutes)
Step 1.1: Create New C++ Project
-
Open Epic Games Launcher
-
Click "Unreal Engine" tab on the left sidebar
-
Click yellow "Launch" button next to your UE5 version
-
Wait for Unreal Engine to open (this may take 1-2 minutes)
-
In the "Unreal Project Browser" window that appears:
- At the top, select "Games" category (should be selected by default)
- Click "Blank" template (empty square icon)
-
On the right side panel, configure:
- Project Defaults: C++ ⚠️ (NOT Blueprint!)
- Target Platform: Desktop
- Quality Preset: Maximum (or Scalable for faster iteration)
- Starter Content: UNCHECKED (we don't need it)
- Raytracing: UNCHECKED
-
At the bottom:
- Choose folder location where you want to save
- Name the project:
BulletHellGame
-
Click "Create" button (bottom right, yellow)
What Happens Next
Unreal will:
- Generate C++ project files (~30 seconds)
- Open your IDE (Visual Studio, Rider, or VS Code)
- Compile the initial project (2-5 minutes, first time only)
- Open Unreal Editor
⚠️ IMPORTANT: Do NOT close the IDE or compilation window! Wait for compilation to finish.
Expected Result
After compilation completes:
- Unreal Editor opens with an empty level
- Your IDE is open with the project (Visual Studio/Rider/VS Code)
- Main 3D viewport in the center
- Outliner panel on the right (showing "Untitled" level)
Troubleshooting
IDE didn't open?
- Check if Visual Studio or Rider is installed
- Go to
Edit → Editor Preferences → Source Code - Set "Source Code Editor" to your preferred IDE
- Right-click the
.uprojectfile → "Generate Visual Studio project files" - Open the
.slnfile in your IDE
Compilation failed?
- Check the Output Log (Window → Developer Tools → Output Log)
- Common issue: Missing Visual Studio C++ tools
- Install "Desktop Development with C++" workload in Visual Studio Installer
- Try:
File → Refresh Visual Studio Project
Step 1.2: Verify C++ Project Structure
Before continuing, verify the C++ files were created:
- In your file explorer, navigate to your project folder
- You should see:
BulletHellGame/
├── BulletHellGame.uproject # Project file
├── Source/ # ⭐ C++ source code (this is new!)
│ └── BulletHellGame/
│ ├── BulletHellGame.h
│ ├── BulletHellGame.cpp
│ ├── BulletHellGame.Build.cs # Build configuration
│ └── BulletHellGameGameMode.h/cpp # Auto-generated
├── Content/ # Assets and Blueprints
├── Config/ # Project settings
├── Binaries/ # Compiled code (gitignore this)
├── Intermediate/ # Build artifacts (gitignore this)
└── BulletHellGame.sln # Visual Studio solution (if using VS)
The Source/ folder is what makes this a C++ project! This is where we'll add our game classes.
Step 1.3: Set Up 2D Game View
Same as Blueprint tutorial:
- In the main viewport, look at the top-left corner
- Click the dropdown that says "Perspective"
- Select "Top" from the dropdown menu (
Alt + J)
Step 1.4: Create Folder Structure
-
Open Content Browser (or Content Drawer with
Ctrl+Space) -
You should see "Content" folder on the left panel
-
Right-click on "Content" folder → New Folder
- Name it:
Blueprints(we'll use these for visual-only children)
- Name it:
-
Right-click on "Content" folder → New Folder
- Name it:
Materials
- Name it:
-
Right-click on "Content" folder → New Folder
- Name it:
Sprites(for 2D textures)
- Name it:
-
Right-click on "Content" folder → New Folder
- Name it:
UI
- Name it:
Expected Result
Content Browser shows 4 folders:
Content/
├── Blueprints/ (For Blueprint children that inherit from C++)
├── Materials/
├── Sprites/
└── UI/
AND you should also see:
C++ Classes/
└── BulletHellGame/
└── BulletHellGameGameMode (Auto-generated C++ class)
This "C++ Classes" folder shows all C++ classes in the project.
Step 1.5: Configure .gitignore (Recommended)
If using version control, create .gitignore in your project root:
# Unreal Engine
Binaries/
DerivedDataCache/
Intermediate/
Saved/
# IDE
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb
.vs/
.vscode/
.idea/
# Build artifacts
Build/
Releases/
This prevents committing large binary files and build artifacts.
Comparison: C++ vs Blueprint Project
| Aspect | Blueprint Project | C++ Project |
|---|---|---|
| Project creation time | ~30 seconds | ~5 minutes (first time) |
| Source/ folder | ❌ No | ✅ Yes |
| IDE integration | ❌ No | ✅ Yes |
| Can add C++ classes | ❌ Requires migration | ✅ Ready to go |
| Compile time | None (Blueprints) | 30-60 sec per change |
| Hot reload | Instant | Limited support |
Key Difference: C++ project has the Source/ folder from the start. Blueprint projects require manual migration to add C++ support later.
What's Next?
In Part 2, we'll create the player ship as a C++ class instead of a Blueprint. You'll see how defining 12 variables takes 30 seconds with copy-paste instead of 15 minutes with UI clicks.