Game Development

Blog 788: This Is The Rhythm Of the Knife

I’ve made no secret of the fact that Exon‘s core loop is based on Westwood’s classic and criminally-underrated action-RPG Nox. This manifests itself most clearly in the movement system: hold the right mouse button to cause your hero to walk towards the cursor, leading them around the world like a little mouse following the cheese.

Similarly, I took the melee attack system, where each click causes a single sword slash, damaging whatever has the poor fortune of standing in your blade’s path.

Except then I realised that, actually, I didn’t. Nox has a more complex and interesting “stamina” system controlling its attacks than my naive cooldown attempt, and it contributes immensely to all the feelings I had been struggling to recapture.

The Rhythm of the Knife

I noticed that something was wrong when I got the first draft of the Arena up and running. In those days, every combatant was created equal — their movement and attack speeds, their hit points and their behaviour. This led to every encounter between two players being decided by whomever landed the first blow: since each was attacking at the same rate, dealing the same damage, the one that started a split second behind would be unable to land the killing blow before the other.

My first answer to this was to diversify the capabilities of their “pilots”. I added a reaction time system, whereby some bots would, on arriving within striking distance of an enemy, pause for a faintly randomised moment. This, as you can imagine, is merely a plaster over the cracks, and not even a good one: the human player inevitably has better reflexes than any artificially delayed bot, and worse reflexes than an instantaneously activated one. While it does add some colour to melee combat, all it really does is change who strikes first. Any combat encounter in that setup is still fundamentally predetermined.

However, I was playing a bit of Nox‘s bonus “Quest” mode recently when I realised that my implementation of the whole attack system was, quite simply, wrong.

When I started with Exon, I was (foolishly, I now realise) very attached to the principle of the game mechanics exactly matching what is visible on screen. For attacks, this boiled down to being locked to animations; as soon as the slashing action is finished, you are free to slash again. (It also involved abusing physics colliders, a system I am glad to have unwound some time ago.) So I built the “cooldown” meter in the bottom-right of the screen to work off the 3D model’s progress through its slashing animation.

Nox does not work like that. An attack animation in Nox lasts a mere fraction of the strike’s “stamina” cost, and for all but the heaviest weapons this is only two-thirds or three-quarters of the pool available. This creates an interesting situation where you are able to make your first two attacks in slightly quicker succession than those following, as the meter is not totally filled by the first and so clears enough to allow the second strike a little bit sooner. The second strike then fills it totally and your next attack has to wait the weapon’s full stamina cost.

You know the other thing I got wrong? Nox has the stamina meter on the left of the screen and the health bar on the right. (This is probably spillage from earlier UI designs that were aiming more for Operation: Na Pali than Earth 2150).

This is one of those epiphany moments that makes everything suddenly become clear. One of my favourite things about Nox is the rhythm of attacking, how attacks feel somehow weighty — and I’m pretty sure this is how it achieves that feel. Since you have to click for each strike, and potentially wait a slightly different amount of time after each before being able to attack again, the rhythm becomes naturally uneven.

In this situation, repeated delays can be added after each strike to simulate a bot pressing its own attack buttons — between the meter draining enough to allow the next attack and actually triggering it. This can be randomised within a range, with powerful bots being quick off the draw every time and weaker ones slower to continue their assaults. The way, the bots continuously vary the rhythm of their strikes just like a human with fallible reflexes does, meaning that the outcome of even a basic one-on-one engagement can remain faintly uncertain throughout. A bot with better reflexes in general will tend to beat one with worse reflexes, but it’s not impossible for the underdog to come out on top either.

I reckon the other feeling of weight comes from having to click once to get each attack. I had built Exon so that holding down the button caused continuous attacks, mainly in an attempt to save the mouse buttons from getting obliterated, but this totally removes that compelling rhythm from the player. Melee attacks become things that “just happen” while you watch, you’re generally just holding down the button and waiting for your opponent (or you) to die.

Maybe “weight” is the wrong word — more like “significance”. Now, a mis-timed click means either not triggering the attack (because you have too little stamina available) or triggering it later than optimal (because you’re a slowpoke), and combat becomes immediately more interesting. The more direct control pulls your attention in rather than keeping it at a distance and so risking it slipping away. This is critical because, unlike a first-person shooter, there is much less movement during combat — it’s fine to hold down the button for spray-and-pray when you’re spending so much more of your brainpower jumping around and avoiding return fire. (That’s not to say there’s no movement in combat — you’ll still be wanting to avoid charging opponents, incoming projectiles and level hazards, it’s just not as fluid from the top-down perspective.)

Needless to say, any time I make this kind of change, the Arena balance disintegrates.

Holding down for continuous attacks also eliminates the possibility of abilities such as the Spin Attack being invoked by holding down the button for a second rather than clicking it once, like how it works in GameBoy stalwart The Legend of Zelda: Link’s Awakening. This is an intriguing thought, because Spin Attack has occupied a strange niche on the action bar since the beginning — all four of the other ability slots are provided by equipping independently-operating items, whereas spin attack acts as an alternative primary melee attack.

Or perhaps instead of putting spin attack there, holding down the button could lead to heavier blows. Could this be another way to add personality to different enemy exons, with some going for short, sharp blows and others going for slow and heavy strikes? (I’m leaning towards no: this particular distinction is already provided by weapon types.)

… In answer to your question: why yes, I am still rebuilding and refactoring systems instead of finishing the prologue demo level that I could actually release!

3 thoughts on “Blog 788: This Is The Rhythm Of the Knife”

    1. Sorry, Reforged has killed any desire I have to make WC3 maps stone dead. 🙂

      I’ll get the forwards-compatible version of This Wreckage out at some point, then I’m done.

      Hopefully in time you’ll get the same (or better) feelings from the real game. 😉


      1. Yes. They really did a number on WC3’s legacy with Reforged. They (Blizzard) are so creatively bankrupt these days that they outsourced the graphics to a different company!


And you tell me...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.