Dev Log: Sword Ability 2.0 - From Frustration to Satisfaction ๐Ÿ—ก๏ธ


The Old Approach ๐Ÿ“‰

Let me tell you about the original sword implementation. It was straightforward but flawed - when an enemy was in range, the sword would simply spawn right at their current position with a tiny random offset. In theory, this should have worked fine. In practice? Well...

The problems became apparent as soon as enemies started moving at different speeds. Basic enemies were fine, but when wizards and bats entered the scene, things got messy. The sword would spawn where the enemy WAS, not where they WOULD BE, leading to this awkward dance of constantly missing faster enemies. For players, this felt like the game was cheating - they were close enough to hit, but the sword just wouldn't connect.

Why It Needed Changing ๐ŸŽฏ

The old system had three major gameplay issues:

  1. Fast enemies felt unfair to fight against
  2. Players were forced to get dangerously close to ensure hits
  3. The combat felt more random than skillful

This wasn't just about fixing a technical issue - it was about making the core combat feel satisfying. After all, the sword is one of the first abilities players get, and first impressions matter.

The New System ๐Ÿ“ˆ

The rework centers around predictive targeting. Now, instead of just checking where an enemy is, the sword system:

  • Calculates the relative speed between player and enemy
  • Predicts where the enemy will be in a few frames
  • Adjusts its prediction time based on movement speed
  • Places the sword slightly ahead of fast-moving targets

The difference in gameplay is night and day. Fast enemies no longer feel unfair - they're still challenging, but in a way that feels intentional rather than broken. Players can maintain a safer distance while fighting, and the combat feels more strategic.

Life Steal: The Cherry on Top ๐Ÿ’š

With the core targeting working better, I could finally add something I've been wanting to implement - life steal! The system takes the improved hit reliability and adds a rewarding healing mechanic. It's carefully balanced with fractional healing (starting at just 0.25 HP per hit) to ensure it feels impactful without breaking the game's challenge.

(Yes, there's currently a small visual bug where the effect triggers on spawn rather than hit - it's on my fix list! ๐Ÿ˜…)


The Impact on Gameplay ๐ŸŽฎ

The rework has transformed sword combat from "spray and pray" to "precise and satisfying". Players can now:

  • Reliably hit enemies at the edge of their range
  • Develop actual strategies against different enemy types
  • Feel rewarded for accurate positioning and timing
  • Sustain themselves in combat through skilled play

Final Thoughts ๐Ÿ’ญ

This rework really highlights how seemingly small technical changes can have huge impacts on gameplay feel. What started as "the sword keeps missing" turned into a complete rethink of how the core combat should feel, and I'm much happier with where it landed.

Sure, there are still tweaks to make (looking at you, life steal visual effect!), but the foundation is now solid. The sword feels like a proper weapon rather than a game of chance, and that's exactly what I was aiming for.

Back to development! Maybe it's time to look at those wizard enemies next... ๐Ÿ’ป

Files

game_updated.zip Play in browser
Dec 20, 2024

Get Knightmare

Leave a comment

Log in with itch.io to leave a comment.