top of page

Way Of Hoof

Project Type: Forsbergs skola / Exam group project

Software Used: Unreal Engine 5.3

Languages Used: C++

Primary Role(s): Programmer, A.I.

Team Size: 3

Project Time: 9 weeks

About Way Of Hoof

Our group worked with Ballistic Pork to make a prototype for their brand new IP and bring their vision to life with our programming skills, so that Ballistic Pork could use their VFX magic afterwards to make it both amazingly fun and stunning visually.

Way Of Hoof is a family friendly action game featuring a band of cloven hooved ninja warriors on a righteous quest for revenge against the cold blooded meanies of the Crooked Web clan. The game can be played alone or together with a friend, selecting characters from the ninja band.

 

The player characters can traverse the environment using double jumps and gadgets, and fight enemies using a mix of martial arts, ninja weapons and gadgets.
 

I was in charge of making the A.I for enemies (melee and ranged) and the boss by using behavior trees & blackboard keys to control the flow of each action, finding assets for them, animation, UI, functionality and its attacking behavior.

Our team took and extra challenge to do everything in C++ code and use Design Patterns where applicable to gain better knowledge and mastery of it.

image.png

Overview:

  • The enemies and boss I was tasked to bring to life.

  • Made it scalable with EnemyBase class and BossBase class.

Perception:

  • Hearing: When noise is sensed it sets BB Key bool IsHeard = true, the BB Key Vector LastKnownPos to the sounds position and switches to Heard state. Enemy then goes towards if player not seen he switches back to Roam state.

  • Sight: When player seen is sensed it sets BB key bool IsSeen = true, if not sensed changes IsSeen = false

  • Perception is set on headSocket making the vision follow the animations.

WOH enemy BT .png

Behavior Tree:

  • Soldier(melee) & Archer(ranged) use the same AI Behavior Tree.

  • Heard: When enemy hears a sound he goes to investigate the LastKnownPos.

  • Seen: Is the dominant sense, if seen while investigating a sound switches to Spotted State branch.

  • Roam: If neither seen or heard enemy roams between waypoints.

  • Spotted: Enemy goes towards playerPos, if continuously seen for 2s enemy switches to Alerted state. But if spotted and loses sight of player he goes to the LastKnownPos to search for him.

  • Alerted: Enemy switches to runSpeed and either shoots him or runs to melee range and attacks player.

  • Smoke Bombed: If enemy is inside a smokebomb he loses sight and hearing and becomes confused until the smokebomb clears up.

image.png

Blackboard:

BB Keys:

  • SelfActor: Itself (Actor)

  • TargetActor: PlayerTarget (Actor)

  • CanSeePlayer: Perception Seen (bool)

  • CanHearPlayer: Perception Heard (bool)

  • TargetLocation: PlayersPosition (FVector)

  • LastKnownPos: LastKnownPosition (FVector)

  • IsSpotted: If seen for the first time (bool)

  • IsAlerted: Switches to attack (bool)

  • IsSmokeBombed: Stops&Resets all function (bool)

Used for controlling the flow through the Behavior Tree as somewhat states.

image.png

BTTasks:

  • Roaming: Loops through an Array of waypoints after reaching destination it gets the next.

  • FindPlayer: Gets Player thats the next target and sets the BB key TargetActor to it.

  • Attack: Attacks player until out or sight.

  • Alerted/Spotted: Manually sets BB bool keys to True or False depending what you want.

  • LookAround: Sets the animation to make the enemy stand still and look around.

  • SetRun/WalkSpeed: Changes the movementSpeed of enemy.

  • BTDeceorator_IsInWeaponRange: Checks if player is within weapon range. Used to differentiate between Melee and Ranged so they don't run into players face to attack.

Melee AI Attack.gif

Melee Enemy (Wart-Hide):

  • AttackHitBox: Enables/Disables with an Animation Event when starting to swing. If player is inside the hitbox collision he gets damaged.

  • EnemyBase->MeleeEnemyBase->BP_WartTide is configured in the BP version

  • WeaponComp: has a  TSubclassOf<AWeaponBase>WeaponClass;  AWeaponBase* Weapon which is selected from a dropdown in BP_Melee_Club 

  • WeaponBase: WeaponBase->MeleeWeaponBase->Melee_Club->BP_Club.

  • HealthComponent: Sets health/maxHealth 

  • HealthWidgetComponent: Sets inworld healthBar that updates by using event delegate when taking damage. Using the observer pattern.

  • Waypoints: Drag it where you want enemy to roam between.

Ranged AI Attack.gif

Ranged Enemy (Blizzard):

  • EnemyBase->RangedEnemyBase->BP_BowMan is configured in the BP version.

  • Has same components and functionality as Melee Enemy -AttackHitBox.

  • Spawns an arrow when Alerted and attacking.

  • Calculates the Vector from Enemy To Player, Normalize it and use impulse to make it fly towards the player.

  • AttackHitBox is on the Arrow, if collided with player he loses hp anything else it destroys the arrow.

  • ProjectileBase takes in EnemyRef and is used so you can override void SpawnProjectile and void ForwardVector() so it can be r.eused for multiple purpose (its also used for Boss Frill Projectiles)

  • All variable values are configurable for easy tuning.

image.png

Boss Behavior Tree:

  • No Perception needed 

  • RNG AttackState: Randomizes which AttackState to use.

  • Set Player Actor: Sets BB TargetActor to which player is targeted.

  • Attack State: Has 3 attack patterns. Scratch-TailSwipe-WindFrillAttack.

  • RNG Attack: Contains a switch statement that calls the correct attack behavior for the attack state that was randomized.

Blackboard Keys:

  • SelfActor - TargetActor - AttackState

Scratch Attack Boss.gif

Boss Enemy (Snapjaw):

  • Scratch Attack:

  • Basic Attack.

  • Similar to melee attack uses AttackHitBox that enables/disables the collider with an animation event.

  • Damages all players inside the collider box.

  • The AttackHitBox resizes to match the animation reach and sets damage to ScratchDamage

TailSwipe Attack Boss.gif

Boss Enemy (Snapjaw):

  • Tail Swipe Attack:

  • 2nd Attack.

  • Similar to melee attack uses AttackHitBox that enables/disables the collider with an animation event.

  • Damages all players inside the collider box.

  • Tail set on TailSocket location on the HipBone. 

  • The AttackHitBox resizes to match the tail size, length and sets damage to TailSwipeDamage

WindFrillAttack Boss.gif

Boss Enemy (Snapjaw):

  • Wind Frill Attack:

  • 3rd Attack.

  • Similar to ranged attack spawns a projectile with AttackHitBox.

  • Random(min,max) how many projectiles to be spawned on a timer interval.

  • All variables are configurable, speed, how many projectiles, damage and time between each spawning.

  • GitHub
  • LinkedIn

© 2023 by Stebbi Halldórs. All rights reserved.

bottom of page