HomeSystem plugins › AFS_Libraries
System

AFS_Libraries

Shared Blueprint libraries plus the C++ foundations: the net driver, global event bus, object registry, render-target replication and input helpers.

What it gives you

  • Macro and function libraries used throughout the framework
  • AFPNetDriver, enabling server RPCs from non-pawn objects
  • An object registry for lookup without hard references
  • Render-target replication for shared UI

Requires

None

Required by

AFE_Showroom AFM_Settings AFM_State AFS_Core_Pawn AFS_UI AFS_UX_Gaze AFS_UX_Grip AFS_UX_Select

29 assets47 API members

Description

This is the framework's foundation layer. It has no gameplay of its own; everything else builds on it.

The Blueprint side is a set of macro and function libraries — math, sorting, arrays, flow control, gates, transforms, interpolation, replication helpers, widget helpers. The ML_Object_* libraries in particular provide flow-control patterns the rest of the framework leans on heavily, such as OnlyIfDifferent gates and timeout switches.

The C++ side is small and deliberate. UAFPNetDriver is the important one: it lets any object implementing IOutsidePawnRPCInterface call server RPCs, which Unreal normally restricts to the player's pawn. UObjectRegistrySubsystem gives Blueprints a keyed lookup so systems can find each other without hard references. UGlobalEventBusSubsystem is a keyed broadcast channel. URenderTargetReplicatorComponent compresses and multicasts a render target, which is what makes replicated UI possible.

Setup

  1. Enable AFS_Libraries. It brings in Online Subsystem Utils.
  2. Confirm the net driver took effect — its Engine.ini replaces GameNetDriver with AFPNetDriver.
Warning

This is the single most important setup step in the framework. If the net driver is not active, server RPCs from state and select components are dropped without any error.

Usage

Calling a server RPC from a component

Implement IOutsidePawnRPCInterface on your component class and call the server RPC normally.

Registering an object for lookup

Use ObjectRegistrySubsystem.RegisterObject with a name key, and GetObject to retrieve it. The loading system uses this to cache the current level data asset.

Broadcasting a global event

Use GlobalEventBusSubsystem.BroadcastEvent with a key and payload, and bind to OnEvent.

Common macro libraries

ML_Object_Gate for change-only execution, ML_Object_FlowControl for sequencing, ML_Actors.WaitForTrue and WhileLoopWithDelay for polling without ticking.

Key properties

ItemNotes
JPEG QualityOn URenderTargetReplicatorComponent, trades UI fidelity against bandwidth
Registry keysPlain names; the framework uses LevelInfo for the active level data asset

Extending

Add your own macro libraries alongside these rather than editing them, so framework updates do not conflict.

Multiplayer notes

Multiplayer

Everything network-critical in the framework depends on this plugin. See the Multiplayer guide.

Example map

No dedicated map; used by every other plugin.

Troubleshooting

Server RPCs do nothing. Either the net driver is not active or the calling class does not implement IOutsidePawnRPCInterface.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Blueprints

BP_Value0 members
extends Object

No editor-visible members; this asset configures defaults only.

Components

BPC_GameState_ProjectInfo4 members
extends ActorComponent
KindNameSignatureDescription
varName_ProjectDetailstextDisplay name of the project, used wherever the interface needs to name the running application. Left at its placeholder value of Project Name until you set it on the game state.
varLogo_NoTextLogoST_LogoMark-only logo of the project, with no wordmark, for places too narrow for the wide version. Holds a light and a dark texture; whichever suits the active theme style is the one drawn, so fill in both if the project ships both themes.
varLogo_WideLogoST_LogoWide logo of the project, mark and wordmark together, for headers and navigation bars with horizontal room to spare. Holds a light and a dark texture, chosen between by the active theme style.
varName_CompanyDetailstextDisplay name of the company or studio behind the project, shown alongside the project name. Left at its placeholder value of Company Name until you set it on the game state.

Interfaces

BPI_Sort1 members
extends Interface
KindNameSignatureDescription
fnSort_CompareTwoItems(Item01: Object, Item02: Object, out Return: bool)Implemented by the object driving a sort to say whether Item01 belongs before Item02. Both sort helpers swap whenever this returns true, so the array comes back in the reverse of the order stated here; the unimplemented default returns false and leaves the order alone.
BPI_Trace4 members
extends Interface
KindNameSignatureDescription
fnInterface_getLatestTracePawn Trace(out HitResult: HitResult)Implemented by the pawn to return the hit result of whatever the player is currently pointing at, so abilities can read the focus target without tracing for themselves. The desktop pawn traces on demand and caches the result for a short refresh interval; the mobile pawn returns the last trace made by its touch input.
fnInterface_getFocusLocationAndDirectionPawn Trace(out HasFocus: bool, out Location: Vector, out Direction: Vector)Implemented by the pawn to return the world start point and direction of its focus ray, and whether it has focus at all. The desktop pawn deprojects the mouse while the cursor is free and falls back to the camera in game-only mode; the mobile pawn deprojects the first touch and reports no focus when nothing is touching.
fnInterface_setScreenControlModeScreen Control(ScreenControl: E_ScreenControlMode = "GameOnly")Implemented by the pawn to switch between game-only, game and UI, and UI-only control. The desktop pawn also recentres the cursor, shows or hides it and applies the matching input mode, so call this rather than setting the input mode directly.
fnInterface_getScreenControlModeScreen Control(out ScreenControl: E_ScreenControlMode)Implemented by the pawn to report which screen control mode it is in. The crosshair and heads-up display read it to decide whether to show themselves; pawns with no mode of their own report Game Only, and the mobile pawn always reports Game And UI.
BPI_TreeObject2 members
extends Interface
KindNameSignatureDescription
fnTreeObject_GetChildren(out Children: Object[])Implemented by an object that takes part in a tree to return its immediate children, which the walker then descends into. Return an empty array from a leaf; nothing else in the framework implements it, so it exists for hierarchies of your own.
fnTreeObject_GetVisualsObject(out Visuals: Object)Implemented by a tree node to return the object carrying its visual representation, so a tree view can display something other than the node itself. Return the node when the two are one and the same.

Libraries

BFL_Math1 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnAverageTransforms(Transforms: Transform[], __WorldContext: Object, out AverageTransform: Transform)Returns the mean of a list of transforms, averaging locations and scales component-wise and blending the rotations as accumulated quaternions, with entries pointing the opposite way negated first so they do not cancel out. An empty list gives an identity transform with unit scale, and a single-entry list is returned unchanged.
BFL_Save11 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnSaveTransform_NewSave(In: Transform, __WorldContext: Object, out Out: Transform)Passes a transform straight through unchanged. Its purpose is to take a snapshot on the execution wire, so an expensive pure chain such as a composed transform is worked out once instead of once for every pin that reads it.
fnSaveFloat_NewSave(In: float, __WorldContext: Object, out Out: float)Passes a float straight through unchanged, so the pure expression feeding it is evaluated once and the stored result can be read several times without recomputing it.
fnSaveBool_NewSave(In: bool, __WorldContext: Object, out Out: bool)Passes a boolean straight through unchanged, capturing the result of a pure test at one point in the execution flow so later branches all see the same answer.
fnSaveInt_NewSave(In: int, __WorldContext: Object, out Out: int)Passes an integer straight through unchanged, so a pure calculation feeding it runs once rather than each time the value is read.
fnSaveString_NewSave(In: string, __WorldContext: Object, out Out: string)Passes a string straight through unchanged, capturing the result of a pure chain once so repeated reads do not rebuild it.
fnSaveVector_NewSave(In: Vector, __WorldContext: Object, out Out: Vector)Passes a vector straight through unchanged, freezing the result of a pure calculation at this point in the execution flow so every later read gets the same value.
fnSaveRotator_NewSave(In: Rotator, __WorldContext: Object, out Out: Rotator)Passes a rotator straight through unchanged, so a pure rotation calculation is evaluated once and reused rather than recomputed per pin.
fnSaveLinearColor_NewSave(In: LinearColor, __WorldContext: Object, out Out: LinearColor)Passes a linear colour straight through unchanged, capturing the result of a pure chain once so several material or widget nodes can share it.
fnSaveVector2D_NewSave(In: Vector2D, __WorldContext: Object, out Out: Vector2D)Passes a two-dimensional vector straight through unchanged, so the pure expression feeding it is evaluated once and read many times.
fnSaveActor_NewSave(In: Actor, __WorldContext: Object, out Out: Actor)Passes an actor reference straight through unchanged, capturing the result of a pure lookup so later nodes all act on the same actor even if the lookup would now answer differently.
fnSaveObject_NewSave(In: Object, __WorldContext: Object, out Out: Object)Passes an object reference straight through unchanged, capturing the result of a pure lookup at one point in the execution flow for reuse further along.
BPL_Platform1 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnIsEditorPlatform(const WorldContextObject: Object, __WorldContext: Object, out IsEditor: bool)Returns true when the current level name carries the UEDPIE_ prefix, which is how the engine marks a Play In Editor world. Standalone and packaged runs report false, so use it to skip shortcuts that are only safe in the editor.
FL_Materials2 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnGetDynamicMaterialMaterials(InMeshComponent: MeshComponent, InMaterialIndex: int, __WorldContext: Object, out OutMaterialInstanceDynamic: MaterialInstanceDynamic)Returns the dynamic material instance in a mesh component's material slot, creating one from the material already there and assigning it back when the slot does not hold one yet. Despite being a pure node it changes the component the first time it runs, so afterwards the slot no longer references the original asset.
fnsetAllMaterialsMaterials(PrimitiveComponent: PrimitiveComponent, Material: MaterialInterface, __WorldContext: Object)Assigns the same material to every material slot of a primitive component. Use it to swap a whole mesh over to a hologram or highlight material without needing to know how many slots it has.
FL_Sort3 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnSort_BubbleSortObjectsSort(InputPin: BPI_Sort, UnsortedObjects: Object[], __WorldContext: Object, out SortedArray: Object[])Sorts a copy of an object array by repeatedly comparing neighbouring pairs through the object on the Input Pin, until a full pass moves nothing. A pair is swapped whenever Sort Compare Two Items returns true, so implement it to answer whether the two are the wrong way round. The interface default returns false, which leaves the array in its original order.
fnSort_InsertSortObjectsSort(InputPin: BPI_Sort, UnsortedObjects: Object[], __WorldContext: Object, out SortedArray: Object[])Builds a sorted copy by taking each item in turn and inserting it in front of the first entry the comparison returns true for, appending it when there is none. Uses the same comparison contract as the bubble sort helper and leaves the input array untouched.
fnSort_FloatArraySort(Array: float[], __WorldContext: Object, out SortedArray: float[])Meant to order a float array from highest to lowest with a bubble sort, and used by the slider to arrange its segment stops. The swapping loop is gated on a flag that starts false, so as written the array comes back in its original order — check the result before relying on it.
FL_UI14 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnIntegerArrayToOptionArrayOption Array(IntegerArray: int[], __WorldContext: Object, out StringArray: string[])Converts each integer to its string form to give the option list a dropdown or cycle widget displays. Order and length are preserved, so the index the widget reports back still points at the same source entry.
fnFloatArrayToOptionArrayOption Array(FloatArray: float[], __WorldContext: Object, out StringArray: string[])Converts each float to its string form for use as widget options. Conversion follows the engine default and prints the decimals as they are, so round the values first if you want short labels.
fnBooleanArrayToOptionArrayOption Array(BooleanArray: bool[], __WorldContext: Object, out StringArray: string[])Converts each boolean to the words true and false for use as widget options. Pairs with Parse Option Array To Boolean Array, which reads that same spelling back.
fnVectorArrayToOptionArrayOption Array(VectorArray: Vector[], __WorldContext: Object, out StringArray: string[])Flattens each vector into three separate entries, X then Y then Z, so the option list comes out three times as long as the vector array. Take that into account when mapping a widget's selected index back onto a vector.
fnNameArrayToOptionArrayOption Array(NameArray: name[], __WorldContext: Object, out StringArray: string[])Converts each name to its string form for use as widget options, preserving order and length so a selected index still matches the source array.
fnParseOptionArrayToIntegerArrayOption Array(OptionArray: string[], __WorldContext: Object, out IntegerArray: int[])Reads an option list back into integers, one per entry. Anything that is not a number becomes zero rather than being dropped, so the result always has the same length as the option list.
fnParseOptionArrayToFloatArrayOption Array(OptionArray: string[], __WorldContext: Object, out IntegerArray: float[])Reads an option list back into floats, one per entry. Entries that do not parse become zero rather than being dropped, so the result always has the same length as the option list.
fnParseOptionArrayToBooleanArrayOption Array(OptionArray: string[], __WorldContext: Object, out IntegerArray: bool[])Reads an option list back into booleans. An entry is true only when it spells out the word true, whatever the case; everything else, including yes and 1, comes back false.
fnParseOptionArrayToVectorArrayOption Array(OptionArray: string[], __WorldContext: Object, out VectorArray: Vector[])Returns an empty array. The branch that should rebuild a vector from three consecutive entries has never been filled in, so regroup the option list yourself until it is.
fnScale Evenly to DimensionMath(XValue: int, YValue: int, MaxDimensions: Vector2D, __WorldContext: Object, out ScaledVector: Vector2D)Returns the largest size an X by Y source can take inside the given maximum without distorting it: whichever axis overflows further is pinned to its maximum and the other is scaled to match. The scaling divisions are unguarded, so pass a source with a zero side to Scale Texture Evenly To Dimension instead.
fnScaleTextureEvenly to DimensionMath(SizeX: int, SizeY: int, MaxDimensions: Vector2D, __WorldContext: Object, out ScaledVector: Vector2D)Fits a texture's pixel size inside the given maximum while holding its aspect ratio, dividing safely so a zero-sized texture cannot blow the result up. Give one axis of Max Dimensions a negative value to leave that axis unconstrained and scale purely by the other.
fnLimitTextLengthText(Text: text, MaxLength: int = 30, __WorldContext: Object, out NewText: text)Shortens text that reaches the given length, keeping the first characters and finishing with three full stops so the result is exactly Max Length long. Text below the limit passes through untouched, and a Max Length of zero or less turns the trimming off entirely.
fnLimitStringLengthText(String: string, MaxLength: int = 30, __WorldContext: Object, out NewString: string)Shortens a string that reaches the given length, keeping the first characters and finishing with three full stops so the result is exactly Max Length long. Strings below the limit pass through untouched, and a Max Length of zero or less turns the trimming off entirely.
fnParseOptionArrayToNameArrayOption Array(OptionArray: string[], __WorldContext: Object, out NameArray: name[])Reads an option list back into names, one per entry, keeping the order and length of the option list.
FL_Utilities4 members
extends BlueprintFunctionLibrary
KindNameSignatureDescription
fnfindClosestValueInArrayArray(Array: float[], Value: float, __WorldContext: Object, out ClosestValue: float, out Index: int)Returns the array entry nearest to the given value along with its index. The array need not be sorted, ties go to the earlier entry, and an empty array comes back with a value of zero and an index of minus one.
fngetIndexFromArrayOfWeightedValuesArray(PercentList: float[], __WorldContext: Object, out RandomIndex: int)Picks a random index from a list of weights, each entry's chance being its share of the total. The weights need not add up to one or to a hundred, and an empty list gives index zero.
fngetComponentByNameAndClassComponents(Actor: Actor, ObjectName: string, ComponentClass: Class<ActorComponent>, __WorldContext: Object, out Component: ActorComponent)Returns the first component of the given class on an actor whose object name matches the string, or nothing when none does. The comparison is against the internal object name, so renaming the component in the editor breaks the lookup.
fnProjectVectorOntoPlaneRotator(InNormal: Vector, InRotation: Rotator, __WorldContext: Object, out OutRotation: Rotator)Returns a rotation whose up axis is the given normal and whose forward is the input rotation's forward flattened onto that plane and re-scaled to unit length. Use it to lay something flat against a surface while keeping the direction it was facing; any roll in the input rotation is lost.
ML_Actor_Interpolation0 members
extends Actor

No editor-visible members; this asset configures defaults only.

ML_Actor_Replication0 members
extends Actor

No editor-visible members; this asset configures defaults only.

ML_Actors0 members
extends Actor

No editor-visible members; this asset configures defaults only.

ML_Comp_Interpolation0 members
extends ActorComponent

No editor-visible members; this asset configures defaults only.

ML_Comp_Replication0 members
extends ActorComponent

No editor-visible members; this asset configures defaults only.

ML_Components0 members
extends ActorComponent

No editor-visible members; this asset configures defaults only.

ML_Object_Array0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_Object_Debug0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_Object_FlowControl0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_Object_Gate0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_Object_Math0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_Object_Replication0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_Object_Transform0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_Object_Utility0 members
extends Object

No editor-visible members; this asset configures defaults only.

ML_SceneComponents0 members
extends SceneComponent

No editor-visible members; this asset configures defaults only.

ML_UserWidget0 members
extends UserWidget

No editor-visible members; this asset configures defaults only.

ML_Widget0 members
extends Widget

No editor-visible members; this asset configures defaults only.