We are finally getting into the long overdue overhaul of the equipment stats.

At first when I made the equipment in the game I just kind of thought “I’ll put some numbers in here and then go back and balance it later.” There are going to be hundreds of items in the game, and that approach would have been a nightmare.

Now that we’re at the point that Himeko Sutori is essentially feature-complete, we are starting to crank out content, including all of the weapons and armor you’ll come across in the game. ¬†Instead of continuing to just throw stats at the equipment, I decided to plot out what I want the items to be like, calculate what their values should be, and then go put those numbers into the game (with a little variation, to give different weapons a different feel and to let the players argue over whether something is under- or overpowered). That means I’ve spent most of today sitting in front of Excel.

First I took a look at the hit/dodge/block calculation, and I plotted out what it actually did. It resulted in decreasing hit % when dodge and block skills increase, which was good, but the curve wasn’t what I wanted. So I wrote a formula to give me exactly the curve I wanted:

The blue line is (1+AttackPower)/(2+AttackPower+Avoid) where Avoid is either the enemy’s Dodge or Block skill, for a given value of AttackPower and a range of Avoid. The purple line takes those “raw odds,” and feeds that value into a sigmoid function, 1/(1 + e ^ (A * RawOdds + B)), and I played with A and B until I got a curve that I liked. With values of -20 and -8 respectively, I ended up with a curve that gives you about 90% chance of hitting something that has Dodge equal to your AttackPower. And then if the attack hits, I do another check to see if the target can block, using the same formula but the target’s Block value instead of Dodge.

Next up I started working on how much damage the attacks should do. I filled up a spreadsheet with some inputs I can change to see what the outcome would be. Then I tested out starting hit points, hit points gained per level, expected attack power increase per level, how many levels you go between upgrading your weapons and armor, and how much of a jump each weapon and armor upgrade should be. In the end, I came up with this, which I think looks pretty reasonable:

That shows, at each level, how many attacks it would take on average to kill an opponent of equal level. The zig-zag shape goes up when you upgrade your armor, which then absorbs more damage, and the line slopes down as you level-up, which increases damage output faster than it increases your hit points, until you upgrade your armor again. The blue line is for a character wearing heavy armor and the red line is for a character wearing light armor. That doesn’t take into account defenses that help you avoid attacks (like the dodge and block discussed above) or healing. As for healers, I expect to make them mitigate less damage than an equivalent-level attacker would deal, which means that adding healers to the party just makes you lose the battle more slowly–unless you really take care to optimize your characters. In the end though, giving a slot to a healer is still going to be gambling on the expectation that you can win through attrition.

I think planning out the item stats and level-ups like this is going to end up working a lot better than just tossing stats at equipment. And I think it’ll save a lot of time testing and balancing later.