Damage formula system like OSRS

Hi,

I want to make the damage formula system for my game like what exists in Oldschool Runescape.

Mainly, I need to change somehow what Attack and Defense parameters mean for actors, and maybe change one of the other parameters to equate to strength.

What I would like is this:

Defense Parameter: Increases the chance that the enemy hits 0/misses, but very slightly.
Attack Parameter: Increases the chance that you accurately hit the enemy. That you do not roll a "miss"

Strength Parameter: (maybe edit luck to this): Increases the maximum amount of damage you can deal in a hit. BUT I want the amount to still be random.


Please let me know if anyone has any ideas.
With the random thing, just add variance to the skill, plain and simple. You could make MAT "strength". You can change what paramaters do otherwise with a script
I think yanfly has a plugin that lets you modify how hits and evasion are done, you can probably use it to incorporate atk and defense... Then just make sure your damage formulaa dont use atk/def if you dont need them
You could use Magic attack for strength, Magic deffense for magic, Agility for defense. Sense magic attack and magic defense don't do anything by default, you can rename and repurpose them however you want! sense you can use them in formulas however you want! want to make a skill that uses deffense to attack, and MP for defense from an enemy? You can do that! want to make a skill that has the enemies attack hit YOUR deffense and deals the damage to the opponent? Yup! you can do that too
Thanks a lot for everyone's input so far. If anyone can point me in the right direction for what plugins OR formulas to use, I would be very greatful. I will restate again what I'm aiming for.

First off, I am using Alpha ABS system, so stuff like agility/ needs to stay as attack speed is a thing within that system...

But as for my combat damage formulas:

Attack and Defense in combat:

I want player attack stat to "roll" against the enemies defense stat to determine whether you hit for a non zero value, or miss and hit 0.

If the attack roll "wins" against the defense roll, then for the amount of damage the hit does: a random number is chosen, between 1 and X, where X is determined by your Strength level and is considered to be your MAXIMUM hit.



---------
If this is just possible to construct using math formulas alone, I could just do that but I assume I would need a plugin to add the "Strength" parameter I am wanting.

But I am pretty stuck on how to construct a formula for that if anyone is good at math and wants to help I would really appreciate it. Or if anyone could point me in the right direction in regards to the plugins, that would be great too.
want player attack stat to "roll" against the enemies defense stat to determine whether you hit for a non zero value, or miss and hit 0.
Can you explain what this means mathematically and precisely?
It might be obvious to someone who's played D&D maybe, but many haven't.

Example: If the player attack is 15 and the enemy defense is 10, what does a "roll" mean? What are you rolling?

I could just do that but I assume I would need a plugin to add the "Strength" parameter I am wanting.
The previous commenter suggested you can rename Magic Attack to strength and use it like that, you didn't respond to that suggestion. Does that suggestion work for you?
(better to not add a plugin if you don't have to)
Can you explain what this means mathematically and precisely?
It might be obvious to someone who's played D&D maybe, but many haven't.

Example: If the player attack is 15 and the enemy defense is 10, what does a "roll" mean? What are you rolling?


The previous commenter suggested you can rename Magic Attack to strength and use it like that, you didn't respond to that suggestion. Does that suggestion work for you?
(better to not add a plugin if you don't have to)

Hi yes, thanks for asking.

What I mean is Attack and defense together in the formula should determine if you hit the target or not. They "roll" against each other to determine if you miss or hit.

This is as close as I've got, but its far from what I'd hoped I could do: (formula for the damage from a basic attack for both player/enemy), the 0.35 is only to ensure that its smaller numbers: Math.randomInt(2) * (a.atk*0.35) - Math.randomInt(2) * (b.def*0.35)

As you can see I am still using attack stat for damage component, and have not considered creating strength parameter yet. In this way, the formula attack "rolls" against the defense stat. BUT, the problem is the attack does not actually increase the probability of a favorable roll, and defense stat does not increase probability of the opponent hitting 0 on you.

What I am aiming for though:

Essentially:
High defense on target will increase the chance that you will miss on him/hit for zero.
Increasing your attack means that you will have a higher chance to hit the target for a non-zero value.

For an enemy with very high defense, you will be hitting zero/missing more often than with low defense.
If you have a high attack to compensate for enemy high defense, this will not be a problem.
But when you hit successfully, the maximum amount of damage that can be done is determined by your strength.

Just like in Runescape.

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-system-like-osrs.114329/