How to Create a Souls-Like Game in Unreal Engine 5 - Full Course
Table of Contents
Introduction
In this tutorial, we will walk through the process of creating a Souls-like game using Unreal Engine 5. This guide is based on a comprehensive course from Gorka Games, covering everything from project setup to advanced gameplay mechanics. By the end, you will have a solid foundation to develop your own game inspired by the popular Souls series.
Step 1: Create a New Project
- Open Unreal Engine 5.
- Select "Games" from the project categories.
- Choose "Blank" as the project type.
- Ensure "With Starter Content" is selected for additional assets.
- Name your project and choose a save location.
- Click "Create" to initialize your project.
Step 2: Implement Strafe Movement and Locomotion
- Open your character blueprint.
- Add input mappings for strafe movement (WASD keys).
- Set up movement settings under the character's movement component.
- Use the following code snippet to enable smooth strafe movement in the Event Graph:
InputAxis MoveRight
Add Actor Local Offset (X: 0, Y: Axis Value, Z: 0)
InputAxis MoveForward
Add Actor Local Offset (X: Axis Value, Y: 0, Z: 0)
- Test the movement in the editor to ensure smooth locomotion.
Step 3: Set Up Target Locking
- Create a target locking system to enhance combat.
- Add a targeting input key (e.g., Tab) in the Input settings.
- Implement a mechanism to lock onto enemies by adjusting the camera’s position and orientation.
- Use a boolean variable to toggle the target lock status.
Step 4: Create Attack Combos
- Define basic attack animations and import them into your project.
- Set up an input mapping for attack actions.
- Use a state machine in the character's animation blueprint to create combos.
- Example code for handling attack inputs:
InputAction Attack
Play Animation (Attack1)
If Attack1 is finished
Play Animation (Attack2)
- Test the combo mechanics in-game.
Step 5: Implement Health Stat
- Create a health variable in the character blueprint.
- Set up a function to handle health reduction on damage.
- Display health in the UI using a progress bar.
- Example code for applying damage:
Function TakeDamage
Health = Health - DamageAmount
If Health <= 0
Trigger Death Sequence
Step 6: Enable Dodging Mechanic
- Add a dodge input mapping (e.g., Spacebar).
- Create a dodge animation and link it to the input.
- Implement an if-condition to check if the character can dodge (i.e., not in attack animation).
- Use a cooldown timer to limit dodge spamming.
Step 7: Set Up AI Core
- Create a new AI blueprint for enemy characters.
- Implement basic AI behavior using behavior trees.
- Set up patrol and chase states
- Use a state machine to switch between idle, patrol, and chase states based on player proximity.
Step 8: AI Combat Mechanics
- Add attacking functionality to the AI character.
- Implement a health variable for the AI.
- Use a similar damage system as the player character for consistency.
Step 9: Develop Boss AI
- Create a separate AI blueprint for the boss.
- Add unique attack patterns and phases.
- Implement health thresholds to change behavior as the boss takes damage.
Step 10: Create Inventory System
- Set up an inventory structure to hold items.
- Create slots for each item and implement interactions for picking up weapons or potions.
- Use UI widgets to display the inventory.
Step 11: Design Game Environment
- Use assets from the provided links for creating the game environment.
- Import the fantasy castle environment and place it within the level.
- Ensure there are areas for combat and exploration.
Conclusion
Throughout this tutorial, we’ve covered the essential steps to create a basic Souls-like game in Unreal Engine 5, from project creation to implementing gameplay mechanics. You can expand upon these foundations by adding more features, refining the gameplay, or enhancing graphics. Don't forget to experiment and iterate as you develop your game further! For complete project resources and assets, check out the links provided in the video description. Happy game developing!