Dungeons and Dragons Damage Formula Feedback

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
Keep in mind that in order for this formula to work, I have to use Bobstah's Custom Stats plugin.  It can be found here

 

x = Math.floor((Math.random() * 20) + 1); if (x >= a.luk) { Math.floor((Math.random() * a.def * a.agi) + a.atk * a.agi) + a.mat;} else if (x + a.mat + (a.str - 10) / 2 <= b.mdf + (b.dex - 10) /2) { 0; } else { Math.floor((Math.random() * a.def) + a.atk) + a.mat; } This is far more condensed then what it originally was lol.  Anyways, the code above is a damage formula that gives you a dungeons and dragons type of damage output.  To get everyone up to speed here, this is what each stat represents.

ATK = dice number.
DEF = dice size.
MAT = Attack Bonus
MDF = Armor Class
AGI = Crit modifier
LUK = Threat range.

STR / DEX / CON / WIS / INT / CHA are all just the base stats in dungeons and dragons (added in with Bob's plugin).

X is a hit roll with no modifiers.  If X is within your threat range (somewhere between your LUK and 20) then the attack is a critical.  

The critical formula adds dice to the damage based on whatever the modifier is.  Going with a standard x2 modifier (so 2 agi essentially) means that the player rolls two dice for damage.  Obviously this doesn't roll dice, so both def and atk is multiplied by the modifier.  This brings the damage up to 2d8 with a sword, or 2-16 + attack bonus (mat) damage.

If the damage isn't critical then it checks to see if its either equal to, or greater than, the targets Armor class + their dexterity bonus.  Getting the bonus numbers from dnd requires you to subtract 10 from your dexterity score and divide that number by two.  

Everyone starts with a 10 in AC.  If X meets or exceeds the AC then you land a hit and move on to damage.  if not, the damage returned is 0.

This entire damage formula doesn't bypass the hit system built into MV, I just work around it.  Everyone's hit is 100% and everyone's evade is 0%.  So technically there is no chance for a miss, just for a damage return of 0 (simulating a miss).  

The entire reason I didn't add in the Attack bonus to the hit roll in the beginning was due to criticals.  In D&D you don't get a critical if you reach the threat range with your attack bonus.  You have to roll naturally into your threat range.  Though, this is letting you slide with an auto hit below a natural 20, which doesn't happen even if its in your threat range for a critical, but I'm taking a small liberty here.  I could add in another condition to check between the threat and the natural 20 but its not really worth it unless I want some insane threat ranges (which wont happen).  


Ok so this is the base formula I made for D&D style gameplay.  I am welcome to any thoughts on it, or suggestions.  In the mean time, I'm going to add parts to account for various modifiers, such as blind states giving you a reduced hit chance on your roll, bonuses for feats, etc.  I hope to hear some great feedback from everyone!  Thanks for reading this.
 
Last edited by a moderator:

Pine Towers

Knight Hospitaller
Veteran
Joined
Nov 11, 2015
Messages
467
Reaction score
226
First Language
Portuguese
Primarily Uses
RMMV
Today, after looking at this topic, I've come with a more concise way that can be used in the skill damage formula without needing to use custom plugins:

(Math.randomInt(20)+1+a.atk) > (10+b.def) ? Math.randomInt(a.atk) : 0Note: The +1 in the attack part is because Math.randomInt(20) gives a random value between 0 and 19.

This off course still needs improvement since I didn't used custom stats, but it is a start. Now I'm tinkering with Yanfly's custom stats to see if I can use it in this formula, so I find this thread to be extremely interesting to follow. Did you had any progress since you opened it?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I think this thread must have started when I had no internet.

I'm not sure that this belongs here, because I don't actually see what your question is.  It looks like it's just you developing a formula for your particular game, and this sub-forum is about design of game mechanics in general which could apply to several games, not just one specific one.

Could you please clarify exactly what it is you want this thread to do?  At the moment I am inclined to move it to MV Support forum, but before I do that, I'd like to be sure that it's going in the right place.
 

Azaarious

Veteran
Veteran
Joined
Oct 18, 2012
Messages
44
Reaction score
18
First Language
English
@lithkast - Shouldn't there be a 'if rand 1-20 = 1 then auto fail' for rolling a one by the D&D rules? Also ksjp17 is right, I think this goes elsewhere.
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
If this thread goes somewhere else, I'm sorry.  I didn't realize when I made the topic.  I figured this was the area to talk about game mechanics and discuss ways to make mechanics better.  

I started the thread for feedback and to see if anyone else had any other thoughts on the whole dnd formula / ways to make it easier.

So if it belongs elsewhere then can I request a mod move it to the appropriate location?  If not, I'll restart the thread in the appropriate location.

In the mean time, thank you for your suggestions and Aza, you are right.  there needs to be an auto fail check, which will be added in next.  I've actually updated the formula quite a bit.  It looks more like this.

 

x = Math.floor((Math.random() * 20) + 1); if (x >= a.luk) { Math.floor((Math.random() * a.def * a.agi) + a.atk * a.agi);} else if (X == 1) { 0; } elseif ( (x + a.mat + (a.str - 10) / 2 <= b.mdf + (b.dex - 10) /2)) { 0; } else { Math.floor((Math.random() * a.def) + a.atk) + a.mat + (a.str - 10) / 2; } The roll happens and saves to variable X and I just use X for the rest of the formula.  It covers criticals (luk acting as your critical threat range and agility acting as your multiplier) hitting the AC, and critical failure.  I guess the next part would be adding in support for things like feats and what not, though that can come in a bit.  
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@lithkast

I am the mod for this particular forum, and threads should always be moved, not start a new one for an identical question.

The reason for my query is that your OP does not clearly lead to a discussion of general principles, it appears to be a very specific "how to" question.  This is apparent in the response from Azaarious, which deals with a precise piece of formulation, not the general principles of e.g. having DnD formulas at all, or modifying them for x or y reason.

I think this is much better off over on the Ace Support forum.  There are already many threads there which look at at formulas for damage, so it will fit in fine.

If Bobstah's script is a vital part of how this works, it would be good to add a link to it in your OP.
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
Mv, not vx lol. I'll add in a link to it in just a moment. Sorry for the inconvenience
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Sorry for the wrong move I just went by what was under your avatar. Moving again.I'll have to ask someone else to do it as I am not a mod for this forum.
 
Last edited by a moderator:

Mojo907

Veteran
Veteran
Joined
May 21, 2013
Messages
164
Reaction score
38
First Language
English
Primarily Uses
RMMV
Would love a D&D damage style formula, have you worked out anything for spell damage?
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
Yes I have worked out spell damage, though I honestly don't have a way to do metamagic feats.  However, spell damage is pretty sound.  I'll give you an example of Fireball.

x = ((Math.random() * 20) + 1); if ( x + a.level >= b.sresist ) { if ( x + b.reflex + ((b.def - 10) / 2) >= 10 + a.level) { b.isStateAffected(evasionstate) ? 0 : (((Math.random() * 6) + 1) * Math.min(a.level, 10)) / 2; } else { b.isStateAffected(impevasionstate) ? (((Math.random() * 6) + 1) * Math.min(a.level, 10)) / 2 : ((Math.random() * 6) + 1) * Math.min(a.level, 10); } else { 0; }Pretty much the code works similar to the regular attack code.  First roll 1d20 and store it in x.  First you check that against spell resistance.  If your mob doesn't have spell resistance, then the stat should be set to 0 and they will auto succeed in this area.  Most normal mobs don't have spell resist so that is like a special thing.  anyways if they fail the spell resist part, the damage returned is 0.  Otherwise, it moves on to the reflex roll portion of the fireball.

Now it takes the number you rolled for x, adds the reflex save, and your dexterity modifier. (I can't remember if dnd3.5 lets you add in the dexterity mod or not.  I know reflex save gets the mod added in but I just added it there for safety.  you can always remove it).  Anyways if the reflex save roll > the dice check for the reflex save (10 + caster level),  then the spell will deal half damage.  
Now this is where I added in support for the states Evasion and Improved Evasion.  Evasion lets you take 0 damage on a successful reflex save.  So, if you pass the reflex save here, you will take 0 damage instead of half.  Change the word evasionstate to the state number you want to work as your evasion state.  

Ok so if you fail the reflex save, you will take full damage from the fireball.  However, here I have it check for the state Improved Evasion.  Improved Evasion just says that if you would fail your reflex roll, take half damage instead.  Same as with evasion, replace the words impevasionstate with the state number you want to work as improved evasion.

This entire thing works best if you have a way to do passive states.

The fireball deals 1d6 * caster level ( up to 10d6) worth of damage.  To simplify that, I just had it do 1d6 * caster level.  If you want a more authentic dice roll then it should be this.

 

((Math.random() * (6 * Math.min(a.level, 10))) + (1 * Math.min(a.level,10)))Math.min just ensures the lowest number is used.  That way fireball can't go over 10d6.  enjoy
 

GARROTH

Warper
Member
Joined
Jan 21, 2014
Messages
1
Reaction score
0
First Language
Spanish
Primarily Uses
Just Sign in to say thanks. 

 

I Just Sign in to thank you . I´ve been for three days trying to find a formula for my game based on pathfinder and you've done a lot better than me.

Thanks again and congratulations .
 

Ashouse

Resident Zombie
Veteran
Joined
Oct 25, 2015
Messages
246
Reaction score
98
First Language
English
Primarily Uses
N/A
Things were so much better in the Thac0 vs. Ac days. Kids these days. /jk
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top