Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Changing how damage is calculated within RPG Maker Xp?

Script Title: Custom Damage Calculation Script
RMXP or RMVX: RMXP
Detailed Description: I hope i'm doing this correct ^^;
Basically, I don't know exactly how Rpg Maker Xp calculates damage or resistances, but I don't like it. I'd like something that I deem to be much more simple for terms of calculating what will be done.
I'll list below how I think it should go...
Hp: This number should simply mean how much HP the character has. I'm pretty sure that's standard. I'm sure this works that way already.
Sp: Skill points, Mana points, call it what you will. This number should mean how much of it they have. I'm sure this works that way already.
STR: Critical strike rating. A critical attack is one that deals double damage. The percent default chance should be 5%, but increases (and decreases) by 1% for each difference between attacker and defender (if attacker was 15 and defender was 5, critical hit chance is 10+5=15%)
DEX: This one should be important for turn order. The number should accumulate. To make it simple, attacker has 15, defender has 10. For each 10, they get a turn. So the attacker will get first attack, then defender would get one attack, but due to the attacker's DEX, he now has a total of 20 (15-10+15), and so gets two turns before the enemy can attack back. So it'd work even with odd numbers, adding up the little bits, and removing 10 on each attack phase.
AGI: Agility should be used for evasion and accuracy. The attacker's versus the defender's. If equal, the chance for hit and miss is equal (50%). I'm sure you can get the idea, basically the difference between them would change that percentage, so say an attacker's agility was 30, and the defender's agility was 60, the hit chance would only be 20%. If a difference of more than 50 is present, it'd be impossible to hit (or, if the attacker has the upper hand, impossible to miss)
INT: Intellect is used for magic, same as ATK is used for attack.
ATK: This number is the attack strength of a character, used for physical attacks.
PDEF: Physical defense. Used in damage calculation. Attack value of attacker, minus defense value of defender, equals damage done to HP.
MDEF: Magical defense. INT minus MDEF is damage to HP.

Okay, now that that's set, I'd also like to make it so that the damage dealt isn't always a constant number. Is it possible to make the damage dealt have a variance? So that it sometimes deals more or less damage by about 5 points?

EDIT: I forgot element and status efficiency!
A: Damage (or with status, status change chance) reduced by 50%
B: Damage (or with status, status change chance) reduced by 25%
C: Damage is calculated as normal
D: Damage (or with status, status change chance) increased by 25%
E: Damage (or with status, status change chance) increased by 50%
F: Damage (or with status, status change chance) increased by 75%

Thanks.
 

JoshC

Member

Um, not to be nit picky or anything, but your system is a bit too simple, and also.... there are several errors in it.

First off, your Str, you did your math wrong, you said if the attacker was 15 and defender was 5 then 10+5 = 15, where are you getting 10 for this calculation? This would also create issues with enemy monsters or characters that are suppost to be of similar level but have variances in stats. Also Str generaly calculates more than just crit chance, also improving your attack, if you use this method then your attack is only going to be based on the quality of weapon you are wielding, in which case enemy battlers would have no strength.

Second off, Dex, once again your trying to manipulate mathematical equations. You said that for every 10 Dex the player gets another turn yet you turn around and say that if you have 15 Dex and the enemy has 10, 15-10+15=20 thus you get 2 turns, that completely contradicts your first statement. Also you can't just say that for every 10 Dex they get a turn, if a player had 900 Dex 900/10 they'd get 90 turns.

Third off, Your Agi idea is ok, you might have made the chances a bit randomly up in the air with it but... , but you did your math wrong again, 60-30 = 30 not 20, thus it would be a 30% hit or miss rate.

And Lastly, your PDef and MDef calculations resemble nothing like any rpg's PDef/MDef. Once again you've made your calaculation too simple, if you use Attacker's Att - Defender's Defense, sure if your attack is greater you'll do some damage, but if your attack is less then you do the opposite, you'll 'heal' your opponent. And if you have the same att as his def then you'll never get off the ground to begin with.

P.S. As for the variance in damage that can be done with simple random calculations. i.e. Var:difference = rand(0-5) ; rand(0-1)(this is Boolean) if true, + difference ; if false, - difference (Sorry using basic programming example not RGSS)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top