Unreal Engine 4 Dev Update #11: New Character Models, Unit Highlights, Mouse Based Unit Selection & Context based HUD system

Finally, for once, I've managed to put a development update within the deadline mentioned from my previous post. Alright, we're having a cluster of small changes for this one. So let's get right down to it.

New Character Models

   
I had started off this project from the Top Down Template. So I've been using the default Unreal Engine character until now. A while back, I had bought the 'Prototype Characters' pack by Ying Pei Games from the marketplace. Since they fit the theme of my game better than the blue guy, I decided to use them for my units. Blue for the good guys, and red for the bad guys. If you've been following my posts, you might have come across the fact that I'm already using Epic's Animation Starter Pack in my project. I had some of the basic animations running already, so I did not have much work with adding the new models after re-targeting the skeletons. Here's an in-game screenshot:
   

And here's one up-close:




Unit Highlights and Health Display

Up until now, there was no cue when the cursor was focused on any interactive object, say, when I hover it over an enemy unit. So I decided to add unit highlights for enemy units. The idea was to have them highlighted, when the mouse cursor is over them. I'm using 'Hit Result under Cursor' and Custom Depth with a highlight material to achieve this. I actually got this idea from Tom Looman's Switch Development Blog. He's got a tutorial for the same as well. And btw Switch is probably the most awesome UE4 project that I've seen so far. It's hard to miss for a UE4 developer, but if you haven't seen it already, I'd highly recommend it. Here's a link:

Tom Looman - Switch Development Blog

Anyways, once I got the highlight working, I decided to add a Health Bar over the highlighted unit. So I got into UMG, made a health bar widget and added it to the character blueprint. At the moment, it's using a progress bar that changes according to damage received. You can see it in action in the video link towards the end of the post. I've also made the floating health bars to always face the player, no matter which angle he/she is looking from. For player units, I set these health bars to be visible all the time.
  
  
Mouse Cursor based Unit Selection

As mentioned in one of my previous posts, I've been using the number keys to select different units under the player's control. Being able to select units using the mouse was part of the plan for a while. So I just added that as well. Feels a lot better to use it this way, compared to the keyboard. Again, this is being demonstrated in the video as well.

Sounds Effects for Weapons Fire

As the title suggests, I've added the weapon fire sound effects from the Shooter template. I just play them along with the muzzle flash emitter when a unit starts firing upon another unit.

Context based Command HUD System

Lastly, I added a context based HUD display system. What that means is that, the interaction with the Command HUD happens based on what the player is trying to do. Right clicking on a location on the grid space to move the player only allows the player to interact with 'Move' button and 'End Turn' button. Similarly, right clicking on an enemy unit will allow the player to issue only 'Fire' commands and 'End Turn'.

Alright, so that's all for this update. Here's the video demonstrating the features that have been added, as per this update:


You can check out my other videos from my YouTube channel (link given below). Feel free to subscribe to my channel, if you're interested in the development of my project. And have a happy weekend.

Comments