Community Tutorial: Using Lyra as a basis for a game - BP only, no C++

I will start a series here along my journey to create a small demo game based on Lyra.
Epics recommends to use it as basis, I am a humble follower of X157 who convinced me on that path - I develop code for decades, but never games until now.

So follow me, stumbling along my path to use Lyra as a toolbox to create a new game. This will be a BluePrint only journey, no C++ will be used.

I will create an infographics for easier recollection - similar to Epics infographics that I always found quite handy to understand component connections.

Other than that, everything will be documtented on:

Components planned:

  • Interactions
  • Behavior

Component in progress :

  • Empty world and level
  • Game menues
  • Appearence - how to use various skins from Maketplace or MetaHumans

Components released:

Creators I need to point you to, as they actually know what they are doing:

8 Likes

New modules released:

[Installation]

  • website to explain more
  • Video
  • Install Visual Studio Community and connect to an Unreal project
  • Install VS Integration plugin from the Unreal Marketplace
  • Install Visual Studio extension from Engine path\Engine\Extras\UnrealVS\VS2022
  • Install Lyra
  • Clean and rebuild from Visual Studio
2 Likes

New module released:

[Create empty map]

  • website to explain more
  • Video
  • Create Gamefeature plugin
  • Create character based on B_Hero_Default, LyraPawnData and LyraControllerComponent_CharacterParts
  • Create Experience Definition, finalize plugin and play…
2 Likes

New module released:

[Reskin your Lyra character]

  • website to explain more
  • Video
  • Understand the TaggedActor BP
  • Use it to reskin your Lyra character to Quinn, a Paragon, a great pirate from the Marketplace (thanks to Maksim Bugrimov!) and a metahuman
1 Like

New module released:

[Reuse the Lyra startup, in-game and options menus in your game]

  • website to explain more
  • Video
  • LyraUserFacingExperienceDefinition as central class to manage menu entries
  • Reuse and modify Lyra’s startup screen and menu
  • Reuse Lyra’s in-game menu
1 Like

New module released:

[How to create and add Lyra Gameplay Abilities and how to create a localized Enhanced Input system for your GameFeature plugin]

  • website to explain more
  • Video
  • Create a Lyra Gameplay basic ability (basically just playing a fingershot emote) and bind it to your Pawn via an Lyra Ability Set
  • Create a localized Enhanced Input system to extend the Lyra one within your gamefeature plugin
1 Like

[Create a global listener to Lyra Gameplay Tag changes]

The next video in this series creates a global listener to any gameplay tag changes on various actors.
We create a simple glowing sphere that adds listeners to the gameplay tags of all characters BPs and reacts when the character triggers a defined ability.

“Wait Gameplay Tag Add to Actor” and “Wait Gameplay Tag Add Remove from Actor” are not runnning in the main game thread, but are multi-threaded, very easy to setup and to replicate: What’s not to like?

Video: How to monitor Lyra Gameplay Tags and react to changes: Multi threaded, easy to implement, fast - YouTube
Infographics: https://bit.ly/bastian_info

We also look shortly into how to debug gameplay tags and use a dump function per tick:

1 Like

[Create an Gameplay Ability Template and understand its components]

We continue to develop a multiplayer enabled template for a Lyra Gameplay Ability - including Gameplay Cues, Gameplay Costs and Gameplay Effects

YouTube
Infographics: https://bit.ly/bastian_info

1 Like

[Get Gameplay Abilities through the environment]

I use the Lyra ShooterExplorer ability - “GA_Interact” - to build a billboard that launches webpages on interaction.

This is a preparation for more advanced interaction such as gathering, mining and other RPG stuff.

Youtube

Concepts covered:

  • GA_Interact scans for Lyra World Collectible
  • When found, an Gameplay Ability is granted to scanning actor and can be executed on keypress
  • Use BP Interfaces whenever possible to avoid the resource costs of storing full BPs in memory on the server
1 Like

[Understanding Lyra Gameplay Cues, Cooldowns and Effects]

I extend our demo map with a teleporter system. We reuse widgets from Unreal Lyra to have cooldown effect shown and look into the game messaging subsystem to establish publisher/subscriber pattern for the widgets.
Finally, we look into Gameplay Cues and Effects.
Video available here: - YouTube

The repository can be found at GitHub - DeveloperBastian/BastianPlugin: Repository for channel https://www.youtube.com/@bastiandev/videos. How to use Git and keep this series always up to date for you is described here: How to access this plugin on Github and keep it updated with the series - YouTube

1 Like

[Workflow “Sketchfab to AccuRig to Unreal Lyra”: A BP and Ability to reskin your character in game]

  • Export FBX from a humanoid SketchFab skin
  • Always check the license of the work you use and attribute accordingly
  • Use Realusion AccuRig (Auto Rig Technology | AccuRIG | Reallusion) to rig your humanoids character
  • Import into Unreal and create a ABP and Tagged Actor
  • Create a BP Actor to grant a reskin ability to your character
  • Create a reskin Gameplay Ability that changes Character Parts in game

Video available here: - YouTube

1 Like

[Lyra Equipment Manager and its ability to grant Ability Sets while equipping items]

Abilities through Equipment

  • Add a Lyra Equipment Manager Component
  • Connect Lyra Equipment Definition with Ability Sets and Tagged Actors
  • Implement an interface for BPs in your level to grant new Gameplay Abilities
  • Implement a chain of reactions to set abilities granted (server) and input mapping conects received (client)

Video available here: - YouTube

1 Like

[Create your new Lyra Attribute Set in 5 Minutes using a code generator]

We define new attribute such as Mana, Thirst, Hunger and different attack values and integrate them into a Lyra Attribute Set using an online code generator (Google Colab)

We then use “AbilitySystem.DebugAttribute MyAttribute” to make our attribute visible during gameplay

Video: Create your new Lyra Attribute Set in 5 Minutes using a code generator. (Nearly) No C++, only BPs. - YouTube

1 Like

[Finishing the AttributeSet generator (Google Colab) and exposing GAS Attributes to BPs]

We use the AttributeSet generator (Google Colab) to generate AttribueSets that are now exposing functions to BluePrints:

  • Add/Remove Attribute Set to ASC (Ability System Component)
  • Define and get Gameplay Tags per Attribute
  • List all Attribute and their values from a given AttributeSet
  • Set the Base value for an Attribute (also a DataTable is more recommended)
  • Get Base, Current and Relative value for each Attribute
1 Like

[Mixamo and using Python to add notifier tracks to animations]

Adding a process to get Adobe Mixamo animations and using Python to automate the creation of the necessary notifier tracks
Video: - YouTube
Notifier tracks added:

  • LeftFootFX (for AN_FootPlant_Left)
  • RightFootFX (for AN_FootPlant_Right)
  • ContextFX (AnimEffect.FootStep.Walk/Land/Jog, … - best copy from existing Lyra Animation and adjust accordingly)
  • FootSyncMarkers

I use a ready made Mixamo retarget rig from manosmiras - MixamoToUE

For reference, here the commented Python script to add notifier tracks to your animations:

# Bastian Developer. MIT license
#
# Will search selected Animation assets to contain three animation notifier tracks used by Lyra: LeftFootFX, RightFootFX, ContextFX
# If the tracks are not found, they will be added

import unreal
from numpy import * # needs Plugin "Python Foundation Packages"

@unreal.uclass()
class GetEditorUtility(unreal.GlobalEditorUtilityBase):
    pass

@unreal.uclass()
class GetEditorAssetLibrary(unreal.EditorAssetLibrary):
    pass

@unreal.uclass()
class GetAnimationLibrary(unreal.AnimationLibrary):
    pass

editorUtility = GetEditorUtility()
animLib = GetAnimationLibrary()

# get all assets that have been selected
selectedAssets = editorUtility.get_selected_assets()
if len(selectedAssets) == 0:
	unreal.log_error("No assets have been selected to check for NotifyTracks - exiting scipt!")
	exit()

# define and log array of tracks we want to have in each animation
TracksNeeded = ['LeftFootFX', 'RightFootFX', 'ContextFX','FootSyncMarkers']
for track in TracksNeeded:
	unreal.log("Track to be expected: [%s]" % (track))

# open selected assets and compare tracks found with our predefined array 'TracksNeeded'
for selectedAsset in selectedAssets:
	unreal.log("Checking '%s'..." % selectedAsset.get_name())
	# copy array to remove what we find and only create all the surviving tracks
	tmpTracksNeeded = TracksNeeded.copy()
	try:
		allNotifyTracksForSelectedAsset = animLib.get_animation_notify_track_names(selectedAsset)
	except:
		# exception getting tracks - maybe thisis not an animation asset?
		unreal.log_error("'{asset}' has no tracks - maybe you selected an non-animation asset here?".format(asset = selectedAsset.get_name()))
		continue
	for existingTrack in allNotifyTracksForSelectedAsset:
		unreal.log("{asset}: Found track '{track}'".format(asset = selectedAsset.get_name(), track = existingTrack))
		# if name found is already in our tmpArray, remove it from there
		try :
			tmpTracksNeeded.index(existingTrack) # this will throw an exception if not found
			tmpTracksNeeded.remove(existingTrack)
		except ValueError :
			unreal.log_warning("Unknown track '{track}' already exists in asset '{asset}'".format(track = existingTrack, asset = selectedAsset.get_name()))
    # if nothing remains, we continue to the next iteration
	if len(tmpTracksNeeded) == 0:
		unreal.log_warning("Nothing to do in asset '{asset}'".format(asset = selectedAsset.get_name()))
		continue
	# now we have pruned the tmpTracksNeeded - but its not empty - let's add what is missing
	for remainingTrack in tmpTracksNeeded:
		animLib.add_animation_notify_track(selectedAsset, remainingTrack)
		unreal.log_warning("I ADDED track '{track}'".format(track = remainingTrack))
		selectedAsset.modify(True)

1 Like

[Import Mixamo animation into Lyra by using an external software from https://terribilisstudio.fr/]

This for me is the definite fastest and easiest way to import Mixamo animations while allowing root motion and fixing some hand/finger bone problems.

Further topics

  • How to use Lyra’s new Animation Data Modifier to add Gameplay Tag based footsteps sound and Niagara
  • How Lyra is steering the footstep effects on different surfaces

Video: - YouTube

1 Like

[How to import a weapon into Lyra and ensure right hand IK for one hand and two hand weapons]

We import a weapon mesh from SketchFab and use it as spawnable Lyra weapon. Animation related concepts discussed:

  • Two Bone IK
  • Blend pose by bool
  • Layered blend per bone
  • Gameplay Tag to control booleans via Propery Mapping
  • Tracking weapon sockets to adjust left hand IK

Video: Youtube

You can find the infographic showing the way to this point here

1 Like

Switching your language in game

The concept to switch the language is essential for all games - and the longer you wait to lay down the base for that, the more complex it is to do later.

We shortly dive into the Localization Dashboard, look how to edit PO files for translations and change the language on the fly with BP and Lyra option menu.

Video: https://youtu.be/qHUa2o1xJDQ

1 Like

A multi user, multi player inventory

I started an inventory using muleitplayer, multi user patterns:

Inventory aspects discussed here:

General principles - security:

  • All Item and Inventory processes are managed on Authority only
  • Remote client only receives UI related information

Scalability:

  • All components are not directly coupled but message based
  • High load data access is based on cached (Data Registries) or in-memory storage

Owner - Inventory Relations:

  • Owner can have multiple inventories - permanent (equipment) or temporary (chest)
  • Owner can have different access rights per inventory - Add Only, Full Access, Read Only, …
  • Inventory can have multiple owner with different access levels

Items:

  • Items are always data driven via databases, data registries or data tables
  • Items are composed of fragments detailing different aspects (name, weight, durability, …)

Video: https://youtu.be/eBKAI46Psyk

1 Like