Dev Log #3: Finally Some Gameplay

Originally starting this game, I hadn’t planned on any sort of weapons but, as I got further and further in, it felt like what it needed to actually make the gameplay loop engaging. I started aiming for something like Vampire Survivors; a bunch of unique weapons that could all level up separately, but worked together at the same time. I wanted a bit more player interaction so I decided on having different weapons fire by charging and releasing, or needing reloading and other ways to make the player have to make some choices on when to stop and start shooting. 

One of the bigger systems I wanted to learn was GAS (the Gameplay Ability System) and this seemed like a good time to get started with. It sounded like a system that was used in AAA development, and even though I’m just one person, I wanted to get at least some familiarity with it. Up until this point I had also been avoiding doing any actual C++, but the setup required me to get in there a little bit, though quite quickly and it was well documented. I’ll skip over that setup and get right into the weapons.

Data setup

With my weapon system, one goal I had was to be able to balance it all in a spreadsheet, without needing the game open at all. Using a data table was all I needed to accomplish that. I created a struct with all the stats I could think I would need and made a data table out of it that I could export/import and edit in excel.

I had some basic stats like damage and ammo, as well as some more unique stats like chain damage falloff (for how much damage each subsequent target of a chained attack receives) or AOEDamageInterval (the time between each damage application while a target is in AOE range). Almost all were a simple single number except charge time, which I wanted to have multiple values for multiple levels of charge (e.g. 1 second for level 1, 3 for level 2 and 5 for level 3).

Not all the weapons would use all of these skills, but the option is there if needed and I expect there are probably other stats I’ll want to add as I get more into the weapons.

Using that data table I made a data asset for each individual weapon, that included a name and description, gameplay tag, reference to the specific row of stats and all the abilities associated with it. I assume I will add things like UI displays or Audio cues here as I develop it.

Managing Weapons

Now to actually manage these weapons I had a few things I had to put in place: an overall weapon manager, an individual component to manage a few aspects of each weapon like level and ammo counts, and each ability they could use.

The weapon manager took care of a few crucial pieces. The first was handling what weapons are currently equipped as well as adding more, removing or levelling them up. It also grants each of the weapons associated abilities. The manager also takes care of targeting, rendering the reticles and passing any locked on targets to the abilities to do what they will. Finally the manager also handles sending events when the player is holding the shoot button and for when they release it. Again, the abilities handle whether these events activate them or not, and what to do with it.

Now to move on to what the actual abilities do. I have 2 basic abilities for refilling ammo, either reload or recharge. These basically just trigger and refill ammo either all at once after a time or 1 or more every x seconds while not shooting. Both of these are triggered when the shooting button is released, but can be delayed if a weapon is still shooting, or if something fires on release. In those cases the reloads start once the firing ends. This is done by giving the weapons a wait for a gameplay event, so they know they will need to start reloading once the current action is done.

Recharge adds ammo every x seconds and ends once a shot is registered

I also have 2 other basic abilities to handle shooting, that are inherited by the final abilities. One is a basic shot and the other is a charge shot. The basic shoot is simple, it makes sure you have the ammo for the shot, removes the ammo and triggers the shoot event that the child will implement. The charge shot is a bit more complex, it starts the second a shoot key is held down and begins increasing a charge timer. If the weapon has charge levels these will also increase as the timer goes up. Once the key is released, then the shoot event is triggered to be implemented by the child. This could be a single strong attack or a series of shots, or really anything.

Charge shot, when started triggers a delay for each charge time and increases charge level when each one is reached.

To test it out I had one weapon in all 4 configurations; a basic attack that reloads, a basic attack that recharges, a charge attack that reloads and a charge attack that recharges ammo. I wanted to make sure they could all work simultaneously without breaking each other, and I also threw in a chain lightening attack I started work on as well as some basic ammo counting (the colour getting brighter on the ammo is for charge levels).

Shooting some barnacles off a whale.

I’ve added a few more GAS components like cues that I haven’t gotten into yet, but I still need to do some work with attributes. I also spent way too much unnecessary time working on a smart object system for random interactables and shifting player movement to mover instead of the CMC, but I feel like I’m in a good place to start trying to make it actually feel good.

I also started finally doing some art again and trying to do my first biome (underwater). I feel like I’ve been pushing off doing any animating since I started, but it might finally be time to learn.

Some underwater assets, ignore the little fish that are swimming backwards

Next
Next

A Game Jam Palate Cleanser