FEF_Thumbnail.png

Feedback Event Factory Tutorial

Setting up your new Feedback Event Factory is super simple!  View this video or follow the step-by-step instructions below after downloading and installing the plugin for Unreal Engine.


Step 1:  Creating a New Feedback Event Factory

First, right click in the directory where you'd like create a new Feedback Event Factory asset and select Blueprint Class.

Then, type "Factory" into the search bar, select a new Feedback Event Factory and save it as something intuitive.

Open this new blueprint, find the Feedback Event Factory values and start adding new events, as needed.  Individual parameters are well documented, so just hover your mouse over the variable name to get more info about what it does.


Step 2:  Spawning a Feedback Event Factory

Spawn example (A)

There are a few simple ways to spawn a factory in the game.  The easiest way is to just drag the new asset you created above into your level.  Notice that you can set it to "Play Events on Begin Play" by ticking the appropriate box.


Spawn example (B)

Or, you can uncheck "Play Events on Begin Play" and "Play Events" at the appropriate time in your level script by referencing the instance you've placed in your level.


Spawn example (C)

Alternatively, you can bypass dropping the asset into the level and spawn a new Feedback Event Factory dynamically by calling one of the SpawnFeedbackEventFactory functions.  Make sure you save off a handle to the Feedback Event Factory if there are looping events so you can stop the events (and destroy the factory) at a later time.  If there aren't any looping events, the factory will destroy itself once all events have played out to completion.

When you want the Feedback Event Factory to go away (and destroy itself) just call StopEvents.


Spawn example (D)

If your factory doesn't need to tick, you might consider utilizing the "Fast" spawning variants. These functions don't actually spawn a new Feedback Event Factory actor; they just spawn the events associated with the factory and populate a struct handle (FActiveFactoryInfo) with information about the newly spawned events.

Note that time dilation is the only feature that requires a tick in the base version of this plugin, so there's a very good chance that almost all of your Feedback Event Factories can and should be spawned using this method for optimization purposes. The overhead with spawning a new actor at runtime can have a significant impact on your game's performance, especially if it's happening in high volume and/or at a high frequency.

There are two key things to take note of when using a "Fast" spawn method:

  • The FActiveFactoryInfo struct passed in to a "Fast" function MUST live on an object that will outlive the events in the Feedback Event Factory. As an example of what NOT to do, DON'T create a FActiveFactoryInfo local variable in your blueprint function and pass it in to a "Fast" spawn function.

  • FActiveFactoryInfo variables MUST be tagged with UPROPERTY() in code.

If these rules aren't followed, that struct can be destroyed/corrupted while the factory is active and bad things might happen O_o

For those that are deriving new classes for your project that implement additional feedback events, note that there are "CustomBoolList" and "CustomObjectList" variables in FActiveFactoryInfo that you can use to store information about new active events that you created.

All that said...these are the "Fast" functions! Key information described here is well documented on the functions so you can easily remind yourself how to utilize them later :)

FEFFast.png