Making Variance a ''flat'' value?

Hi guys,

I'm having some trouble with implementing my weapon system... I only now realized that the ''variance'' when adding skills is a % value. I always thought it's simply a +/- that much final damage. 

This is a pretty major problem, as I've designed the whole weapon system around the idea of some weapons being more reliable than others and I'm not a big fan of %s when the actual values are very small - 100 hp at the start, not much per level. 50 damage is a huge deal, so an easy +/- 10 damage would really help with balancing instead of using something like 33%.

Is there some way to change it to what I'm looking for?

Thanks!
Just set Variance to 0 for all your skills and just put in the additional damage you want in your damage formula for the skill?

For example, the default damage formula for attack is a.atk * 4 - b.def * 2, but with a 20% variance.

If you set the variance to 0, and change the damage formula to (a.atk * 4 - b.def * 2) + 10, then that would add a flat value of 10 to the damage you've done. The good thing about this is that just like variance, you can set a different value to each individual skill. 🙂
Would you want this to be done for ALL skills that have a variance? Or would you want some to be a % and some to be a flat rate?


If you have a variance of 10, does that mean 10, or does it mean to adjust the result from anything between -10 and +10?


Because you're getting someone to tell you how to do it, or to do it for you, you have to be specific about these things and not rely on assumptions.


Are you happy to do this in the damage formula (would take a bit of work, and you might not have the room), or would you like a script written to do it?
Sorry, I shouldve been clearer. 

I'm trying to recreate the Dungeons and Dragons system with a twist, where pretty much every weapon hits for some random value between x and y, then you add some stats to it. The idea is that instead of attack I'm using skills, with for example the club hitting for 10-30. This means that I'd just use 20 as damage, then 10 variance so it could be anything between 10 and 30. I'd need to do this for all attacks, so something like a script would be nice, but if there is a way to just use the damage formula and then copy paste it with some changes to the values that would be fine too.
You might be able to use the damage formula if you use a script to let you assign a different default skill to individual weapons (I think Yanfly has one such skill). Then in your formula you could do 10 + rand(20) to make it a random number between 10 and 30 (or is it 29? Can  you get a result of 20 from a rand(20)? Anyone know? If not, make that rand(21) instead).

The other way would require a rewrite of the damage algorithm, and you would probably need notetags to tag the minimum damage and the variance to do that. That migh tbe within my skill level, though I cannot get started on even an attempt of it until Sunday at the earliest, unless I gain some unexpected free time tomorrow (Thursday).
You might be able to use the damage formula if you use a script to let you assign a different default skill to individual weapons (I think Yanfly has one such skill). Then in your formula you could do 10 + rand(20) to make it a random number between 10 and 30 (or is it 29? Can  you get a result of 20 from a rand(20)? Anyone know? If not, make that rand(21) instead).

The other way would require a rewrite of the damage algorithm, and you would probably need notetags to tag the minimum damage and the variance to do that. That migh tbe within my skill level, though I cannot get started on even an attempt of it until Sunday at the earliest, unless I gain some unexpected free time tomorrow (Thursday).
Hmm, didnt know that I can use rand in the damage formula, I think that till do the trick. 🙂

Thanks! 
Let me know if that works. I think though you will need rand(21) to make it give a random number between 0 and 20 if I recall correctly. May need to experiment some to make sure.
Yes. rand(n) will give you a number between (and including) 0 and n-1. So if you want to give 20 with a variance of +/- 10, you would say 10 + rand(21).


If this is not confusing, you're finding the lowest result you'd get (20 - 10 = 10) and using that as the starting number, then finding the highest result you'd get (20 + 10 = 30) and using the difference between that and the starting number in the rand(). But because 0 is valid and 20 is valid, you actually want to go 1 higher to give you a chance of getting 20.

Original thread: https://forums.rpgmakerweb.com/threads/making-variance-a-flat-value.37636/