Post 24: Post-Weekend Update

I managed to get a pretty big session in on the weekend and sorted out some key features that I feel are a key part of an RPG. What I am finding so far is that the more and more I think about what elements are in an RPG the more and more I am finding added to the list – so much infact that it’s hard to keep track of. My solution to this was to head over to Trello and create a bugs list that will help me keep track of what I’ve glossed over and act as a directory when I finish implementing all the features I want to working order.

Health Bar

This worked out similar to implementing a health bar for the NPC’s in that I would reference the health attributes the player already had in place, normalize them on to a 0.0 to 1.0 scale and then pass that number into the percentage attribute of a UI progress bar.

For this case I did have to create a player UI component that would handle all of the players permanent information. This would include elements like; Health, mana, stamina, beserker pool, current weapon equipped, ammunition… etc. Anything that the player would need access to at all moments.

Beserk Bar

The idea behind this is that the player would attack NPC’s and pool beserk points to be unleashed over time. This time period would result in increased power, speed and agility, as well as some vision distinction.

The Beserk bar would reflect this points pool and show the player how much they have. Aesthetically this would take the form of a health bar, with a different colour. For now I will make it the same size as the health bar, but it can be changed at a later date.

I can use the same idea as the health bar in that I will link into a integer pool, but I’ll need to set up a way to put into the pool.

Beserk Mode

As described above Berserk Mode is a vessel for the player to increase the intensity of the game, periodically. There are a few attributes that I wanted this function to have;

  1. Builds up every time the player hits an enemy.
  2. Ticks downward when the Berserk Mode is pressed.
  3. Won’t trigger unless there are Berserk points in the pool.
  4. Will stop Berserk when the points pool equals zero.
  5. Attack montages will increase in speed

A natural start was to create an integer that would act as the pool. I would also need to be able to differentiate between when the player was attacking normally vs. berserking. A bool would do this perfectly.

I then took the bool and attached a select function. With this I could utilise the hit detection function I had already developed by putting this switch into just before the existing call to animation and splitting it in two. The newly created animation will have the same call to animation as the first, but the play rate will be faster.

So now the animation is ready to switch over, I just need a way to change the bool. Firstly, I created the input and bound it to the letter ‘R’. Second, I created a function on that input and set the bool to true. 

Next we need a tick so that the pool will drain over time. I’m against specifically using tick functions as they’re quite ineffecient. Instead I created a loop at the end of the animation call I put in earlier by implementing a branch which was changed by a ‘berserker pool > 0’ bool. The false branch to this sets the ‘Beserker Mode’ bool to false and the true mode led to a delay function (set to 0.5 seconds) and then a subtraction of a portion of the integer. After this subtraction the executor is looped back into the previously created branch. This allows the function to loop itself until it hits zero, sort of creating a bit of a tick – without the inefficiency.

To tie all this up, I quickly nabbed an overlay from:

and modified it to suit my purpose. As with everything, it will be replaced.

The final element to implement was a change to the visuals as to help the player know when they are in berserk mode and add to the feel of the mode.

I achieved this by calling the post-processing volume just after the call to animation montages created before. By adjusting the vignette (black surround on screen) and the tone of the colors to something warmer, changing it back at the end of berserk mode.