top of page

FALLEN VALKYRIE

Fallen Valkyrie was a project developed over 10 weeks, which served as a deep dive into more complex animation blueprint systems and enemy artificial intelligence. On this page, you’ll find uncut gameplay footage of the prototype, along with detailed breakdowns and my insights on their implementation.

DESIGN AND LAYOUT

For this project, I was responsible for all gameplay logic, Blueprints, animation Blueprints, level design, game design, in-game cinematics, and scene assembly. Various asset packs were used in conjunction—including, but not limited to, environments, enemies, and the player character. I did not use any pre-existing logic (such as Blueprints, animation Blueprints, or blendspaces) provided by these asset packs; all systems were built from scratch.

The main level was designed as a linear boss stage, featuring an enemy tracker system built on event dispatchers. This system can also drive related logic, such as unlocking the main gate upon certain conditions. The boss fight is multiphase, with cinematic sequences used to smoothly transition between stages. Player progression through the level is controlled using trigger volumes, which serve as main gates.

CHARACTER INPUTS AND ANIMATIONS

The player character has two weapons she can alternate between, as well as a generic unarmed state. Her animations and abilities change dynamically based on the equipped weapon. This is handled by blending state machines in the animation blueprint using an enumerator (e.g., default, spear, bow). The same logic determines which animation montages are played in response to player input. Additional animation slots, combined with layered blend per bone, are used to separate upper and lower body animations for actions such as weapon switching and healing. The animations for blendspaces and skills were retargeted to the relevant skeletons from selected animation packs.

Enemy animation blueprints use simpler logic—primarily driven by montages played within StateTreeTasks (see section ENEMY AI). Some blending is still applied, such as for the boss’s wings, which utilize Kawaii Physics, an external physics plugin, for accentuated secondary motion simulation. Hair and cloth elements also use Kawaii Physics to achieve visually dynamic movement.

ENEMY AND CHARACTER STATS

Health, stamina, and mana were implemented with straightforward logic, each accompanied by corresponding regeneration events. For stamina and mana, regeneration is triggered two seconds after their last usage, encouraging players to manage their resources more efficiently.

Damage is handled through a blueprint interface, which also acts as a filter for trace collisions. This interface passes hit data to other systems as well (see section STAGGER SYSTEM). The colliders responsible for triggering damage events are parented to socket joints on the weapon assets and are activated or deactivated via animation notify events within the animation blueprint. Implementing this with OnComponentBeginOverlap presented some challenges, as overlap events do not generate a hit location (see section STAGGER SYSTEM).

TARGETING AND LOCK-ON

Targeting behavior changes depending on the weapon Chengyi has equipped. For the spear, a sphere trace is performed at her location to search for relevant actors implementing the damage interface. If a valid target is found, the player controller rotates to face the target using a LookAt vector. With the bow equipped, the player can freely aim after smoothly transitioning to an over-the-shoulder camera angle. To ensure the projectile aligns with the crosshair, a line trace is performed from the camera to detect a blocking hit within a specified range. If a valid hit is detected, this point is used to drive the vector math for the projectile’s direction.

Lock-on functionality is available via the middle mouse button. When pressed, a large sphere trace is performed based on the forward vector of the player camera. If a valid actor with the damage interface is detected, that actor is set as the lock-on target, and the controller automatically orients toward the target. The exception is bow aim mode, which overrides lock-on and allows the player to continue aiming freely. Pressing the lock-on input again releases the target, restoring full camera control to the player.

STAGGER SYSTEM

The stagger system plays appropriate hit reaction montages based on information received from the damage blueprint interface. The direction of the hit is determined using the initial overlap event from the damage source. Since overlap events do not provide a hit location, a sphere trace is performed immediately upon triggering the overlap—tracing from a socket on the weapon actor to the overlapped enemy actor—to obtain a valid hit location vector. For projectiles, a similar process occurs, but the trace originates from the projectile’s initial spawn location instead of a weapon socket.

This location is then used in two dot product calculations with the hit actor’s forward and right vectors to determine which hit reaction montage is played. Additionally, a configurable "CanKnockdown?" boolean can be set for specific attacks, controlling whether a standard stagger or a knockdown animation is triggered. Hit reaction montages are played in a dedicated slot that overrides others, ensuring that these reactions can interrupt and take priority over ongoing actions.

ENEMY AI: STATETREES

The AI behavior for both the boss and lesser enemies is driven by Unreal’s StateTree plugin. StateTree components are instantiated at construction, with booleans and enumerators allowing for variations in enemy behavior. Logic is modularly compartmentalized into StateTreeTasks, leveraging the actor context category.

Serath’s general behavior flow is as follows: In her default locomotion state (walking or strafing), every x-y seconds (using a random range float), she evaluates possible actions within the parent state, "ChoiceEngine." Actions are prioritized and selected based on their entry conditions, with the order typically being melee attacks, ranged (gap closer or spell) attacks, and fallback actions (movement and repositioning). Upon selecting an action, a random substate is chosen according to predefined weights, with its logic handled in a dedicated StateTreeTask. Most actions return Serath to the root locomotion state upon completion. However, certain actions—such as fallback dashes—immediately call the ChoiceEngine again, increasing the overall pacing and reducing "downtime" during the encounter.

ENEMY AI: PHASES

Serath is spawned when the player overlaps a designated trigger volume in the scene, which also initiates a cinematic cutscene and resets the player's position. Spawn variables are used to control which version of the boss is instantiated and which StateTree it follows. Upon Serath’s initial death, an event is dispatched from the boss’s death event to the level blueprint, triggering another cinematic cutscene, despawning the original actor, and summoning a new one with different spawn parameters.

In the second phase, Serath enters a subphase where she hovers in the air, becomes invincible, summons lesser enemies around the player, and fires projectiles. This transition is managed by Serath’s StateTree, which continuously tracks her health (fed from the character blueprint). When her health drops below a specific threshold, her next action is forced to transition into the midphase interaction.

bottom of page