HeroSouls

This example demonstrates how assets from the souls demo may be used in the hero demo. The scene was made by duplicating the SoulsDebuggingGeneral scene and replacing the SoulsSetup with HeroSetup. Other changes made are detailed below. A big part of making actions reusable between demos is the PlayableAnimation which is described on the utilities manual page.

HeroSetup

Some changes have been made to the setup to work better with souls assets. The changes are also easy to discover by checking the HeroSetup Overrides in the inspector.

  • scaled the character model up to 1.2 to fit better with the souls assets
  • set the key of the generic trigger item on the player to PLY which identifies the player in the souls demo(for example in the moving platform)
  • increased the size of the lock on collider because lock on distance is determined by the player area in souls
  • added MessageEvents SHEATHEA and SHEATHEI which can be used to sheathe items from non hero actions
  • added a ResourceBarManager to the UI so enemy health bars are shown
  • added ItemNotifications so items picked up are shown(souls items don’t have the hero pickup dialog)
  • added gear and equipment buttons in the UI for the items brought over from souls(sword, shield, flask, bow)
  • added the HeroSouls items to the inventory so they can be tested in the scene

Gear

Both Sword and Shield are mostly identical to their counterparts in the hero demo. The prefabs just use different models and sounds. Because the attack animations are not determined by the gear in the hero demo these also don’t change.(if you want to look into individual animations by sword the HeroCharacter state graph would be the place to start looking as this is where the attack actions are started)

Equipment

The actions in the flask and bow items are wrapped in a HeroHoldableAction which takes care of visualizing the item in the characters hands. It forwards any input it receives to the actual action.

The flask uses a regular MotionAction instead of the souls action which contains some souls specific logic. Filling the resource, removing the item and adding the healing effect on use is done in a event handler for the ACT message of the animation.

A couple additional fields have been added to the SoulsShootAction on the bow to make it usable without the arrow slot it uses in the souls demo. The projectile that is linked there is also custom made for HeroSouls so it damages HeroHealth instead of souls resources.

Scene

The ladders in the scene contain two additional instructions to make the work better with the hero character. The MovementMotionMultiplier increases the movement from root motion to make the hero character match its movement to the ladder. The HeroActionOverride sets the ladder as the current context action which allows the player to leave the ladder by pressing E.

The dummies in the scene use the HeroHealth resource instead of the souls one so they can be damages by hero damage sources like bombs.

The key needed to open the door has been replaced by the key from the hero demo so it shows up in the hero UI.

In the door right in front that does not require a key a SHEATHEA message is sent on start which makes the hero put away its items.

SoulsHero

As the name indicates this is the inverse of the HeroSouls example. Here assets from the hero demo are used by the souls character. Once again changes made are detailed below

SoulsSetup

  • scaled the character model down to 0.8 to fit better with the hero assets
  • set SortByDistance on the action area so the character picks up closer (for example)pots first
  • added OverheadItem transform as replacement for the ItemParentOverhead in the hero demo
  • added the Climb action so the character can climb walls in the hero demo the climb action is also added to the RecoveryActions array on the Stamina resource so the character recovers stamina while climbing, otherwise they would not be able to jump off if they enter climbing on low stamina
  • added the SoulsHero items to the inventory so they can be tested in the scene
  • added ItemNotifications so items picked up are shown(pickups don’t have the souls pickup dialog)

Weapons

Hero Sword and Shield are very similar to their counterparts in the souls demo. In addition to the models the animations from hero are also used here. This was achieved by creating a custom SoulsHeroAttacks animator controller that replaces SoulsAttacks.(for example in the Light attack action in the sword)

Usables

The bombs from hero are available as a SoulsUsableItem. One essential change made are the additional SuspendMovementControl instructions in the Pick, Put and Throw playable animations. Since the character in souls does not use root motion for its movement it would otherwise keep moving during those animations. The carry actions of the bombs and pots lying around the scene have been changed in the same way.

The nut item uses a regular SoulsUsableAction pretty much identical to the pebble in the souls demo. It still spawns the HeroNotImpact on hit though which can be used to stun enemies.

SoulsHero also contains some changed version of the heart and money items in hero. These have been modified to add attributes and resources like SoulsExperience and SoulsHealth instead.

Scene

All the different pickups have been modified to add appropriate items. For example the heart essences use SoulsHeroHeartEssence which adds SoulsVitality that increases the souls characters health.

The HeroBlock has had some changes to the grab actions. Holding and Releasing the grab does not work in the souls demo and therefore the InputType is changed to Perform. To keep other actions from being started while the character is grabbing the block a SoulsSuspendActing instructions is added which disables the Act input.