Custom Damage Formulas

kurt91

Veteran
Veteran
Joined
Dec 28, 2015
Messages
39
Reaction score
20
First Language
English
Primarily Uses
I've been playing around with an idea for an RPG that I've had for a very long time. The thing is, I'm having a bit of trouble wrapping my head around a decent damage formula. I've got a spreadsheet open, so that I can play with the numbers and see how things play out quickly. While I think I have something that works out fairly well, I'm a bit curious as to how the individual stats play their roles.


Okay, I feel that I'm not getting this across all that well, so let me just launch into this and ask for a few second opinions.


ATTACK POWER: Atk*(1+.01(Pow))+(1+.10(Str))+(.10*RandBetween(0,Lck))


Basically, this formula uses the character's Attack stat (Atk), the power of the attack used (Pow), The character's Strength (Str), and the character's Luck (Lck) as a variance amount.


DEFENSE POWER: Def+(1+.10(End))+(.10*RandBetween(0,Lck))


This part of the calculation works the same way, substituting Attack for Defense (Def), and Strength for Endurance (End). Again, Luck is used as a variance amount. Since the attack formula is boosted by the attack's unique power variable (Pow), it should ensure that two characters with similar stats don't get stuck doing nothing but scratch damage. After both formulas are calculated, the two results are subtracted from each other to get the amount of damge dealt.


So far, when I test the formulas against each other with five different-powered attacks (20, 40, 60, 80, 100), I seem to get pretty decent results. However, I'm a bit apprehensive on how the Luck stat is being used. Let's say the player uses boosting items to increase their luck up to something like 100. It seems a bit odd that the luck variable can fluctuate between 0 and 100 on each attack. I tried adding in the percentage bit in there to even it out, but then it seemed like it's not very effective as a variance amount.


Does anybody have any ideas how I can adjust this?
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
why does str have to be seprate from atk and def from end?


also, why not just use the variance feature already in the skills?
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,114
First Language
English
Primarily Uses
RMVXA
What are "average" values for ATK, DEF, STR, END, LUK, and Skill POWer?  And for those first 5 stats, when you have the opportunity to increase one or the other, about how much do each increase relative to the others?  Your formulae seem to heavily overweight ATK and DEF on first glance, but certain combinations of average/increase values would mean that they're not truly overweighted.
 

kurt91

Veteran
Veteran
Joined
Dec 28, 2015
Messages
39
Reaction score
20
First Language
English
Primarily Uses
To answer the first question, I liked the idea of the variance amount being tied into the player's stats in some way, and that players who found that out could potentially manipulate it by messing with their stats.


Like I said, I have a spreadsheet that I've been using for quick calculations and testing. My initial values were gotten by just messing around in the stat generator in RPG Maker a few times, so my testing values started with...


ATK: 20


DEF: 19


MG ATK: 16


MG DEF: 14


AGI: 13


STR: 21


END: 18


WIS: 15


FAI: 13


DEX: 16


Skills are initially split into five "levels" (Think Final Fantasy's "Fire", "Fira", "Firaga", etc.) for basic damaging attacks. For now, they're just 20, 40, 60, 80, 100. However, I can adjust these accordingly if I need to. (Also, those base values are for primarily damage-dealing spells and skills. Things with additional effects or more unique skills can have their one values.) As for Luck values, I was playing with it the most since I was a bit suspicious on how it was being used right now and found a flaw after some testing. When Luck reaches higher values (I tested with maxed out Luck at 100), the amount of fluctuation possible ended up giving me negative results at one point after calculating damage results.


Another issue that I found is that unless I start utilizing Agility and Dexterity as main values for various spells or weapons, I don't really have a plan on how to implement them. Agility can be simply a speed stat, and I guess Dexterity can be another factor in calculating variance, but I'm a bit stumped on how I'm going to use them. I did originally only add them in so I had all of the traditional values to play with, I don't necessarily NEED to use them.


I'm also not sure if I should have it set up where the secondary stats (STR, END, etc.) are fixed values per-character, or if I should let them grow alongside everything else. I currently have three ideas. One is to keep them static as values to make individual characters more unique in how they calculate damage. If I do this, I'll probably have them set up like percentages. High values would be around 80-100, while low values would be something like 20-30.


Another idea is to let them grow just like the primary stats upon level up. The third idea is to have only the primary stats grow on level up, and have the stat-boosting items that can be found only affect secondary stats rather than the primary stats. You'll still find items that boost your overall attack power on a permanent basis, but you won't end up maxing out ATK or anything like that in that way. They'll still have an overall net gain for your character, but not in such an obvious way. Also, I could make them potential results in a crafting system or some other way of making them a non-finite resource, and it would take much longer for the player to break their stats than it would constantly boosting their primary stats, as well as making potential power-gamers feel that they're still abusing the system for their own gain.
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,114
First Language
English
Primarily Uses
RMVXA
OK, so in my opinion (and I can't emphasize that enough - I'm going to say things in a definite manner here but it doesn't make me some arbiter of truth) you have some good ideas about general systems and interdepencies between mechanics, but you're showing a blindness to good "stat" design.  Stats are at their best when they are meaningful and clear to the player - Attack is the stat you invest in to increase your physical power, Magic Defense is the stat you invest in if magic is tearing a character apart, etc.  If it's hard to articulate what a stat does, simplify it or get rid of it (or split it into multiple stats that can be clear).  If two stats start to encroach on each other, like, ATK and STR, roll one into the other.


For example, does STR play a meaningful role in your game besides influencing Attack Power (and/or other stats)?  If not, this is a really good candidate for streamlining.  Stats like WIS or STR or CHA are important in pen-and-paper RPGs because they are used in out-of-combat Dice Checks and such, like inventing an arcane trinket or scaling a wall or convincing a guard to let you through the castle gates.  They might influence combat stats, but (in most P&Ps) these functions are almost incidental and there are better ways to become a powerful combatant.  Most video game RPGs (particularly JRPGs) don't have these kind of out-of-combat functions for "secondary" stats so there's little justification for complicating the player's life with them.


As an example of how you might streamline out the STR stat if you don't have a compelling reason to use it: Your attack power formula scales by +1 for every 10 points of STR that the attacker has, and it also scales by +1 for every single point of ATK that the attacker has.  This is true no matter what the values of ATK and STR are.  (I am simplifying slightly since ATK also gets multiplied based on Skill Power whereas STR doesn't, but I think that effect is probably not huge enough to invalidate this example.)  Therefore, you could get the same effect by removing STR from the game and giving each character extra ATK equal to one-tenth of their total strength.  If a character had 30 STR, just boost their starting ATK value by 3 instead.  If you decided to increase secondary stats per level, giving this character 2 STR per level as well, simply give them an additional 0.2 ATK per level instead.  If STR was also used in another formula somewhere alongside a Primary stat, do the same thing for that Primary stat as I just explained for ATK.


While I'm talking about the formulas, I'd be remiss if I didn't point out the way the way they seem to imbalance your stats.  Based on the formulas in your first post, I was expecting stats like ATK and DEF to be much lower than stats like STR, END, and LCK.  After all, the 20 ATK looms much larger in the attack power formula than the 21 STR does: the ATK contributes 20 points to a skill with 0 Skill Power and 40 points to a skill with 100 Skill Power, whereas the 21 STR contributes 2.1 points to any skill.  That's a huge divide!  Why would any player care about STR when they could invest in ATK?  (Again, if STR has other important roles, you can mostly ignore this criticism.)  This is doubly exacerbated if ATK will scale with level and STR won't.


With that being said, I actually do like the idea, for some games, of Primary stats scaling with level while Secondary stats could only be increased only with uncommon equips or items.  Again this kind of paradigm is really good for things like Dice Checks - the game becomes uninteresting if a Level 70 barbarian just happens to have enough Charisma stat to charm the king into doing his bidding, whereas if he's simply a very strong warrior that still has a hard time catching onto the finer points of society, you still end up with interesting experiences.  There are probably some combat identities that could benefit from non-scaling stats - for example your movement speed around the map in an action battle system is something that should probably be more about the character's innate properties than their level.  So I think you've got some good ideas going here.  Again, though, the existence of the secondary stats should be based on whether you can find a compelling reason why those stats enhance the player's experience with your game (even in a small way).


As far as values like AGI and DEX - remember that just because they enhance the experience in a good game that you're trying to replicate or pay homage to doesn't mean that they will enhance the experience in your game.  If you're struggling to find a way they can influence anything, dump 'em!  The game will be better without a glut of stats that don't feel significant.  (If you need something to determine turn order because of your battle mechanics, you might be able to use the other stats, or you could do it based on order in the party, or you could have a non-growing secondary stat Speed that does nothing but determine turn order.)


In my own games, I use AGI to influence the rate of TP gain and allow characters to act more often (in an ATB-like battle system), and I use DEX as the sole influencer of Critical Hit rate (crits have additional effects besides increased damage, so DEX couldn't be rolled into other stats like ATK).  These stats pretty much exist because of extra mechanics (crit effects, ATB, etc.) that I've added to my battle system.  If my battle system were a simpler affair, I'd probably remove these stats entirely and roll their "value" into other stats.  So to some extent my advice would be to have an appropriate number of stats that's commensurate with the number of incomparable mechanics in your combat system (or elsewhere in your game).


Anyhow, lots of opinions in my post here spoken with a lot of authority, and it doesn't make me write.  But I hope at least some of this presented some good food for thought for you as you think through what each stat truly adds to your game!
 

kurt91

Veteran
Veteran
Joined
Dec 28, 2015
Messages
39
Reaction score
20
First Language
English
Primarily Uses
Okay, I removed the secondary stats like Strength and Endurance. You were right, they don't really do much, and my results were nearly identical after the removal. I'm thinking of implementing Speed into the attacking formulas. It makes sense that a faster attack would deal more damage since the target wouldn't have as much time to respond. It also gives me a use for Speed beyond simply determining turn order. (I wonder if there's a way to make it so having something like twice or three times the target's speed value turns a standard attack into a double-strike, since the attacker is so much faster...) I also multiplied the attacking formulas by 1.5 to try and overcome the Luck issue that I mentioned before.


Anyways, my standard attack formulas seem to be pretty well balanced at this point, so I want to ask something a bit different now. You know how usually in an RPG, the main character has a slight advantage over other party members, whether it be that the main character is a Jack-of-all-Trades or has high default stats? I want to do something to make my protagonist a bit special, plot-wise and mechanic-wise. My main character is the only party member with a "Scan" ability. He can analyze enemies in-battle to gain elemental Scan Points. Essentially, each element of magic gets its own JP system, and you gain each type of JP by scanning same-element enemies. This means that while all of the other party members learn spells through leveling up, special items and equipment, or skill books that correspond to their natural abilities, the main character can learn whatever types of magic he's able to scan from enemies. (Each enemy can be scanned once in a single battle, to prevent FFVIII's Junction grinding problem)


I was thinking that past a certain point, scanning additional enemies would be pointless since you've already learned the appropriate skills in that set, so I wanted to implement Scan Points as part of the main character's exclusive spells' damage formulas. However, since there would be no limit to the amount of Scan Points you could accumulate, given the player is patient enough, I was wanting to ask what you guys thought of the idea. Even if it would be incredibly slow, what do you think of a stat with no cap that could potentially deal game-breaking amounts of damage if the player was willing to put in ungodly amounts of time?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,114
First Language
English
Primarily Uses
RMVXA
I was thinking that past a certain point, scanning additional enemies would be pointless since you've already learned the appropriate skills in that set, so I wanted to implement Scan Points as part of the main character's exclusive spells' damage formulas. However, since there would be no limit to the amount of Scan Points you could accumulate, given the player is patient enough, I was wanting to ask what you guys thought of the idea. Even if it would be incredibly slow, what do you think of a stat with no cap that could potentially deal game-breaking amounts of damage if the player was willing to put in ungodly amounts of time?


I would recommend diminishing returns.  For example, if you're using the Scan Points (SP) as a factor to multiply the skill's overall power by, a formula like (3 + SP^0.5); that is, 3 plus the square root of the SP for that skill (I assume that each skill would have a separate SP count?), might be appropriate.  After 1 scan, the formula would use a factor of 3 + 1 = 4.  After 9 scans, 3 + 3 = 6 so 50% more powerful.  After 25 scans, 3 + 5 = 8 so 100% more powerful.  After 100 scans, 3 + 10 = 13 so 225% more powerful than the original.


You could even go a bit higher than 0.5 (though less than 1 - maybe 0.6 or 0.7); the point is that the power would be theoretically uncapped but within a short amount of time the player could make the skill strong enough to be viable without having the opportunity to make it completely OP with just a few more scans.
 
Last edited by a moderator:

kurt91

Veteran
Veteran
Joined
Dec 28, 2015
Messages
39
Reaction score
20
First Language
English
Primarily Uses
That makes a lot of sense. I was originally going to simply make it something like SP*1.01 or something, so that it would take 100 Scan Points in order to raise your attack power by one point. I figured that by endgame, the player's probably going to have accumulated a couple thousand points, so they'll see a slight increase in attack power over everybody else. That way they'd have a tangible increase, but only the truly dedicated (*cough* absolutely insane *cough*) would consider grinding a significant boost that would make a game-breaking difference. By then, they'd have hit the level cap several times over.


Since posting before, I've been looking at the damage formulas for a number of different games that I liked growing up, so I could see some more examples of how to calculate things out, and for ideas on what kinds of math would keep things balanced. I found a couple ideas that I liked from looking at Super Mario RPG.


First off, it uses a MAX function (I don't know the RPG Maker equivalent just yet, I'll look it up when I'm done working out formulas) so that the player is guaranteed to perform at least a single point of scratch damage. An incredibly simple concept, and I can't believe I didn't think of that one myself. The other thing that I liked was an interesting little quirk with the Jump attack.


In SMRPG, Mario's first special attack is called "Jump". What's unique about it is that the magic power of the attack starts at 25, but it grows by 1 every two times that the attack is used, eventually hitting a cap of 150. Of course, the player will have leveled up enough to have learned at least one stronger attack, so most players won't even notice this since they'll have already moved on. However, it did give me an idea. What about if each spell or special attack did something similar, able to grow in innate attack power until it's hit something like 150% to 200% of it's starting power? It would be actual feedback on the concept of 'Practice Makes Perfect'. It would add another layer of strategy in that the player could 'train' each skill until it's hit nearly the damage output of the next strongest related skill at its starting point, so that the player has a semi-powerful attack option on longer battles that tax their resources like their Magic Points.


Is this something that I could potentially do without needing to look into plugins, adding a special variable like that to the damage formula?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,634
Reaction score
5,114
First Language
English
Primarily Uses
RMVXA
In VX Ace and MV (which I assume you're using since you said "plugins"), you can use the Damage Formula to add almost any variable or other data construct from the game.  However, I would recommend using a plugin to actually count how many times each skill has been used (much easier than using Common Events to do so, and much more reliable than using the damage formula to directly set it since the damage formula isn't necessarily going to be called once per skill use).


Max function in VX Ace: [x, y].max


Max function in MV: Math.max(x, y)
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
also, if you want ideas on how to use the damage formula in an interesting way, fomar made a tutorial on how to do that. theres also so much more you can do besides what he mentions 


for example, pokemons damage formula is possible in rpg maker
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I've moved this thread to RM2k3 Support (this is not a game mechanic - it's a damage calculation). Please be sure to post your threads in the correct forum next time. Thank you.


I've put this into the 2K3 forum purely because that's what your profile says you're using - I have no idea if that engine actually allows you to edit the damage formula like the later versions do.  If you're not using 2K3, please state what you are using, so this can be moved to the correct forum, and either update your profile or state in each new thread which engine you're referring to.
 

kurt91

Veteran
Veteran
Joined
Dec 28, 2015
Messages
39
Reaction score
20
First Language
English
Primarily Uses
It's not 2k3, I've been using MV. Still, I figured because the question was about damage formulas that could work regardless of engine, it would have belonged to the Game Mechanics Design forum. I'm sorry for putting it in the wrong category.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top