Mortal Combat

Ahoy, Terrorteers! During the radio silence since my last update, I’ve been hard at work on a variety of subsystems that are finally starting to coalesce into an actual combat system.

One of the major components of this is enemy AI. I’ve got preliminary AI in place that allows for enemies to hear you, search for you, and, once found, try to kill you. It’s a complicated topic, and one I’ll detail in a later update. Its rough edges are going to need a lot more polish in the months to come, but at the moment it’s good enough for government work.

What I’m going to focus on in this post is all the other little bits and bobs that have been added to bring the combat into focus.

As detailed in my last post, the general idea for the combat system finally crystallized around the notion that combat would focus on catch-as-catch-can mêlée with the balance firmly in favor of the Baddies. The question then became how to keep this balance.

Survival horror games often center around a scarcity of resources to aid in building tension. With mêlée weapons not requiring ammunition, games tend to resort to a “durability” meter that reduces their effectiveness with increased usage. I initially thought I might employ this tactic as well, but I’ve honestly never been a fan of it, so I wanted to explore other possibilities for balance before resorting to a technique I’ve never enjoyed in the first place.

My first angle of attack (so to speak) was focusing on limiting the effectiveness of the weapons themselves (adjusting stats for damage, speed, etc.). This was a start, but preliminary testing showed that with even halfway decent timing the player could easily wail on a Baddie in a war of attrition without any fear of damage in return, no matter how ineffective their weapon was.

"Stop hitting yourself, stop hitting yourself..."
“Stop hitting yourself, stop hitting yourself…”

This meant other limitations had to be introduced to keep things properly balanced. That’s where stamina comes in.

Each character will have their own strengths and weaknesses in order to differentiate each individual story and to encourage players to experiment with alternate styles of gameplay. I originally thought stamina would be a singular stat, but eventually decided that different physical actions would need to pull from three different traits: Strength, endurance, and agility. Strength affects physical attacks, endurance affects running and dodging, and agility affects how effectively you can sneak.

Ginny’s hair is just straight up Kelly Kapowski here

Jason, being the jock of the three, will have the most strength and endurance, but less agility. Head on attacks will be much easier for him, but his size and strength make stealth approaches more difficult. Ginny, on the other hand, will have a harder time with direct combat, but will be able to sneak around much easier. Malcolm, being the most bookish of the three, will be a little less skilled in all three, but sometimes brains can make up for brawn…

With the introduction of stamina, there needed to be a way of communicating this to the player. I’m not a huge fan of UIs full of bars and stats, so I wanted to take a more diegetic approach. As your stamina drains, visual and aural clues (tunnel vision, heavy breathing, reduction in speed) will indicate to the player that they might not be up for this year’s Presidental Physical Fitness award.

“Milk…was a bad idea…”

Similarly, when players are attacked, their heart rate increases, their vision fills with red, and the world itself starts to lose color.

“Maybe if I stand still, he won’t see me…”

And speaking of being attacked, I lifted a wonderful idea from this Game Developers Conference talk from Naughty Dog for blood spatters. I started by drawing random blood spatters using my tablet and a pencil tool and applying a gaussian blur:

These were then imported into an ancient version of After Effects. First, the size of the spatter was decreased to 30% and a threshold mask was applied. Over the course of the animation, the spatter was increased in size to 100% while at the same time the threshold level was raised, resulting in a very convincing effect without the necessity of rendering dynamic fluids or hand-animating every drop of blood:

I made 16 different spatters, which were then reduced to 64×32 and imported into the game:

Each time a weapon makes contact, a random animation is chosen and its direction randomized slightly to create non-repetitive viscera for all you gorehounds out there. (Still on the to-do list is a particle system which will allow for spatters to make contact with walls and floors.)

You might have noticed a lot of the animations in the above GIFs are placeholders. That’s because one of the more time-consuming aspects of working on Terror High is the animation. I started using Aseprite a few months ago, which significantly helped my workflow (seriously, if you’re a pixel artist, it’s well worth the $14.99), but animating is still a tedious process, especially at the frame rates I’m looking for. For one-handed weapons, there’s a primary and secondary attack (same strength, but added to avoid repetition) and a strong attack. The primary and secondary attacks alone are a combined 32 frames, which means that even limiting myself to the cardinal directions as I’ve done, that’s 128 frames to animate by hand. (Oh, did I mention I’m insane and decided to do left and right separately, instead of just doing one side and flipping it? My attention to detail is going to kill me.)

Luckily, this animation can be repurposed for any other one-handed weapon just by replacing the crowbar with a pipe wrench, or a hammer, etc.

I’ll eventually need to do the same for two-handed weapons, as well as any ranged or projectile weapons which may be added, and…my mouse hand is cramping up just thinking about all those frames. Still, I can’t argue with the results, which I’m over the moon with. (On the bright side, I found I can listen to podcasts while working on artwork, which means the Gilmore Guys have been keeping me company through this arduous process.)

Diegesis and skeumorphism continues with the inventory system, represented by the prototypical high school JanSport backpack:

The inner nylon texture is literally taken from a picture of my high school backpack

For the inventory, I dusted off an old inventory system I had programmed years ago inspired by the “Tetris inventory” systems in games like Deus Ex and Resident Evil 4. Originally designed with mouse & keyboard in mind, I updated the inventory to work with Terror High‘s more gamepad-focused play.

The inventory works pretty much exactly the same as in RE4 (because you can’t improve upon perfection): Your inventory is represented by a grid, and each item takes up a certain amount of space in the grid. You can move items around, rotate them, or discard them if necessary to fit what you need in the limited space.

The grid on the side serves as a holding area/rubbish bin. Any item discarded is returned to the game world, so no worries about accidentally throwing away something you meant to keep.

I love “Tetris inventory” because of the elegant visual simplicity it uses to convey the concept of available space. What you see is what you get. There’s no abstract “weight limit” where picking up an herb weighing 1 gram suddenly brings your character to a crawl.

Eventually, I hope to explore limited upgrade and crafting options (think: adding barbed wire to a baseball bat, or combining gasoline, a bottle, and a rag into a molotov cocktail), but that’s far down on the to-do list.

So, we’ve got an inventory for picking up and storing weapons, we’ve got a UI that tells you when you’re hurt or tired, we’ve got some spiffy animations what allow you to swing a weapon around, we’ve got blood, and we’re starting to have something approaching an actual game.

There’s still a ways to go, from refining enemy AI to animation to designing additional enemies, but I’m pretty excited about the progress.

Until next time, Terrorteers — stay spooky.

One thought on “Mortal Combat

Add yours

Leave a comment

Powered by WordPress.com.

Up ↑