Lesson 2: Unreal Engine Setup & Networking Foundation
Welcome to Unreal Engine Multiplayer Development!
Congratulations on completing Lesson 1! Now it's time to get your hands dirty with Unreal Engine 5. In this lesson, you'll set up your development environment, configure networking settings, and create the foundation for your multiplayer battle royale game.
Learning Objectives
By the end of this lesson, you will:
- β Install and configure Unreal Engine 5 for multiplayer development
- β Create a new multiplayer project with proper structure
- β Understand Unreal's networking architecture
- β Configure replication settings and server/client roles
- β Set up version control with Git
- β Create your first multiplayer test scene
Part 1: Installing Unreal Engine 5
Step 1: Download Epic Games Launcher
1.1 Get the Launcher
- Visit Epic Games Launcher
- Download and install the Epic Games Launcher
- Create an Epic Games account if you don't have one
1.2 Install Unreal Engine 5
- Open Epic Games Launcher
- Navigate to "Unreal Engine" tab
- Click "Install Engine"
- Select Unreal Engine 5.3 or newer (recommended: Latest stable version)
- Choose installation location (ensure 50+ GB free space)
- Click "Install" and wait for completion (30-60 minutes)
Step 2: Verify Installation
2.1 Launch Unreal Engine
- Open Epic Games Launcher
- Click "Launch" under Unreal Engine
- Wait for the project browser to open
2.2 Check Version
- In the project browser, verify you're using UE 5.3 or newer
- Check that all required components are installed
Part 2: Creating Your Multiplayer Project
Step 3: Create New Project
3.1 Project Template Selection
- In Unreal Engine project browser, click "New Project"
- Select "Games" category
- Choose "Third Person" template (good starting point for battle royale)
- Select "C++" (not Blueprint-only) for full networking control
- Click "Next"
3.2 Project Settings
- Project Name:
MultiplayerBattleRoyale - Location: Choose a dedicated folder (e.g.,
C:\Projects\or~/Projects/) - Target Platform: Desktop
- Quality Preset: Maximum (you can optimize later)
- Raytracing: Optional (requires RTX GPU)
- Click "Create Project"
3.3 Wait for Project Generation
- Unreal will generate C++ project files
- Visual Studio or Rider will open automatically
- First compile may take 10-20 minutes
- Wait for compilation to complete
Step 4: Project Structure Setup
4.1 Create Folder Structure
In the Content Browser, create this structure:
Content/
βββ Maps/ # Game levels
β βββ MainMenu/
β βββ Lobby/
β βββ BattleRoyale/
βββ Blueprints/ # Blueprint classes
β βββ Characters/
β βββ Weapons/
β βββ GameModes/
β βββ UI/
βββ Materials/ # Material assets
βββ Textures/ # Texture assets
βββ Meshes/ # Static meshes
βββ Audio/ # Sound effects and music
βββ UI/ # User interface assets
βββ Data/ # Data tables and configs
βββ Plugins/ # Custom plugins
4.2 Create Initial Maps
- Right-click in Maps/ folder β Miscellaneous β Level
- Create:
MainMenu,Lobby,BattleRoyale_Main - Set
BattleRoyale_Mainas default map
Part 3: Understanding Unreal Networking
Step 5: Networking Architecture Overview
5.1 Client-Server Model
Unreal uses a dedicated server architecture:
βββββββββββββββ
β Server β β Source of Truth (Authoritative)
β (Host) β
ββββββββ¬βββββββ
β
β Replication
β
βββββ΄ββββ
βClient β β Receives updates, sends input
βββββββββ
Key Concepts:
- Server: Runs game logic, validates actions, replicates state
- Client: Sends input, receives updates, predicts locally
- Replication: Server sends state updates to clients
- RPCs: Remote Procedure Calls for client-server communication
5.2 Network Roles
Every actor has a network role:
- Authority: Server has authority (source of truth)
- Autonomous Proxy: Client controlling this actor (can send RPCs)
- Simulated Proxy: Other clients' actors (receives replication)
Step 6: Configure Networking Settings
6.1 Project Settings - Networking
- Go to Edit β Project Settings
- Navigate to Engine β Network
- Configure these settings:
Default Network Mode: Dedicated Server
Replication Graph: Enabled (for large player counts)
Max Net Tick Rate: 60
Net Driver Definition: GameNetDriver
6.2 Enable Replication Graph
For 50-100 players, enable Replication Graph:
- In Project Settings β Engine β Network
- Check "Use Replication Graph"
- This optimizes replication for large player counts
6.3 Configure Server Settings
Create Config/DefaultEngine.ini:
[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=20000
MaxDynamicBandwidth=10000
MinDynamicBandwidth=10000
Part 4: Creating Your First Multiplayer Class
Step 7: Create Character Class
7.1 Create C++ Character Class
- In Content Browser, right-click β New C++ Class
- Select "Character" as parent class
- Name it:
BRCharacter(Battle Royale Character) - Click "Create Class"
7.2 Basic Character Setup
Open BRCharacter.h and add:
UCLASS()
class MULTIPLAYERBATTLEROYALE_API ABRCharacter : public ACharacter
{
GENERATED_BODY()
public:
ABRCharacter(const FObjectInitializer& ObjectInitializer);
protected:
virtual void BeginPlay() override;
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
// Replicated properties
UPROPERTY(Replicated)
float Health;
UPROPERTY(Replicated)
float MaxHealth;
public:
// RPC for taking damage
UFUNCTION(Server, Reliable, WithValidation)
void ServerTakeDamage(float DamageAmount);
// Replication function
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
};
7.3 Implement Character Class
Open BRCharacter.cpp:
#include "BRCharacter.h"
#include "Net/UnrealNetwork.h"
ABRCharacter::ABRCharacter(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
PrimaryActorTick.bCanEverTick = true;
// Set default values
MaxHealth = 100.0f;
Health = MaxHealth;
// Enable replication
bReplicates = true;
SetReplicatingMovement(true);
}
void ABRCharacter::BeginPlay()
{
Super::BeginPlay();
}
void ABRCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
void ABRCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
// Replicate health
DOREPLIFETIME(ABRCharacter, Health);
DOREPLIFETIME(ABRCharacter, MaxHealth);
}
void ABRCharacter::ServerTakeDamage_Implementation(float DamageAmount)
{
Health = FMath::Clamp(Health - DamageAmount, 0.0f, MaxHealth);
if (Health <= 0.0f)
{
// Handle death
}
}
bool ABRCharacter::ServerTakeDamage_Validate(float DamageAmount)
{
return DamageAmount >= 0.0f && DamageAmount <= 1000.0f;
}
Step 8: Create Game Mode
8.1 Create C++ Game Mode
- Right-click β New C++ Class
- Select "Game Mode" as parent class
- Name it:
BRGameMode - Click "Create Class"
8.2 Configure Game Mode
In BRGameMode.h:
UCLASS()
class MULTIPLAYERBATTLEROYALE_API ABRGameMode : public AGameMode
{
GENERATED_BODY()
public:
ABRGameMode();
// Maximum players per match
UPROPERTY(EditDefaultsOnly, Category = "Battle Royale")
int32 MaxPlayers = 100;
// Match duration in seconds
UPROPERTY(EditDefaultsOnly, Category = "Battle Royale")
float MatchDuration = 1800.0f; // 30 minutes
protected:
virtual void BeginPlay() override;
};
Part 5: Version Control Setup
Step 9: Initialize Git Repository
9.1 Create .gitignore
Create .gitignore in project root:
# Unreal Engine
Binaries/
DerivedDataCache/
Intermediate/
Saved/
*.sln
*.xcodeproj
*.xcworkspace
# Visual Studio
.vs/
*.suo
*.user
*.userosscache
# Rider
.idea/
# OS
.DS_Store
Thumbs.db
9.2 Initialize Git
cd /path/to/MultiplayerBattleRoyale
git init
git add .
git commit -m "Initial commit: Unreal Engine 5 multiplayer project setup"
9.3 Create Remote Repository
- Create repository on GitHub/GitLab
- Add remote:
git remote add origin <repository-url> - Push:
git push -u origin main
Part 6: Testing Your Setup
Step 10: Create Test Scene
10.1 Set Up Test Level
- Open
BattleRoyale_Mainlevel - Add your
BRCharacterto the level - Set
BRGameModeas default game mode:- Edit β World Settings
- Set Game Mode Override to
BRGameMode
10.2 Test Multiplayer
-
Play in Editor (PIE):
- Click "Play" button
- Select "Number of Players": 2
- Click "New Editor Window" for each client
- Test that both clients can see each other
-
Dedicated Server Test:
- Edit β Editor Preferences β Play
- Set "Run Dedicated Server": Enabled
- Launch and connect clients
Mini Challenge: Create Basic Multiplayer Test
Task: Create a simple multiplayer test that demonstrates replication.
Requirements:
- Create a character that can move and jump
- Add a replicated health property
- Create an RPC to modify health
- Test with 2+ clients to verify replication
- Verify that health changes replicate to all clients
Deliverables:
- Working multiplayer character class
- RPC for health modification
- Test results showing successful replication
Pro Tips:
- Always test with multiple clients, not just single-player
- Use
GetNetMode()to check if running on server or client - Enable "Replay" recording to debug networking issues
- Use Network Profiler to monitor replication bandwidth
Common Mistakes to Avoid
1. Forgetting Replication
- β Creating properties without
Replicatedspecifier - β
Always mark networked properties with
UPROPERTY(Replicated)
2. Client Authority
- β Trusting client input without server validation
- β Always validate on server, never trust client data
3. Missing GetLifetimeReplicatedProps
- β Forgetting to call
DOREPLIFETIMEfor replicated properties - β
Always implement
GetLifetimeReplicatedPropsfor replicated classes
4. Not Testing Multiplayer
- β Testing only in single-player mode
- β Always test with multiple clients to catch networking issues
Troubleshooting
Q: Characters don't replicate between clients
A: Check that bReplicates = true and SetReplicatingMovement(true) are set in constructor.
Q: RPCs not working
A: Ensure RPC functions have Server, Client, or NetMulticast specifiers and _Implementation suffix.
Q: Compilation errors after creating C++ class A: Close Unreal Editor, rebuild project in Visual Studio/Rider, then reopen editor.
Q: Can't see other players A: Verify network roles, check that characters are spawned on server, and ensure replication is enabled.
Q: High latency in multiplayer A: Check tick rate settings, optimize replication frequency, and use Replication Graph for large player counts.
Key Takeaways
β
Unreal Engine Setup: Install UE5 and create C++ project for full networking control
β
Networking Architecture: Understand client-server model and replication
β
Replication: Mark properties with Replicated and implement GetLifetimeReplicatedProps
β
RPCs: Use Server/Client RPCs for client-server communication
β
Testing: Always test with multiple clients to verify networking
β
Version Control: Set up Git for collaboration and project management
What's Next?
In Lesson 3: Art Style & Asset Pipeline Planning, we'll:
- Define your game's visual style and art direction
- Plan asset creation pipeline and workflows
- Set up art tools and integration processes
- Create style guides and reference materials
- Plan asset optimization for multiplayer performance
Get ready to bring your battle royale world to life with stunning visuals!
Additional Resources
- Unreal Engine Networking Documentation
- Replication Graph Guide
- RPC Best Practices
- Multiplayer Debugging Tools
Ready to continue? Move on to Lesson 3 to plan your art pipeline and visual style!