Damage algorithm based on armor

I’m interested in the following conditions:

if armor == damage
damage = ?

if armor > damage
damage = ?

if armor < damage
damage = ?

and also if the armor has a negative value

  if  arm > 0 then
	arm_ =  rand(arm/2, arm) -- get from min to max

  	 mtr  = dmg / (dmg + arm_)
  	 dmg_ = dmg * $mtr

  else
      if arm < 0
        arm_ = rand(arm/2, arm)  -- get from min to max
        dmg_ = dmg + $arm_
  end
      

now i get this result

incoming values:
arm= 210; dmg= 200;

outgoing values:
a> 188; d> 103;

arm= 210; dmg= 200; a> 188; d> 103;
arm= 209; dmg= 199; a> 201; d> 99;
arm= 208; dmg= 198; a> 176; d> 105;
arm= 207; dmg= 198; a> 129; d> 120;
arm= 206; dmg= 200; a> 151; d> 114;
arm= 205; dmg= 199; a> 115; d> 126;
arm= 204; dmg= 196; a> 162; d> 107;
arm= 203; dmg= 197; a> 185; d> 102;
arm= 202; dmg= 195; a> 195; d> 98;
arm= 201; dmg= 194; a> 175; d> 102;
arm= 200; dmg= 191; a> 131; d> 113;

arm= 10; dmg= 57; a> 7; d> 51;
arm= 9; dmg= 101; a> 7; d> 94;
arm= 8; dmg= 54; a> 8; d> 47;
arm= 7; dmg= 38; a> 6; d> 33;
arm= 6; dmg= 146; a> 4; d> 142;
arm= 5; dmg= 54; a> 3; d> 51;
arm= 4; dmg= 197; a> 3; d> 194;
arm= 3; dmg= 184; a> 3; d> 181;
arm= 2; dmg= 79; a> 1; d> 78;
arm= 1; dmg= 123; a> 1; d> 122;

arm= 0; dmg= 117; a> 1; d> 117;

arm= -1; dmg= 148; a> 0; d> 148;
arm= -2; dmg= 78; a> 1; d> 79;
arm= -3; dmg= 50; a> 2; d> 52;
arm= -4; dmg= 40; a> 2; d> 42;
arm= -5; dmg= 192; a> 5; d> 197;
arm= -6; dmg= 161; a> 6; d> 167;
arm= -7; dmg= 117; a> 3; d> 120;
arm= -8; dmg= 39; a> 4; d> 43;
arm= -9; dmg= 85; a> 6; d> 91;
arm= -10; dmg= 158; a> 9; d> 167;

arm= -180; dmg= 190; a> 120; d> 310;
arm= -181; dmg= 198; a> 167; d> 365;
arm= -182; dmg= 192; a> 124; d> 316;
arm= -183; dmg= 197; a> 147; d> 344;
arm= -184; dmg= 199; a> 149; d> 348;
arm= -185; dmg= 197; a> 129; d> 326;
arm= -186; dmg= 196; a> 159; d> 355;
arm= -187; dmg= 197; a> 127; d> 324;
arm= -188; dmg= 198; a> 102; d> 300;
arm= -189; dmg= 199; a> 107; d> 306;

I like the algorithm for adding damage with negative armor, but with positive it is somehow not very

p.s

I don’t want to use a ready-made table of values.

I would like to receive predictable damage with a little bit of randomness

I don’t quite understand what you are asking. Could you try to be a bit more specific with what you need help with?

Fine. Weapon has damage - for example 10-30

take the average value 18

dmg=18

character has 10 armor

armor = 10

and life 100

hp=100

so what should be the final damage?

damage = damage - armor

hp = hp - damage

but it’s too easy

Maybe. Easy is not always bad. You could introduce different types of damage and armour which protects differently depending on damage type.

DAMAGE TYPES

  • Blunt/crushing (maces, hammers, baseball bats, kick, punch, headbutt)
  • Slashing (blades, axes)
  • Piercing (arrows, lances, spears, horns)
  • Fire
  • Cold
    etc

There’s also plenty of good answers only a search away:

https://www.google.com/search?q=rpg+damage+rules

Pretty good answer here btw:

Also, don’t forget about critical hits (damage multipliers), misses and dodge/evade, attack speed, initiative (who attacks first) etc

4 Likes

Thank you. really too many options