Posted December 20, 2024 by Avskum
#rework #ability #sword
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.
The old system had three major gameplay issues:
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 rework centers around predictive targeting. Now, instead of just checking where an enemy is, the sword system:
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.
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 rework has transformed sword combat from "spray and pray" to "precise and satisfying". Players can now:
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... ๐ป