College Capstone Dev Diary Week 9 Update: Cash Force Gunplay + Procedural Animations!

College Capstone Dev Diary Week 9 Update: Cash Force Gunplay + Procedural Animations!

Cash Force is a high-octane arcade VR shooting game where you take the role of an undercover cop gone rouge fleeing the scene of a heist in a colorful 70’s crime film esque setting. Defend your stash of cash from pursuing thugs using an assortment of highly intractable weapons. Lock, load, and shoot your way through waves of pursuing enemies as you engage in combat out of the back of a moving heavily armored van, using the doors and other supplies as cover. Carefully plan your escape route before fleeing the scene of the crime, but remember, the higher the risk, the higher reward! Earn cash from performing skillful shots on enemies, allowing you to purchase upgrades and gadgets to improve your weapons and van. But be careful: the more damage the van receives, the more cash you lose, and its game over if you run outta’ cash! 

 

(Finally) A Weekly Update!

Phew!

Its been a long week working on Cash Force since my last (giant) update post. Yet somehow, I’ve managed to achieve what I thought might be impossible….

….I actually found the time to sit down and write a small weekly update about what I’ve been working on!

This post should be the first of many to follow this same format for the rest of my time as a senior at Champlain working on Cash Force or whatever game I work on next semester if Cash Force doesn’t make it through the cuts. So, without further ado, let’s get into what myself and the team has been up to this week!

First Order Of Business: Nail the Vertical Slice

As you’ll see for the majority of this post, myself and my teammates have mostly just been working on getting the core gameplay mechanics (read: shooting shit and getting shit shot at you with various cartoony 70’s inspired guns) working and doing lots of backend architecture in Unreal to make sure everything is implemented nicely. Now all that is fine and dandy but…

we have 5 weeks left until mid-mortem presentations and don’t have our game loop in yet *gulp*

Yup. This has had me concerned this week. Luckily, the rest of the team and our professors agree with my worries. We got great feedback on the cool stuff you’re about to see (promise I’m getting there) in our class period this past Tuesday, mainly from our professor stating that we should sit down together and plan out a story board of what we want the players to experience minute-by-minute for our 15 minute vertical slice demo we need for the mid-mortem presentations. This got us thinking about all the different factors we want players to experience in the vertical slice:

For each 2-5 minute interval in the 15 minute vertical slice :

  • What can the player do? (gameplay interactions)
  • What does the player see? (environment/context)
  • What are the obstacles to the player? (enemies/challenges)
  • What is the player’s goal? (defending money/living/defeating enemies and scoring points)
  • How should the player feel? (Feedback, sound, art/tone)

Following a format like this will help us really nail down a vertical slice that shows off the vision of the game. Thanks to Unreal’s level blueprints feature, a lot of these things can be scripted at certain times or when certain conditions are met: E.g, at minute 5, the player is given a shotgun to replace their SMG, when suddenly police enemies intercept them! 

Creating a document and possibly concept art to go along with each interval is a new goal we have to really nail this down as we keep working. Our current plan for the upcoming week is to get our core gameplay loop in (van, cars following it, enemies to shoot) at a functional state to iterate on as we design the vertical slice. I think this is really exciting and can’t wait for that meeting!

Now, without further ado, the cool shit we worked on this week!

This Week's Work at a Glance

For pretty much the majority of this project, I’ve been tasked with handling all the stuff related to the guns, from their design to implementation, since I have the most experience creating guns for shooters (see my summer project Shotgun Shootout!) on the team. All of my tasks this week involved the guns to some degree:

  • Design & implementation of modular ammunition system
  • Magazine based reloading
  • Full and semi automatic shooting
  • Refinement and bug fixing of shooting and grabbing based on testing results
  • Procedural animations for weapon parts
  • Basic enemies that react to hits and ragdoll
  • Continued working on documentation with Emmett

This may sound like it was a lot for one person, but most of these things were really small. And I had a lot of help of course from our spectacular programmer Josh, who really helped me solve some nasty logic with the grabbing system. Josh and I also discussed how we should implement gun data at length so that it could be fed to the AI director system in order to dynamically adjust to play stats. Cool stuff!

Ammunition System + Magazine Reloading

Reloading, shooting and ammo was my focus this week, so they were the first three tasks I jumped on at the start of the sprint. Originally when we made the prototype, we went kinda backwards; we made shooting first and then reloading afterwards. This time we decided to take a different approach: since the gun can’t shoot without bullets, first make the ammo system architecture clean and then add the shooting off of it!

Magazines can be put in and pulled out of the guns

I was really excited to reloading back in and working after working on the prototype for it earlier in the semester, except far more modular and cleaner this time. After carefully thinking through the architecture, I opted for creating a custom actor component called “Ammunition Storage Component” that has two variables: current ammo count and maximum ammo capacity. The component has a few functions that modify the current ammo count, from checking if its empty or full, adding rounds to the storage, or decreasing rounds from the storage. This component can be added to anything that stores ammo, from an internal magazine in a shotgun to an external magazine for a rifle, which will then allow the gun to access its and functions!

Once the component was done, I quickly got the magazine objects and their attach/detach logic working again and gave them an ammo storage component. On the gun, when the magazine is attached, it sets the gun’s current ammo storage component to that magazine, allowing it to be checked and decreased when firing!

Shooting, Grabbing, and lotsa bugs

We are very fortunate to be using Unreal to make this game. The engine is setup so well for making shooting games that making shooting work again, this time in a more architecture friendly way, was a breeze. Josh, Emmett and I talked alot about using either projectile shooting or line trace shooting, weighing the pros and cons of each. We decided that since we’re going for a more arcadey route with this game, the projectiles would be unnecessary for anything other than a launcher, since the bullets won’t be dropping or anything like that. 

That simplified things alot, at least for now. The most difficult thing I had to do for this task was figure out how to get the trigger input from the holding motion controller to the gun, which ended up being two event dispatchers in the motion controller blueprint delegating events in the gun when its picked up and unassigning them on release. The rest is easy: pull trigger, call fire event, decrease ammo storage component’s count by 1, call line trace, spawn particles and sound. Nice and simple! 

Shooting, grabbing, and reloading

For using full auto mode, the system simply branches off of a setting on the gun checking whether or not its automatic. If it is, it loops until the trigger is released or the gun is dropped…except I forgot that last part before taking the game to testing! We had some fun bugs in testing when players would hold the trigger, let go of the gun, and scream in horror as it continued unloading its magazine on its own. Yikes! Luckily it was a simple fix. 

Speaking of bugs, the testers also found a lot of problems with grabbing that gave me quite a big headache. There was a lot of errors with the logic revolving around grabbing mags and entering the two handed trigger, which would cause the hand and the mag to get attached to the gun…not fun. Luckily Josh and I worked together to figure out some logic for only allowing grabbing interactions to happen if the hand is only overlapping one grab point. With that, the shooting and grabbing was functional and clean!

Gun Bolt Procedural Animation

Rounding out my tasks for this week was something I was really excited about: making the guns start to feel good with procedural animations! I decided to start by making the bolt or action of the gun movable, setting up animation blueprints for each gun’s skeletal mesh. All that got setup really quickly in the gun base class after I imported all the awesome gun models Adam made this week. It uses a simple timeline system that sends data to the gun’s animation blueprint and lerps it whenever a round is fired.

Bolt animation!
Showing off the rifle as well

Upcoming Week Plan

For the next coming week, my tasks involve finishing off the remaining gun features that will make them easier to use, more interactive, and satisfying to shoot. I’ll be creating procedural recoil animations for the guns, the bolt grabbing system when reloading, and a “ghost” highlight system that outlines the next part of the gun in the reloading sequence that needs to be manipulated. I also plan to work on more documentation for the guns as well as start making and implementing sound effects!

See you next time,

-Karl

Leave a Reply