top of page

Mettle Up!

A "cooperative fighting game" where the player teaches an AI the art of combat by sparring with it.
 

Designed for Wowie Jam 4.0 where it ranked #78 for creativity and #85 overall out of 1019 entries.
 

Mettle Up! uses a very simple combat system with three directional attacks and two types of defense each countering only two of these three attacks. The player character is opposed to an AI opponent that does absolutely nothing in the beginning. However, after each fight, the AI gains 'experience' based on the actions performed by the player, and uses this experience in the next fight. For instance, if a player uses always the same attack, so too will the AI. As the stated goal of the game is not the beat the AI, but rather make it reach max level in all the techniques, it often creates a very fun end-game situation, where good teachers end up creating an opponent so good they get repeatedly beaten by their own student!

Design highlights

Combat

Mettle Up! uses a kind of rock-paper-scissor system for its combat mechanics. Both player character and opponent have a limited set of moves at their disposal: a high attack, a low attack, a thrust attack, a dodge and a parry. The complexity arises from the interaction of each attack with the two kinds of defenses. Low attacks can be dodged but not parried, thrusts can be parried but not dodged. High attacks can be either dodged or parried, but they deal more damage than the other two. All attacks have the same length.

Mettle Up! Attacks.png

On top of this, the player and the AI can use a somewhat hidden feint mechanic: when starting an attack, they can cancel the animation in its first stages by using another move (attack or defense) early enough. This allows for instance to bait the opponent into a dodge by starting a low attack, then quickly switching to a thrust to get a guaranteed hit.

There is also a combo mechanic: when an attack lands, immediately launching a different attack bypasses its preparation time, making it much faster. However, it prevents this next attack to be feinted since it has no initial phase. Only three attacks at most can be chained in a single combo (since each attack of the combo needs to be different from the previous ones).

Finally, there is a special move only available to the player: giving an order. This is done by holding shift while pressing any other action key. Instead of performing the action, the player character will order the AI to use the action corresponding to the pressed key. For instance, pressing Shift+spacebar will force the AI to parry. This action is very useful to train the AI into specific moves, and is crucial to improve its reaction time (see next section).

Giving an order to the AI

AI

Learning

The theme of the game jam was "collaborate with AI", hence the idea of a 'collaborative' fighting game in which you have to actually train an AI. The AI in Mettle Up! is by no means very advanced however, it is not a neural network and is completely unable to learn without continuous input from a human player.
The way it works is actually extremely simple. The AI opponent has 8 stats: high attack, low attack, thrust, dodge, parry, speed, reaction time and health. Each one of these has a level that starts at 0 and can progress up to 10 at the end of the game. Actions performed by the player or the AI give experience points to the corresponding stat, eventually pushing it to the next level.
When the player successfully performs an action, it gives a small quantity of experience to the AI (for instance, when the player lands a high attack on the poor AI's head, the AI gets a bit of high attack xp). If it's the AI that successfully performs an action, it gets much more experience (learning by doing is more effective than learning by watching).
The basic action stat (attacks and defenses) are self-explanatory, but the other three work a bit differently.
Health is simply the amount of damage the opponent can take before the fight ends. A small amount of health xp is earned when the AI takes damage, and a large amount if it loses the fight.
Speed is a measure of the frequency of action of the AI. The higher it is, the more often the AI will act. It increases when the player or the AI perform combos.
Reaction time represents how fast the AI reacts to an incoming attack or an order. At level 0, the AI takes about 2 seconds to react to anything, but at the higher levels it surpasses slightly the average human reaction time. Reaction time only gets xp when the player gives an order the the AI, making the order mechanic a crucial part of training. This is intentional, as it further incentivizes the player to use the order action rather than simply mindlessly mashing buttons to teach the opponent.

FIghting

During the fighting phase, the AI will periodically 'check' if it will act. The frequency of this check is determined by the speed stat, the AI will act more frequently as its speed gets higher. Speed does not affect the actual speed of actions.

When a check occurs, the AI will then randomly determine what attack it will perform. An attack stat with a high level has a higher probability of being picked. At level 0, it will never be performed, meaning the AI is entirely unable to attack in the first fight (unless given orders). Even at level 10 in all attack stats, there is still a small probability that no action will be taken to keep the rhythm of the fight somewhat unpredictable.

When the speed level of the AI is high enough, it also becomes able to use feints as its frequency of attack becomes shorter than the prep time of an attack.

When the player launches an attack, the AI will also determine semi-randomly its defense action according to its defense stats. As for the attacks, at level 0 the AI will never use this defense action, and at level 10 it will almost always use it. However, the AI will still try to prioritize the most effective defense against the incoming attack. For instance, if the player launches a thrust, the AI will first make a check with its parry stat, and only if it fails this check will it do another one with the dodge stat (even though dodges are ineffective against thrusts, simulating human error). That also makes high attacks really easy to defend against for the AI, as only one of either stat checks needs to be passed.

If a defense action is chosen, it will be performed after an amount of time determined by the reaction time stat, meaning that an opponent with level 10 in dodge and parry but level 0 in reaction time will still defend poorly as it will be much too slow.

bottom of page