I have always been impressed by good combat in games, specifically good melee combat. It takes a special combination of animation, effects to make a slicing through an enemy with an ultra-great sword feel just right. One of the few games (and one of my favorite games) that manages to achieve this balance is Dark Souls, and I’ve been on a quest to replicate that combat system ever since I finished playing the game.
I attempted to replicate the Dark Souls combat system in Unreal Engine 4 over a four week period, dedicating an average of 8-10 hours per week. I chose to build it in Unreal in order to build on my base knowledge on Unreal and more specifically to get accustomed to its animation system. Here is a list of the systems I managed to build:
Dark Souls uses an animation driven combat system at its core. This means that the colliders that determine whether the player has hit the enemy (or vice versa) reside on the weapon itself and the decision as to whether the collision has happened is based on how the animation moves the weapon on which the collider resides. This video explains more about the animation driven combat system used in Dark Souls.
As the name suggests an animation driven combat system is heavily dependent on animations, so one of the first things I had to do was source a good set of animations for the player. Luckily I had access to Mixamo which gave me access to a bunch of open source animations and models. I was able to use the same resource to get some reasonable looking enemy animations too.
I started by using a third person template as a base and stripping out all the unnecessary features. I removed all the keyboard mappings and actions and added the dark souls control schemes. This was important because the control scheme is integral to making the combat system feel good.
The next step was building the core systems, mainly the health and stamina systems. Stamina is an important resource, it is used for a most actions in the game and stamina management is an important aspect of gameplay. Attacking, blocking, running and rolling all consume stamina; if there isn’t enough stamina to perform a certain action, the action cannot be performed.
Implementing the player actions involved some animation programming and creating blend states. Implementing attack and rolling involved setting up animation notifies that would drive gameplay events. Adding the shield block involved animation layer masking which was quite fun to learn and implement.
Once I was done with the main player mechanics, I realized I had some time left to implement the enemy AI, because what would a combat system be if there’s no one to kill?
The AI has the same stat system as the player, it has stamina and health, it can block the player’s attacks and the player can stagger the enemy by attacking its shield and depleting its stamina. Designing and coding the enemy gave me an excuse to learn Unreal’s behavior tree system which is something I wanted to learn for quite some time.
Overall this was a great experience, I was able to combine something I’ve wanted to implement (Combat System) and something I’ve wanted to learn (UE4) in one project. I was able to dive into the Unreal animation system and behavior tree system and get a good grasp on how they work and what they are capable of achieving.
I attempted to replicate the Dark Souls combat system in Unreal Engine 4 over a four week period, dedicating an average of 8-10 hours per week. I chose to build it in Unreal in order to build on my base knowledge on Unreal and more specifically to get accustomed to its animation system. Here is a list of the systems I managed to build:
- Stamina System
- Damage System – Attack and Block
- Rolling and Iframes
- Targeting System
Dark Souls uses an animation driven combat system at its core. This means that the colliders that determine whether the player has hit the enemy (or vice versa) reside on the weapon itself and the decision as to whether the collision has happened is based on how the animation moves the weapon on which the collider resides. This video explains more about the animation driven combat system used in Dark Souls.
As the name suggests an animation driven combat system is heavily dependent on animations, so one of the first things I had to do was source a good set of animations for the player. Luckily I had access to Mixamo which gave me access to a bunch of open source animations and models. I was able to use the same resource to get some reasonable looking enemy animations too.
I started by using a third person template as a base and stripping out all the unnecessary features. I removed all the keyboard mappings and actions and added the dark souls control schemes. This was important because the control scheme is integral to making the combat system feel good.
The next step was building the core systems, mainly the health and stamina systems. Stamina is an important resource, it is used for a most actions in the game and stamina management is an important aspect of gameplay. Attacking, blocking, running and rolling all consume stamina; if there isn’t enough stamina to perform a certain action, the action cannot be performed.
Implementing the player actions involved some animation programming and creating blend states. Implementing attack and rolling involved setting up animation notifies that would drive gameplay events. Adding the shield block involved animation layer masking which was quite fun to learn and implement.
Once I was done with the main player mechanics, I realized I had some time left to implement the enemy AI, because what would a combat system be if there’s no one to kill?
The AI has the same stat system as the player, it has stamina and health, it can block the player’s attacks and the player can stagger the enemy by attacking its shield and depleting its stamina. Designing and coding the enemy gave me an excuse to learn Unreal’s behavior tree system which is something I wanted to learn for quite some time.
Overall this was a great experience, I was able to combine something I’ve wanted to implement (Combat System) and something I’ve wanted to learn (UE4) in one project. I was able to dive into the Unreal animation system and behavior tree system and get a good grasp on how they work and what they are capable of achieving.
Powered by
Create your own unique website with customizable templates.
