Skip to content

Ciberusps/unreal-helper-library

Repository files navigation

Unreal Helper Library [UHL]

UHL - unreal helper library, toolset to help developers working with AI, GAS and so on. Goal is to became a tool that insta-installed on new project creation. All tools are mostly tested on melee combat so if you have other background and think that something should work another way or have an idea on how to improve developer experience feel free to discuss

Support: tested UE5.3 - UE5.4

Install

From source (recommended):

  • git submodule add https://github.com/Ciberusps/unreal-helper-library.git ./Plugins/UnrealHelperLibrary - add git submodule to your plugins folder
  • add "UnrealHelperLibrary" to file "<ProjectName>.Build.cs" in PublicDependencyModuleNames section to use it in C++

Note

don't forget to update README.md with instructions on how to setup - git submodule update --init --recursive and how to update plugin(s) - git submodule update --remote

Note

and add Editor Preferences -> Force Compilation on Startup in Config/EditorPerProjectUserSettings.ini your team don't want to recompile plugin manually 😉

From marketplace:

later this year

Update

From source:

  • git submodule update --remote to update library from source

Documentation


GAS

AbilitySystemComponent

AbilitySystemComponent

UHLAbilitySystemComponent - for quick start with GAS. You can nest from it on start and than turn off its functions when you ready to replace them with your custom solution.

Features:

  • set InitialGameplayAttributes
  • give Abilities on start
  • activate InitialActiveAbilities
  • apply InitialGameplayTags

InterpolateToPosition

AT_InterpolateToPosition - interpolate actor to specified position/rotation at a predetermined amount of time

image

UHLAIPerceptionComponent


AI

BTC_RandomSelector

Select random child node using weights

image

With cool validations

Warns if summary of weights > 1

image

Warns if chances array have more items then child nodes

image

Shows error if child nodes count > than chances count

image

CheckGASGameplayTagsOnActor

BTD_CheckGASGameplayTagsOnActor - checks that actor has GAS gameplay tags specified.

Warning

Don't mess with UBTDecorator_CheckGameplayTagsOnActor - its only checks GameplayTags on actor itself not on AbilitySystem.

Requirements:

  • actor should implement IAbilitySystemInterface to get AbilitySystemComponent

image

InAngle

BTD_InAngle - decorator to check is enemy in one of specified angle ranges. Useful in developing big enemies, for example we developing dragon we want to know is player under the right wing or leg, is player in front of dragon or behind and so on.

image

InRange

BTD_InRange - decorator to check distance between actors. Compliant with "MoveTo" node have same settings bIncludeSelfCapsuleRadius and bIncludeTargetCapsuleRadius to check distance excluding capsules radiuses

image InRange

LoopRandomCount

BTD_LoopRandomCount - randomized version of decorator Loop

image

TimeLimitRandom

BTD_TimeLimitRandom - randomized version of decorator TimeLimit

image

RandomChance

BTD_RandomChance - commonly used decorator to randomize actions. Fine for single child node, extra bad for multiple nodes due to chance regression, for randomization between multiple child nodes better to use RandomSelector

image

SetGameplayFocus

BTS_SetGameplayFocus - alternative for "Set default focus". SetGameplayFocus made right way - prevents rotation jittering while enemy rotation. One of most common problems that anybody stucks when starting developing AI - "focus dont work"/"focus works wrong".

image GameplayFocus

Requirements:

  • turn on UseControllerDesiredRotation
  • turn off
    • bOrientRotationToMovement
    • UseControllerRotationYaw
    • UseControllerRotationPitch
    • UseControllerRotationRoll

Troubleshooting:

  • check that nothing "ClearFocus"
  • check that MoveTo uses "AllowStafe"

SetBBValue

BTT_SetBBValue - helps settings values in blackboard, supports all blackboard types and for some values event provides opportunity to make calculations like int

image

DebugPrintBBValue

BTT_DebugPrintBBValue - prints BB value of any type

image

DebugPrintString

BTT_DebugPrintString - simple task for printing debug info on screen

image

InvokeGameplayAbility

BTT_InvokeGameplayAbility - activate/deactivate GAS Gameplay Ability by tag, with optional "wait for finishing"

image

PlayAnimMontage

BTT_PlayAnimMontage - play anim montage with option to customize PlayRate, Starting Position, Start Section Name and stopping montage on task abort

image

TurnTo

BTT_TurnTo - turn to enemy using turn animations TODO should be drop in replacement for "RotateToFaceBBEntry"


UnrealHelperLibraryBPL

> RelativeAngles

RelativeAngleToActor

image

GetPointAtRelativeAngle

image image

GetPointAtRelativeDirection

image image

GetPointAtAngleRelativeToOtherActor

GetPointAtDirectionRelativeToOtherActor

DirectionToAngle

> GAS

CreateGenericGASGameplayEffectSpec

> Misc

GetProjectVersion

Get project version from "Project Settings"

image

image

GetNamesOfComponentsOnObject

Get names of actor components on object, usefull for GetOptions UPROPERTY

GetAssetsOfClass

> Other

GetHighestPoint

InputSystem

Binding InputActions to tags like in Lyra but enhanced and adopted for 3d action game

  • abilities should nest from UHLGameplayAbility for "ActivationPolicy" work correctly
  • SetupPlayerInputComponent - bind all from input config, BindAbilityActions
  • Project Settings -> Input -> Default Input Component Class -> change on UHLInputComponent

LoadingUtilLibrary

UHLLoadingUtilLibrary - loading utils

TraceUtilsBPL

UHLTraceUtilsBPL - trace utils