Making Variance a ''flat'' value?

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
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!
 

Neo Soul Gamer

Veteran
Veteran
Joined
Aug 10, 2012
Messages
653
Reaction score
391
First Language
English
Primarily Uses
N/A
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. :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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?
 
Last edited by a moderator:

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
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.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
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).
 
Last edited by a moderator:

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
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! 
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top