Witcher Mini Adventure

As a design exercise, I created a fan game set in The Witcher universe in Unreal Engine 5 which is freely available to download and play here.

Narrative

You step into the shoes of a thief named Gilmena Mavier, an original character that I created for this exercise. She was thrown into prison after being caught picking a noble’s pocket and while plotting a way out, she was visited by a hooded man who left her the key to her cell and a note before he left without saying a word. The note described a heist she was to undertake to steal a magic sword from Aretuza, a school for those gifted in magic. The sword can absorb magic and redirect it, allowing even those with no magic potential to harness its power and use it against the caster.

Once the player escapes with the sword, the rest of Gilmena’s story is told. She escaped Aretuza with the sword and brought it to the person who arranged her escape. At this point, it is revealed the sword was brought to a character named Vilgefortz, an existing antagonist in the Witcher universe who has a hatred of mages. Gilmena makes off with a small fortune to start a new life while unknowingly delivering a weapon capable of stealing and harnessing magical power into the hands of someone who hates mages. He then goes on to do terrible things with this power.

I added this alternative path for the character of Vilgefortz as he is a known to fans and it makes sense for his character to covet an weapon like this but also as a way of making players reflect on their actions and subvert their expectations.

Gameplay

The player takes control of Gilmena right as she is about to steal the sword which triggers several traps and combat scenarios, each of which explains new mechanics to the player. The player has the following actions:

  • Spacebar – Jump
  • CTRL – Dodge
  • E – Interact
  • Middle Mouse Button – Aard Sign (a spell in the Witch universe that can knockback foes)
  • Left Click – Swing your sword
  • Right Click – Deflect
  • Left Click (While magic is absorbed) – Fire out a wave of magic in the area in front of you
  • Right Click (While magic is absorbed) – Fire out a long range projectile

The game takes place over 4 rooms, each of which teaches a new concept to the player.

The first room where the player steals the sword triggers a trap that shoots a fireball at the player and slows down time while explaining how the player should react.

  • In this case, the player can use their Deflect to block the fireball and absorb the fire element into the sword.
  • The player can then use the fire element to melt the icy floor below them to fall into the next room.

When the player lands, they are surrounded by 8 golems, 4 imbued with fire and 4 imbued with ice. There are also 4 vents in the room, 2 ice and 2 fire, that shoot out magical energy to anyone that steps on them. Fire Golems are immune to fire but are instantly killed by ice damage and ice golems are immune to ice but are instantly killed by fire damage. Once all golems are dispatched, the barrier blocking the door drops. Players can get creative and approach this room in a few different ways.

  • They can wildly swing their sword to kill each golem but will likely take a lot of damage doing this.
  • They can deflect a fire golem’s attack to absorb fire element and then use fire attacks to kill ice golems and vice versa.
  • They can deflect damage emitted from the vents and use that to kill golems.
  • They can use the Aard sign to push golems into vents of the opposite element to kill them instantly.

Entering the next room triggers a frost trap. Again, time slows down and the player is taught that they can absorb ice element and direct it into water to create an icy surface. If the player falls into water, they are instantly killed.

  • The player must deflect an icy projectile and use it to create an ice surface to cross a body of water.

The finale starts once the player interacts with a wheel after crossing the water. A barrier drops and water begins to fill a large, open corridor. There are several platforms throughout the corridor that have ranged attacking golems on them that will fire at the player once they are close enough. The player must use several wooden planks and the sword’s power to safely cross the room before it entirely fills with water.

  • The player first jumps down onto a plank as two fire golems begin firing at them. There is a large block of ice blocking the path forward so the player needs to deflect a fireball and redirect it to destroy the ice and clear the path.
  • After clearing the ice block, the player can jump to another plank that leads to ice golems. The player can redirect their attacks into the water to create an ice surface to cross to the next plank.
  • The third section features a fire and an ice golem. There is a large ice block that must be destroyed using fire which opens a large gap of water between planks. The player can then use the ice golem’s attacks to create icy surfaces in the water and cross.
  • After making it across to the last plank, the player needs to run to the end of the room before it fills with water where there is an opening in the ceiling that leads to a corridor with a light at the end of it.

Technical Aspects

The project was created in Unreal Engine 5 using Unreal Blueprints and the Gameplay Ability System. Every action aside from movement, jumping and interacting makes use of GAS.

I set up GAS in C++ with attributes for CurrentHealth, MaxHealth, CurrentStamina and MaxStamina. I set up a BP_FTCharacter which has an ability system and attribute set. The player character and enemy base character are both children of this class.

Most of the player and enemy functionality in this game is set up using Gameplay Abilities. Some of these abilities include the basic attacks, deflect, Aard and the empowered skills. Most of these are straightforward and are set up to play a montage and perform some logic like apply gameplay effects or spawn a projectile based on notifies so the timing can be managed in the montage.

The most interesting ability to work on was Deflect. Here I had to play a montage and loop a section while the player anticipates an attack. I apply a gameplay effect to the player which has a duration of 1 second and grants a CharacterStatus.Deflecting tag. Once this tag is removed, we jump past the looping montage section to allow the ability to end.

All damage effects include a GameplayEffectCustomApplicationRequirement which checks the target actor to determine if they are deflecting or evading or should take the damage. If the player is deflecting, we do not apply the effect and instead grant the player a Fire/IceAbsorbed tag which, through the use of blocking/activation required tags in other gameplay abilities, allows me to swap which ability will be used at any given time on the same input. To add to this, I also grant the player a short 0.5 second window of evasion when the deflect tag is removed by a successful deflection to allow the player to deflect multiple attacks while only storing the element from the first deflection so players can better control what element they are getting. 

This is just one of the many abilities that have been created that I’m happy to elaborate on but this was the most interesting to work on for me.

Enemies work similarly to players except they are controlled by behaviour trees and select their abilities using a custom AIAbilities component which checks their abilities and selects one based on a weighted value.

Melee enemies in the golem room have a basic attack and ranged enemies in the water room have a ranged attack. Each enemy includes tags that informs their abilities which effects to apply, which VFX should be shown during attacks and what tags will instantly kill them if they are applied. They are also tied to different triggers in the form of interactables and trigger boxes which activate them as needed.

Level Design

Moving onto environment, I began by building in smaller rooms for two reasons:

  • I could make the systems that interact with each other in a more focused setting.
  • The smaller rooms teach players one mechanic at a time, helping them to learn the systems in the game without getting overwhelmed.

I created a mesh in blender for the level layout along with some other supporting assets to make up the level. 

The first room is a very short section designed to drip feed mechanics to the player. The player enters the room and takes the sword from the ice, activating a fire trap that the player can use to absorb fire and redirect it into the icy floor to drop into the next room. The second room is designed to test their knowledge of these controls in a short combat segment as previously described. Right after this, they are taught to freeze water as this is important to understand for the final section.

Ultimately, I wanted the experience to culminate in an intense finale but I had originally scoped much smaller. After seeing the systems come together as successfully as they did, they allowed me to increase the size of the final room and try to make it as epic as possible.