Sword Instructor Gerald Update 1 - PVP and AI


PVP

This update brings PVP where you can fight with your friend locally. With it includes many adjustments to make PVP a fun experience. One of the changes I want to highlight is countering.

When you block a hit, you have about 0.2 seconds to counter the enemy. Countering will punish the enemy for committing to a second attack and can get blocked if the enemy reacts quickly enough. As soon as you hear the block sound effect, your window to countering starts.

The second adjustment that makes PVP possible is stamina.

Stamina and Exhaustion

Previously, a player could block indefinitely, making them essentially immortal.  To prevent infinite blocking, I've added a stamina bar.

While attacking and blocking takes moderate stamina, blocking hits will drain the attacker's stamina by a significant amount. Done well and you can drive the enemy player or enemy AI into exhaustion.

Exhaustion is essentially negative stamina. During this state, an exhausted player or AI is weakened severely. To denote the importance of getting out of exhaustion quickly, the stamina bar flashes red, and a sound effect plays whenever a player tries to attack or defend while exhausted.

An exhausted attack is 25% as strong as a regular attack. Weakened attacks also no longer flinch enemies, an important defensive tool that breaks the enemy out of their attack animation.

Blocks go from mitigating all damage to mitigating 30% damage. An important thing to note is that weakened blocks still do full stamina damage. This gives the exhausted player the chance to drive their enemy into exhaustion.

A special interaction happens when both players become exhausted. Attacks do full damage and flinch again. Blocks also mitigate all damage. The first person to get themselves out of exhaustion will find themselves at a great advantage.

AI

So, how do we make stamina interesting for the AI?

First, I've introduced an aggressive variation for the AI. This AI is reckless and is prone to getting forced into exhaustion. You have to push your advantage while he's exhausted, as he'll learn to avoid exhaustion over time.

The AI can feel certain emotions which affects how they attack and defend.

If the AI has a lot of stamina and sees a heavily exhausted player, the AI will feel brazen.  The AI no longer considers you a threat and will forgo blocking in favor of attacking. As soon as the player becomes a threat again, the AI becomes worried and will start blocking again.

If the AI wants to attack and finds himself exhausted, he will feel annoyed. His annoyance at exhaustion will make him slightly better at managing it. In game, the AI is generally weak to exhaustion during the beginning and learns to avoid it by the end.

Lastly, I've made it easier to counter the AI. After you block an attack, you have a larger window to counter the attack.

Other improvements

From play testing, I added some minor features that would improve the overall experience.

I added a how to play section, UI and a volume slider. These are all changes that would have improved my play testers' experience. Hopefully, the changes will improve your experience as well.

Lastly, the game is downloadable in case the game is too heavy duty for the player's browser. This generally only becomes important when someone plays on a budget laptop.

Get Sword Instructor Gerald

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.