MilkyMcGee

Villager
Member
Joined
Mar 14, 2022
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hey guys I am making a small game and I need help with the damage formula.
I only typed in the formula (a.atk - b.def) and the Variance 10% (does that mean that my character will make 10 damage and
- the enemy def)

And I noticed when I changed that the enemies are now dealing 0 damage to me, I also want the them to deal damage like me (10,20,30 damage).
I want the damage to be simple but it is a little bit confusing to get all this done or am I stupid hahahah

can someone help me out?
 

Aoi Ninami

Veteran
Veteran
Joined
Sep 22, 2015
Messages
511
Reaction score
681
First Language
English
Primarily Uses
RMVXA
Variance 10% means the result can be up to 10% above or below the value calculated from the formula.

For instance, with (a.atk - b.def), if your ATK is 100 and the enemy's DEF is 20, the outcome is 80, so the damage dealt can be anywhere from 72 to 88.

If you want to avoid the 0 damage problem by having a minimum damage of, say, 10, replace the formula with this:

Math.max(a.atk - b.def, 10)

What this does is calculate the normal damage, then if it's less than 10, it calculates the maximum of the damage and 10, which is 10. In effect, any outcomes less than 10 are replaced with the specific number 10. (Of course, you can replace 10 with any number of your choice.)
 

MilkyMcGee

Villager
Member
Joined
Mar 14, 2022
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
Variance 10% means the result can be up to 10% above or below the value calculated from the formula.

For instance, with (a.atk - b.def), if your ATK is 100 and the enemy's DEF is 20, the outcome is 80, so the damage dealt can be anywhere from 72 to 88.

If you want to avoid the 0 damage problem by having a minimum damage of, say, 10, replace the formula with this:

Math.max(a.atk - b.def, 10)

What this does is calculate the normal damage, then if it's less than 10, it calculates the maximum of the damage and 10, which is 10. In effect, any outcomes less than 10 are replaced with the specific number 10. (Of course, you can replace 10 with any number of your choice.)

I noticed the 0 damage the enemies made was because i had items quiped and their damage was lower than my defense now i fixed it

is it a good idea to make say my character attack in the classes 20 and and then just make him equip weapons witch deal different damage for example ( my character does 20 damage and with a axe equipped witch deals 5 now he has 25 damage)

will It be a problem later in the game if I introduce stronger enemies?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
6,947
Reaction score
4,789
First Language
English
Primarily Uses
RMMV
is it a good idea to make say my character attack in the classes 20 and and then just make him equip weapons witch deal different damage for example ( my character does 20 damage and with a axe equipped witch deals 5 now he has 25 damage)

will It be a problem later in the game if I introduce stronger enemies?
No one can answer this except you. You know what numbers you want to have in your game (do actors and enemies have 20 HP before they die? 100? 5,000?).

You have full control over how strong your enemies are. If adding 5 ATK would make them hit too hard, add less than that.

And, for that matter, you have full control over your damage formulae. There's zero reason that what you type in there now has to be the same as at the end of your project.

If you do a touch of Googling there are several threads dedicated to exploring how damage formulae act and explaining the math behind them.
 

MilkyMcGee

Villager
Member
Joined
Mar 14, 2022
Messages
7
Reaction score
2
First Language
English
Primarily Uses
RMMV
No one can answer this except you. You know what numbers you want to have in your game (do actors and enemies have 20 HP before they die? 100? 5,000?).

You have full control over how strong your enemies are. If adding 5 ATK would make them hit too hard, add less than that.

And, for that matter, you have full control over your damage formulae. There's zero reason that what you type in there now has to be the same as at the end of your project.

If you do a touch of Googling there are several threads dedicated to exploring how damage formulae act and explaining the math behind them.

Thank you I will check it out <3

I wanted to make it so the characters do not level up I am a little bit scared what will happen later in the game because I want to make it simple and do not want to mess something up later in the game
 

Latest Threads

Latest Profile Posts

Now that I have linklists on large trees and cars, is there any theme that would interest you?
Debugging multiplayer issues... I'm having fun, right?
yay_streaming.jpg

For just starting streaming on the 10th... Definitely not the worst. :LZScheeze:

Granted I need 333.34 hours a month on average to achieve money. So I don't really expect that, but it sure has helped my game dev go much faster.
Proud on how this map turned out.

FnmhDLIXgAAOvIC
I just finally fixed a huge problem that wouldn’t let my game load and would crash it.. I thought that I was gonna have to trash the project and start over lol

Forum statistics

Threads
128,327
Messages
1,193,635
Members
168,810
Latest member
Maple-Senpai
Top