Help with stat influence in a damage formula?

I'm trying to make it so that the weight of the two participants affects the damage formulas of given attacks.

{I can use a custom damage formula script for the 100 line limit. I just need help with the formula part}

I have the stat of Weight.

Let's call it wgt {although this could be tested with luk}

But yeah, for example, Tackle could be

(a.atk*4 - b.def*2) * (a.wgt / b.wgt)...but what if the target is heavier than the user?

Like a dragon that's about 10 times heavier than the user.

It'd equate to less than 1 and would cancel out.

So I could say that 

if a.wgt > b.wgt; (a.atk*4 - b.def*2) * (a.wgt / b.wgt); else; (a.atk*4 - b.def*2) / (b.wgt / a.wgt); end;or... would that that not work?

or should it be 

if a.wgt > b.wgt; ((a.atk*4 - b.def*2) * ((a.wgt*100) / b.wgt) / 100); else; (((a.atk*4 - b.def*2)*100) / ((b.wgt * 100) / a.wgt) / 1000000); end; to eliminate problems with any decimals?

or would that that not work either?

Should there be a better way to do this to where one equation can be used regardless whether the user's weight is higher than the target's weight or the target's weight is higher than the user's weight?

And if the formula is influenced fully by the quotient or multiplication of the two, that means you'll totally obliterate

light puffballs and would never kill a boss dragon with Tackle, given that the weight would be 10 times lower, and their HP would be 100 times higher. 

So what if I wanted it so that the formula was only partially influenced by WGT?

Like how in the earlier RPGMaker versions, you could specify how much Spirit influenced a damage formula.

Or like how Slash would be less influenced by WGT than Tackle would.

I could..... Gah! I need my old math teacher  🙁

Could anyone help me?
Consider weight as a multiplier...

Formula * ( a.wgt/b.wgt)
Yeah. Thanks.

formula * ( a.wgt/b.wgt)

100 * (16000 / 220000) {let's say the formula damage becomes 100 and the user's weight is 16000 and the target's weight is 220000}

the damage would then become 100

Unless I went like 

formula * (((16000 * 10000) / 220000) / 10000)

which would equate to a damage of 7, I think. 

Wait, no... ugh! This is hard!

...and against a dragon that has 100 times the HP, that would mean

Tackle would take forever.

So how could I make it so that Tackle is essentially only affected 20% (instead of the 100% you've seen here) by weight, or a formula that would work essentially work like that?
Tackle would take forever on a dragon if lower weight unless godly strong... my honest opinion is to raise b.def with such bad numbers, or use more generalized numbers.

Otherwise, you want 80% delt or 20%?
I want it so that the quotient of weights only affects the calculation by 20%. Meaning that if something is 10 times lighter than you,

the damage will be multiplied by 2, not by 10 (or something like that... I suck at math very badly), and if something is 10 times heavier, that doesn't mean that the damage is divided by 10, and that if the two have the same weight then the damage is unaffected.

And I can use that 20% thing for other skills like Slash which uses less.

{And this will be significant for things like Gravity and Gravity Lighten which affects the weight of the victim 😀  }

{Also, this will add to strategy because you'd want to use less lunges/etc with lighter characters and use something that uses more weapon or magical power, and you'd want to tackle something that is more skillful or magical than is sturdy and heavy.}

I don't think you'd be literally dividing a.wgt by b.wgt, but putting them somewhere in the formula to make it so that essentially it goes to 20%. I'm not quite for sure.
((Formula)/2) + (((Formula)/2) * (a.wgt/b.wgt))

It's not perfect, but starts the value halves and either adds the value again (is same weight) or adds less or more based on weight difference.

I would still suggest smaller numbers.

If you run into a 100x larger object, no formula would fix your problem.

I'd probably more group by weight class. Think of it like mekwars.

small (organic) = 1

medium (organic) = 2

heavy (organic) = 3

ex.heavy (organic) = 4

light (mechanical) =5

and so on

in this instance if tackle deals 100 and it's a a.1/b5

50 + (50 * (.2)) = 60

the reverse would be 300 damage (a likely outcome considering a vehicle hitting a person)
formula*(1+(a.wgt/b.wgt)*0.2) #you cannot deal damage below 100% though using this
Thanks. I will try both of these out.

Engr., how could I make it so that if 

if the user's weight is higher than the target's weight, a different formula is used, one that will work when the weight is heavier than the target's but won't work when the target's weight is higher?
try something like


x=(a.wgt/b.wgt.to_f);if x > 1;then;formula_when_user_weight_is_higher;else;formula_otherwise;end


or if you won't be using the weight ratio anyway, just use


if a.wgt > b.wgt;then;formula_when_user_weight_is_higher;else;formula_otherwise;end
Thank you.

What formula should I use for when the user's weight is lower than the target's?

formula / (1+ (b.wgt / a.wgt) * 0.2) ?

To test, well, if a.wgt is say 1 and b.wgt is say 10

100 / (1 + (10) * 0.2)

100 / (3)

33

That isn't quite 20% but okay. 

----------------------------------------------------------------------------

And Deilin, with your formula, if a.wgt is 10 and b.wgt is 1,

((Formula)/2) + (((Formula)/2) * (a.wgt/b.wgt))

would be

((100)/2) + (((100)/2) * (10/1))

50 + 50 * 10

which would be 550.

Which isn't 200.

and if it went 

((200)/2) + (((200)/2) * (10/5))

100 + 100 * 2

then that'd be

300.

----------------------------------------------------------------------------

Seems like both of your formulas almost halve the influence.

Which is okay.

(or I might be doing something wrong idk lol)

So, to test on a fresh project, I just used

if a.luk > b.luk;then;100*(1+(10/5)*0.2);else;100/(1+(10/5)*0.2);end just to assume that the base damage was 100 and that the two different weights were 10 and 5 respectively.

100*(1+(10/5)*0.2) made 140 

and 

100/(1+(10/5)*0.2) made 71

So I guess that means it worked? Kinda? Or should I aim for 20%?

--------------------

Deilin I tried your formula in-battle.

((100)/2) + (((100)/2) * (a.wgt / b.wgt))

((100)/2) + (((100)/2) * (10/5))

gave me 150

but

((100)/2) + (((100)/2) * (5/10))

gave me 50.

I should mention I was using big numbers because I'm using an Inventory Weight system. A hairpin is going to weigh a lot less than a suit of armor XD
A hairpen is negligable in most cases then, unless you're counting a crate of them.

Im sure there is a better way then formula box, which is limited space.

Edit:

If a physical "RAM"... would weight be more a factor then attack?

I do have a game on the side dealing with physical attacks of vehicles, but i'm sure my formulas eont help yoh because i dealt with mass differently.
Idk, I think I like the way the formulas you guys gave me are. I feel 20% is too weak. I would just wonder how to play with them to make it so that Slash uses less weight.
((Formula)/2) + (((Formula)/2) * (a.wgt/b.wgt)) is more a suggestion, and easily modified.

((Formula) *0.8) + (((Formula)*0.2) * (a.wgt/b.wgt))

((Formula)*0.6) + (((Formula)*0.4) * (a.wgt/b.wgt))

my suggestion with it would be keep the overall change = 1

0.6 and 0.4

0.7 and 0.3

Original thread: https://forums.rpgmakerweb.com/threads/help-with-stat-influence-in-a-damage-formula.24637/