Thursday, January 20, 2022

Melee Combat Is In The House!

Melee combat? Yeah, no problem. I can do it in one day. Only it took me a full week. I had to make several adjustments to the combat algorithm that was, until now, just being used by ranged weapons.

Because I wanted everything perfect so I could rest well at night, I had to create 4 animations for the Fist icon, to handle fade in, fade out, idle, and exit states. But let me skip the boring details and show you how it turned out:


The combat formula is currently as follows: the attack score is the result of the attacker's [melee skill + 1d40] roll, against the defender's [melee skill + 1d20]. If the attacker's resulting score surpasses the defender's, the strike succeeds. The amount of damage dealt is calculated by getting a random value between [1 and the attacker's total strength] + the attacker's total agility.

On paper, this formula seems ok but I still need to test it, so changes are prone to happen.

Stay safe!

Sunday, January 9, 2022

Hit Percentage Chance Indicator

I think that having a percentage indicator is better than simply having the deviation circle to measure the chance of hitting a target. When a unit shoots, it will shoot somewhere within the deviation circle. So, by extrapolating the percentage based on the size of both the target's collision circle and the deviation circle, we can get a fairly accurate percentage value for hitting targets. This is done by applying the 'Rule of Tree' math calculation.

As shown on the video, the chance of success for hitting a target is reinforced with color-coding, scripted as follows:

  • Above 80% - Blue.
  • Above 60% - Green.
  • Above 40% - Yellow.
  • Above 20% - Orange.
  • Above or equal to zero - Red.
Take care!