An input buffering system provides a way to queue inputs. Imagine performing an ability such as using a tool or consuming a health potion. This ability may block other abilities such as attack or dodge to force the player to commit once they perform an ability. If the player tries to activate another ability while the heal ability is committed then nothing will happen.
This can result in the gameplay feeling unresponsive and can make the player feel as though the inputs aren’t working properly. With Input buffering, the input can instead be Queued & performed once the input buffer window has ended.
An Input Buffering system is a feature implemented in a lot of AAA games as well as many AAA Souls-like Action RPG titles. The Input buffering system in Ashen Melee Combat is inspired from & designed to work similar to Souls-like Action RPG titles.
Enabling Input Buffer
First, you need to ensure your Pawn / Characters have BP_InputBufferComponent actor component. This component is required for the Input Buffering System to work properly. Another requirement for the input buffering system is to setup input tags & add the animation notify state ANS_InputBuffer to your animation montages.
To add the component to your Pawn/Character, simply click the Add Component button in the components view, and search for Input Buffer Component
In Addition, you will need to make sure you create the correct input tags. You can do so by simply adding a gameplay tag like any other tag. The only difference is you need to use InputTag for your new input tag. For example, InputTag.Dodge or InputTag.Sprint
Basic Usage
The basic usage of the Input Buffering System revolves around calling functions from the input buffer component on your input action events. In addition, you need to add an Animation Notify State, ANS_InputBuffer, in your Animation Montages.
Here are some important functions you will need to use:
Store Input In Buffer - This function will allow you to store or queue an input in the input buffer.
Note: Only one input is queued. When multiple inputs are triggered when the Input Buffer is opened, only the last input is considered for activation.
This function has a few inputs: Input Tag is the input tag used for consuming the input, Consume Input Buffer determines if the input is consumed or not when stored in the buffer, & Input Status determines if the input was Pressed, Released, or held.
On Input Buffer Consumed - This is a dispatcher event that you can override in your Pawn / Character class to fire events associated with the input.
On Input Buffer Opened - This is a dispatcher event that you can override in your Pawn / Character to fire events needed when the input buffer opens.
On Input Buffer Closed - This is a dispatcher event that you can override in your Pawn / Character to fire events needed when the input buffer closes
On Input Status Updated - This is an event that you can override in your Pawn / Character to fire events needed when pressing, releasing, or holding an input tag.
Update Input Status - this will fire the “On Input Status Updated” dispatcher. This function can be called on input action events.
Note: This function is called automatically when calling the “Store Input In Buffer” function.
Add Consumed Input Buffer Key - this function will allow you to set an input tag to “Consumed” or “Not Consumed”. If it is true, the input will be blocked.
Binding Abilities to Inputs
Abilities can easily be bound to an input tag by granting them using the “Ability Set” or the “Combat Style” which is a child of the Ability Set. Once an ability is granted under an input tag, some functions can be called to fire input events within abilities as well as activate an ability based on input tag.