Blade Ballad 0.2.1 - Procedural NPC Moveset


This post will go over several improvements to the current state of Blade Ballad, starting with manual weapon rotation, NPC combat movement, and inventory, in that order.

The manual weapon rotation has always existed prior to this version, but based its rotation off mouse position, whereas now is based off mouse magnitude, or the vector that the mouse has been moved relative to the center of the screen. The advantage with this new approach is that you don’t have to recenter the mouse, so your attack angle is much more responsive to changes. I did notice some conflicting controls with the manual controls and the attack angle that is set when you initiate an attack, which also responds to mouse magnitude. While not a bug, I should add a setting to disable this.

The manual rotation also involves some settings which can be fine tuned in the Configs>Controls tab when paused.

  • Weapon rotate threshold: The threshold magnitude that the mouse must be over in order to trigger a rotation. A lower value means the rotation is more sensitive to mouse movement.
  • Combat block mode: This sets whether the block mode is manual or automatic. Prior to this version, it was only automatic, which worked by getting the angle of the target weapon and rotating yours to be perpendicular to it.
  • Combat targeting mode: Toggles between Soft Lock and Hard Lock. Soft Lock, being the default, has you hold down the right mouse to lock to a target. Hard lock has you hold down the F key for a quarter second then locks to the target without needing to hold down any keys.

You can also rebind the key which toggles the rotation, which can be done in the Keybinds tab.

Attacking with a heavy swing (holding down the left mouse) now cause damage on its backswing, which makes it more useful when it has to compensate for a longer swing time.

Now onto the focus of this post, which is on NPCs. This took up the bulk of the time in this release, but it was quite important since swordplay is central to the game so I was fine putting other tasks like worldbuilding to the side. In general, I implemented the following:

  • Pseudorandom hip and hand movement: Prior to this, NPCs would just walk towards you and start swinging while standing upright. It looked stiff but since this is a kinematics driven combat system this behaviour actually negatively impacted gameplay, as there was an exploit where you could crouch and stab at the NPCs legs and they couldn’t do anything about it. Now NPCs can randomly crouch and move their hands so it’s much harder to just crouch and attack at one location since they’re always moving.
  • Weapon pitch based on target vertical offset: Before this implementation, an NPC who have found a target would swing their weapon at eye level towards at enemy, not considering if the enemy was lower or higher than them. This change adds that dynamic pitch change. By the way, I borrowed the “pitch” terminology from aviation, where pitch referred to the axis perpendicular to a plane centerline.

Finally, there is the rework of the inventory system, with the changes as follows:

Dead NPC has an inventory: You can now access the inventory of a dead NPC, which will contain any armor gear that it was wearing. Weapon drop on death: Killing an NPC will drop the physical weapon that it currently equips, which you can pick up. Gear degradation: Your weapon and armor gear will take damage each time it parries or absorbs an attack from an enemy, and breaks once its condition reaches zero. Fixed the “add_item” console command as well. Turns out I forgot to include the class in the final build.

Cool new blood effects as well, thanks to a YouTube tutorial from Asqa Nadeem, and I used the Overlay blending option in the shader setting, which created those darker areas where there’s a higher concentration of blood particles.

Files

0.2.1_windows.zip 646 MB
Mar 13, 2024
0.2.1_macOS.zip 647 MB
Mar 13, 2024

Get Blade Ballad

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.