Devlog #3 Hit chance, damage, armor, the way you can make your enemies disappear.
I thought its time to talk a little bit about how combat is calculated in our game, as this is a very prominent system that the players will try to manipulate to their advantage in a tactical game. No component of it is particularly unique, so I'm sure you, the reader, will be able to bring up other games that had one component or another. But I think the mix of those components and their effect on each other is interesting. Before I go into it though I want to leave a note that the exact values could change, as we are in development!
Hit chance calculation:
Let's start with the formula:
hit chance = base_hit_chance + attacking_character_accuracy_bonus - defending_character_defense_bonus
Here, the base hit chance is 50%, so if everything being equal, a character has a 50% chance of hitting the enemy. One important point, it can't go under 5 % or over 95%. But what about the attacking and defending bonuses? There are multiple ways to gain both. For starters, every character has an innate defending bonus, which depends on their level. In addition, weapons are giving an additional bonus to attack (for example a mace) or defense (shield) or both (sword), depending on the user skills.
In melee combat, another big factor is facing. If you are facing dead ahead of the attack, or the attack comes from just 1 tile from the left or to the right, the attacker does not get a bonus to their accuracy. But if they attack from the sides, they get 10 %, and if they attack from the back 40 % bonus. So no matter how good of a fighter you are, if someone can attack you from your back, he/she will have a good chance of hitting you.
Crit Chance calculation:
We only roll for crit chance, if we managed to hit the enemy. The formula as follows:
crit chance = base_crit_chance + attacking_character_accuracy_bonus - defending_character_defense_bonus
Basically the same formula as before, but with one big difference. The base crit chance is 10 %. Very similarly it has the same 5%, 95% bounds as well. So if your character has an accuracy advantage, it will affect it's crit chance as well.
Now we need to talk about the critical hit effect because it is a little bit different than in most games. In Slaves of Magic, a critical hit will mean you managed to circumvent the armor (for example, managed to stab into a weak point in plate mail). As such, it gives you 100% armor penetration. But it's pretty much useless against people with very low-to-no armor. Before I go into why it is designed as such, I should talk about how damage is calculated, and how armor affects it.
Every skill has a damage range, for example, 10-15, and we roll to see the actual damage. The formula:
damage_received = weapon_damage - attacked_unit_armor.
So that means armor works as flat damage reduction, which is being mitigated if you manage to do a critical hit. Why I chose this system though, what I'm trying to accomplish here? I wanted to have a game system that helps me really differentiate how certain weapons are used against different types of armor. For example, a sword should barely do any damage against a heavily armored guy, so if you have to fight him, you have to prioritize skills with critical hit. But if you are fighting against low-to-no armored enemies, you should have a different skill set as critical hits do not really help there.
To further elaborate on the balance side of things, we will have quick weapons with low damage (for example one-handed swords) and slow weapons with big damage (hammers). Slow blunt weapons won't be able to crit, but they have such high base damage, that they will be consistent with their damage against heavy armor. On the other hand, quick and low damage per hit weapons will be better against low-to-zero armored opponents, because of higher raw DPS, plus the speed advantage. I feel as this is a good approximation of how these weapons could have worked against armor.
So that's it for today, and if you haven't seen already, there is a steam page for the upcoming demo here, where you will be able to try out the system in action soon!