For this week I decided to start working on the HUD.
Learning how to implement a user interface or HUD in UE4 was not nearly as hard as I thought it might be.(or I completely did it wrong, there is that, but it works…) The technical implementation might have been easier than expected, but settling on a design was harder than anticipated. Going into the week I had a good idea of what I wanted, and my aim was to try and resolve two of the primary user feedback systems to the player; health; and player illumination.
The only games I could think of that did this in a similar genre were the original three Thief games, TheDarkMod, and Thief 2014. They all used a light gem and a healthbar of sort. So taking this knowledge, I spent a good part of the week trying to emulate them. Designing a jewel in some sort of setting for the light level, with a bar or smaller jewels wrapped around for the health indication.
Well, I liked none of them…
It was only after my wife and I had a chat about the game’s lore over a cup of tea that I started to resolve the concept. Since one of the main world building elements has got to do with crystals and life-force, I decided to focus more on that, and instead of setting a gem or jewel, I am only using a crystal for indicating the player’s illumination. And I got rid of a separate health bar altogether. Instead, the functionality of the crystal is linked to the player’s life-force, so as the players health goes down, the usable part of the crystal gets smaller.
After through together a few textures, and hashing out the blending and setup in the user interface material, I ended up with this:
As the players health goes down the crystal fills up with blood; as shown above for various levels of illumination and health lost. It is mostly thematic, and will only really impact gameplay when the player has taken a lot of damage. But I like, so it stays. will probably only get minor optimizations or tweaks as I go along. Maybe I will add punctuality for the players breath under water.
The whole material is driven by two parameters that I edit on the dynamic instance material. Working out the math for the blood panning was more tricky as the crystal is smaller the the whole material/texture, but nothing serious.The crystal colour and brightness is driven by a series of lerps.
Here is a screenshot of the material: (I know, it is a disorganized mess, but I promise I will tidy it up)
And here are two screenshots with it working in game. One with the player fairly in darkness, and the other with the player in more light. And after the player has taken about 35% of health damage.
I will be adding more updates later this week.
It wrote this paste very late here at night. So please don’t judge it to harshly? (will probably have to edit it in the morning when I am more awake.)