Unit 4:Project Design Implementation and Evaluation - Week 22/23

List of implementations:


  • Added a new weapon: SPAS-12 Pump Action Shotgun;
  • Added explosive grenades;
  • Added multiple sound effects;
  • Improved the player's HUD;
  • Added a mini-map;
Here is the finished model of the shotgun.




I also successfully implemented it into the game. It works as an item pick-up, and when the player walks over it, the shotgun will be added to their inventory, giving them an alternative to the existing M4A4 Assault Rifle.

I created two integers, one for the assault rifle and another for the shotgun. They define which weapon is selected, by setting the weapon_selected variable to 1 or 2 respectively.

In this instance, you can see the Switch on Int node which executes the Reload function for whichever weapon the player has equipped when they press R.

Since shotguns have very different characteristics compared to an assault rifle, I had to make some changes to the code in order to make it feel like a shotgun. These changes affected less complex aspects such as ammo count, mag size, total ammo, etc, and also more complex aspects such as changing the bullets into pellets, by firing multiple projectiles simultaneously, reducing the damage of each one, and making them spread.

I also added sound fx to it, including for shooting, cocking after shooting and reloading. More on that later.


Finally here is a gif showing off the shotgun.

Next up, the grenade. It took some brain power but I got it to work reasonably well. It spawns when the player presses G, then creating an impulse which throws the grenade at an angle and wherever the player is aiming.

When it comes into contact with anything, it explodes. If the AI targets happen to be within the radius of the explosion, they are destroyed.


Here is a gif showcasing the grenade feature. (P.S: the quality of the gif is not the best.)

As you can see, physics are also involved. This was made by adding radial force when the grenade comes into contact with whatever it hits. Only smaller objects are affected.

One more thing, initially, the grenade was supposed to work like classic HE grenades, by having a timer until it blows up, however this led to some complications with the radial force. I decided to make it sort of an impact grenade instead, which in my opinion was a blessing in disguise, since it's a lot more fun to use.

As you may have noticed, the HUD looks quite different from last time.

For instance, I added the name of both weapons when the respective weapon is equipped. I also added a grenade count.

However, this isn't the most noticeable change... 

I added a radar which captures in real time where the player is.


This is made by adding a camera above the player, and a SceneCaptureComponent2D.
As you can see from the gifs, while it may not feel like it's very useful, it does look cool and adds more life into the game I think.

I also added some hitmarkers, in order to give player visual (and auditory) aid when shooting the targets... and also to look cool, obviously. In my opinion it really benefits the game in all ways possible. (P.S: gif quality is kinda bad).


The hitmarkers do have sound too, which leads to my last set of implementations.
Sound. Unfortunately I can't showcase the sound in this week's report, however in addition to the game looking pretty good, it's also ... sounding pretty good too. 

Both weapons have sounds for every action, there are sound fx for level interaction such as starting the timer up, killing all enemies, stopping the timer, going to the next level, and even a ticking sound for the actual timer itself.

In conclusion, I am now in the final stretch of the course, and have quite a bit of work to do, so these reports take time to put together. I may record some gameplay for next week in order to show the game off more clearly, but that's if I have the time. Regardless, everything will be shown by the end of the journey.

All that I have left to do, that is sort of major anyway, is adding more levels - however, that won't take that long since I have the blueprint already. Other than that, the next step is to further polish the game and fix bugs and general clunkiness of the game.

Comments