In this session we implemented player stamina. Stamina is an important status during combat. Players will be able to perform defensive and offensive actions depending on the stamina they have. Each action should take a chunk of the stamina from the player. If the stamina reaches 0 the player will not be able to perform any actions. During this stage the player is vulnerable and as such it is important to manage stamina wisely.
Managing Stamina
We added a master component blueprint called status component which will manage player status attributes such as stamina health and others. The stamina is managed in the following way: On a given action, decrease stamina by given amount, stop stamina regeneration for a period, update stamina bar on the UI, start regenerating stamina after a given period.
Input Buffer
One important feature we added is the input buffer. This allows us to store the input on a buffer and perform actions subsequently. In this case during rolling the player can tap the roll button twice fast. When this happens the input is stored on a buffer. The input manager then picks up the buffer and performs two rolls. With the input buffer the actions will feel more responsive.