Jump to content

Recommended Posts

So I'm using Rpg Maker XP, and I've been playing with the damage formula, and I have a few ideas and want to know what you guys think. This is mostly me trying to figure out what to do about physical defense. This is a game where you put points into the stats you want per level. I know it depends on game type but I'm asking for, in most scenarios, which of these would you think you would favor most? If you have any additional ideas to add to what I have, Im open to hear them.
 

1) Direct damage reduction: Basically defense is subtracted from the damage and there is your final damage which is the default formula of ((power + atk )* rate) - pdef

Note: "rate" takes in your other stats depending on what % of that stat is taken which you specify via database.


2) Damage Resistance: Turns PDEF into a % of physical damage is reduced. So same as above except instead of subtracting it as an integer, it is multiplied as a %.

(power + atk) * rate * pdef


3) Ratio-Based
(User.atk + rate) / p,def * power
This one takes the ratio of your atk and stats vs the target's defense.


4) Ratio-based+
(rate / user.atk) * (user.atk + power) / pdef

Similar to above but this makes it so your stat has to match the weapon or you'll be punished (so you can't run a 1000 atk dagger with 20 STR). Tho a debuff in, for example, STR in a str-based skill would increase the damage so idk anymore. Open to ideas about how to fix that issue.


5) Temporary HP
If your pdef is 70, for example, you have 70 temporary HP at the beginning of battle (AKA HP shield or whatever you want to call it). Once it depletes, it's gone until the end of battle.
 

6) Armor Health
As armor health depletes, so does the amount of damage it reduces. This one isn't exactly a stand-alone idea as it can be mixed with the others, but thought I'd put it out there.

Edited by Lord Vectra

Share this post


Link to post
Share on other sites

Another thing you might be able to do is something like AC in D&D, where instead of reducing damage your armor effectively reduces the chance enemies will hit you. Or like shields in some of the final fantasy games, which I think work in a similar way to AC except I think each shield has two stats, a percent chance to block, and an amount to block. Not sure how easy it is to do that kind of thing though.

Share this post


Link to post
Share on other sites
44 minutes ago, Kayzee said:

Another thing you might be able to do is something like AC in D&D, where instead of reducing damage your armor effectively reduces the chance enemies will hit you. Or like shields in some of the final fantasy games, which I think work in a similar way to AC except I think each shield has two stats, a percent chance to block, and an amount to block. Not sure how easy it is to do that kind of thing though.

I thought of that, but I rather evasion stay separate because the battle is supposed to be balanced between non-armored and heavily-armored in a way of armor v evasion type of deal.

Block is already in the game as an action (in place of "Defend"). If you have a weapon, it uses its block stat (its pdef in the database) and if you are using a shield, then the PDEF of the shield is added to your total PDEF. This will be scripted of course since that mechanic isnt default. Also, for a % chance for your pdef to do what its supposed to do (reduce dmg) makes it sound like a worst evasion lol

Share this post


Link to post
Share on other sites

Yeah having an armor vs. evasion dynamic is pretty neat! Though I think there is still a non-armored vs heavily-armored type of thing going on in D&D. I am not sure, but I think in D&D the dynamic is more armor vs. mobility or dexterity instead. Of course there is a much much different type of battle system at play there.

 

Also usually in games that do that shield thing the chance and amount blocked is quite high, so you have like at a 50% chance or more of blocking most or all incoming damage, though some shields might not block all types. Also, since you still get hit I don't think they always block secondary effects like status conditions. So, yeah, it kind of is a worse evasion, but it's balanced to be more reliable.

 

Anyway, I don't really have that many other ideas. It seems like a really tricky thing to balance really! I guess my general advice would be to try different formulas and see what one seems to work the best. Sometimes there is loads of trial and error in balancing stuff! One thing I find useful is to have formulas call a script. I think you can still do that in XP right? That way you can just define a basic script in one place to change the basic way damage is handled for everything. :3

Edited by Kayzee

Share this post


Link to post
Share on other sites
1 hour ago, Kayzee said:

One thing I find useful is to have formulas call a script. I think you can still do that in XP right? That way you can just define a basic script in one place to change the basic way damage is handled for everything. :3


Skills and Items can call a single common event, which can run a script command. There is no damage formula box.

 

Share this post


Link to post
Share on other sites
1 hour ago, PhoenixSoul said:


Skills and Items can call a single common event, which can run a script command. There is no damage formula box.

 

This. Tho the cool thing about XP is Game_Battler 3 pretty much lays out what everything is and the naming of the variables are extremely simple (like attacker.str, user.dex, etc). So I don't miss the damage formula box from VXA and MV like I thought I would. If you want skills to have special damage formulas (i.e. a.mhp * 0.5) then you have to run a conditional branch to see if that skill is being used.

 

 

2 hours ago, Kayzee said:

Yeah having an armor vs. evasion dynamic is pretty neat! Though I think there is still a non-armored vs heavily-armored type of thing going on in D&D. I am not sure, but I think in D&D the dynamic is more armor vs. mobility or dexterity instead. Of course there is a much much different type of battle system at play there.

 

Also usually in games that do that shield thing the chance and amount blocked is quite high, so you have like at a 50% chance or more of blocking most or all incoming damage, though some shields might not block all types. Also, since you still get hit I don't think they always block secondary effects like status conditions. So, yeah, it kind of is a worse evasion, but it's balanced to be more reliable.

 

Anyway, I don't really have that many other ideas. It seems like a really tricky thing to balance really! I guess my general advice would be to try different formulas and see what one seems to work the best. Sometimes there is loads of trial and error in balancing stuff! One thing I find useful is to have formulas call a script. I think you can still do that in XP right? That way you can just define a basic script in one place to change the basic way damage is handled for everything. :3

Yeah, I was at work thinking of numerous things I could try. Damage resistance was my first go-to but it's hard to balance once you get over 50% damage resistance I'll keep trying. Then I gotta think of what leveling system I want (choices, choices, choices).

Share this post


Link to post
Share on other sites
On 2/7/2020 at 8:33 PM, Lord Vectra said:

This. Tho the cool thing about XP is Game_Battler 3 pretty much lays out what everything is and the naming of the variables are extremely simple (like attacker.str, user.dex, etc). So I don't miss the damage formula box from VXA and MV like I thought I would. If you want skills to have special damage formulas (i.e. a.mhp * 0.5) then you have to run a conditional branch to see if that skill is being used.


I recreated Zeninage (coin toss) just by using variable control event commands. Since one can actually inflict damage with a direct number command, recreating this particular skill is easy in XP, whereas in VX/Ace it requires an external script (if not more than one!) If one wanted, they could use any stat (though I'm not exactly sure how to get the specific stat of the skill user in XP), and input it into a variable for the same effect.

Share this post


Link to post
Share on other sites

If I were to make a game, I'd probably use this formula (tho it needs some adjustments):

 

User LVL × (Atk Power × (User Total Atk / Target Def)) × Effectiveness × Critical Rate

 

Where:

Total Atk = (Base Atk + Weapon Atk Stats)

 

Effectiveness Lvl has the ff: 

200% - Very Effective

100% - Neutral

50% - Not Very Effective

0%  - Resistant

 

And, Critical Rate

200% - Yes

100% - No

 

Feel free to make some adjustments on this formula

Edited by MASTER7ZERO7
Accidentally put a × sign in the Total Atk formula instead of + sign and put Target Atk instead of Target Def

Share this post


Link to post
Share on other sites
1 hour ago, PhoenixSoul said:


I recreated Zeninage (coin toss) just by using variable control event commands. Since one can actually inflict damage with a direct number command, recreating this particular skill is easy in XP, whereas in VX/Ace it requires an external script (if not more than one!) If one wanted, they could use any stat (though I'm not exactly sure how to get the specific stat of the skill user in XP), and input it into a variable for the same effect.

 

I think you could recreate coin toss in VX Ace without an external script if you use some weird formula hackery... But yeah sounds way less of a bother to use events.

 

... Though now I can't help but wonder, because you can have skills/items run common events and reference variables in the formula in VX Ace. Don't know if common events are run first before it checks the formula though. Ah well, not important.

Share this post


Link to post
Share on other sites
10 hours ago, PhoenixSoul said:


I recreated Zeninage (coin toss) just by using variable control event commands. Since one can actually inflict damage with a direct number command, recreating this particular skill is easy in XP, whereas in VX/Ace it requires an external script (if not more than one!) If one wanted, they could use any stat (though I'm not exactly sure how to get the specific stat of the skill user in XP), and input it into a variable for the same effect.

I would use game_battler 3 for that. The thing with common event calls is you only get one so me, being an eventing/formula freak, I need more than 1 (lol), So, for example, if I want a skill (Skill 4) to recover HP of the user by 50% of the damage, I go to game_battler 3 and find where damage is subtracted from the enemy's HP.
 

self.hp -= self.damage

 

Then I add the following afterwards.


 

If skill.id == 4

user.hp += Integer(self.damage * 0.5)

end

 

self = target.

user = user of skill.
damage = a variable that equals the damage (by default, it equals damage after damage reduction effects like guarding PDEF, MDEF, and guarding),
hp = obvious
skill = obvious
id = obvious

Integer() = rounds it to the nearest number after calculation


Only thing I use common events for is Multihits because I couldn't get it to work when editing the default scripts (close but not there).

Funny story: I didn't how to use Integer at first so when I did a big change on Game_Battler 3, I was getting decimals like 26.246801947, and I was getting so frustrated because I didn't know why. Then I realized Integer is picky on when it wants to be used. Like, you can do self.damage = Integer(self.damage) but you can't do self.hp -= Integer(self.damage)

ALSO, to answer your question, if you are trying to get the user's stats via script calls, 

 

10 hours ago, MASTER7ZERO7 said:

If I were to make a game, I'd probably use this formula (tho it needs some adjustments):

 

User LVL × (Atk Power × (User Total Atk / Target Atk)) × Effectiveness × Critical Rate

 

Where:

Total Atk = (Base Atk × Weapon Atk Stats)

 

Effectiveness Lvl has the ff: 

200% - Very Effective

100% - Neutral

50% - Not Very Effective

0%  - Resistant

 

And, Critical Rate

200% - Yes

100% - No

 

Feel free to make some adjustments on this formula

I'll look into that.

 

8 hours ago, Kayzee said:

 

I think you could recreate coin toss in VX Ace without an external script if you use some weird formula hackery... But yeah sounds way less of a bother to use events.

 

... Though now I can't help but wonder, because you can have skills/items run common events and reference variables in the formula in VX Ace. Don't know if common events are run first before it checks the formula though. Ah well, not important.

It runs common events after it checks the formula. And ye, coin toss is plausible in the formula without external script tho it can be too long depending on the effects you want it to have. So what you're going to want to do is add the formula in a blank script then call it later.

i.e.

KayzeeBlow = "a.atk * a.def * a.agi * a.def"

Then you' d call it in the damage formula as
eval(KayzeeBlow)

For the coin toss, lets say you have the following effect: "Flip a coin. If heads, kill the opponent. If tails, your MP by 50% and deal damage proportional to the MP decrease."

You would do:
 

Coin = rand(2); If Coin == 1; b.add_state(1); Coin = 0; else; Coin = a.mmp / 2; a.atk - b.def + Coin; end

The reason Coin is used at the end is because I do a thing called Variable recycling. Coin being changed after Coin = rand(2) doesn't matter as it served its purpose. So instead of making another variable, I just re-use it and don't have to worry about resetting it because when you call the skill again, it's going to make Coin equal 1 or 2 all over again. Does that make sense?

 

Btw, in VXA, you can make anything a script variable. I.e. In XP, you can make anything a variable in the script by putting "@" in front. So if you say

@CoCoButter = user.HP

@CoCoButter is now a variable you can use. Thing about this is you have to define what it is first. So if I put
 

@CoCoButter += 1

Without saying it's equal to the user's HP,  It will show a error because it doesn't know what it's adding 1 to. Is it adding 1 to 20? 40? 17? 93? 0?

With VXA, you don't need that. So, for example, Coin is a variable to Vx Ace without me having to add it into the script or anything. KayzeeBlow can fit into the formula box but let's say I did Kayzee Blow Ultimate which did which tossed a coin flip (same effects as before) if enemy is stunned, did 50% more damage, and did more damage the lower the enemy's HP is (oh mai, big boi formulas incoming). You would take that coin flip from earlier and put it into a script and lets pretend stun is state #2
 

-In the Script-
CoinFlip = "Coin = rand(2); If Coin == 1; b.add_state(1); Coin = 0;; else; Coin = a.mmp / 2; a.atk - b.def + Coin; end"
KayzeeBlow = "a.atk * a.def * a.agi * a.def"

-In the Formula Box-
Coin = 0; If b.state?(2); eval(CoinFlip); end; (eval(KayzeeBlow) + Coin) * 1.5 * b.mhp/b.hp

Coin equals 0 in the beginning of formula because an error would pop up if eval(CoinFlip) doesn't activate and it attempts to add Coin to KayzeeBlow. The a.atk - b.def + Coin in CoinFlip would be ran through but won't pop up an error which is why you don't have to make a seperate CoinFlip formula. If you wanted to include a.atk - b.def from CoinFlip, you would do the following instead:
 

-In the Script-
CoinFlip = "Coin = rand(2); If Coin == 1; b.add_state(1); Coin = 0; else; Coin = a.mmp / 2; DMG = a.atk - b.def + Coin; end; DMG"
KayzeeBlow = "a.atk * a.def * a.agi * a.def"

-In the Formula Box-
DMG = 0; If b.state?(2); eval(CoinFlip); end; (eval(KayzeeBlow) + DMG) * 1.5 * b.mhp/b.hp

You'll make CoinFlip equal a variable at the end and then put "DMG" by itself at the very end so if you just use the coinflip skill, it'll do dmg equal to whatever dmg is equal to (in this case, a.atk - b.def + Coin). In the formula where KayzeeBlow and CoinFlip combine, you would just replace Coin with DMG since Coin is already calculated within DMG.

This exact same thing can be done in XP but syntax is slightly different. Instead of a, use user. Instead of b, use self. Instead of damage formula, just check the skill ID. If variable, put @ in front of it. Just to give an example of above:

-In the Script-
#Let's pretend CoinFlip Kayzee Blow combo is skill 6
If skill.id == 6
	@Coin = rand(2)
		If @Coin == 1
			self.add_state(1)
			@Coin = 0
		else
			@Coin = user.sp / 2
			self.damage = user.atk - self.pdef + @Coin
		end
	self.damage += user.atk * user.pdef * user.agi * user.pdef
end


You could also do this which might be beneficial if you're planning on calling these two skills more often

-In the Script-

	@KayzeeBlow = user.atk * user.def * user.agi * user.def

	@Coin = rand(2)
		If @Coin == 1
			self.add_state(1)
			@Coin = 0
		else
			@Coin = user.sp / 2
		end
	@CoinFlip = user.atk - self.pdef + @Coin

If skill.id == 6
	If self.state?(2)
		self.damage = @CoinFlip + @KayzeeBlow * 1.5 * self.mhp/self.hp
	else	
		self.damage = @KayzeeBlow * 1.5 * self.mhp/self.hp
	end
end

 

Long explanation but morale of the story is it's possible and Kayzee has a ridiculously strong right hook especially in his ultimate form.

 

Imagine being on half HP expecting to survive the next hit and you're saving MP to heal but you just get hit with Kayzee Blow Ultimate and you die. Kayzee tries to look sweet but I know his true form.

Edited by Lord Vectra

Share this post


Link to post
Share on other sites

@Kayzee Common events are run after the formula is checked, unless the formula box has a run common event script command in it. I think one could use $game_party.gold as a reference to a number in the formula box, but I'm not sure how one would then subtract the gold used for throwing afterwards, lolz

@Lord Vectra Actually, I was speaking of Gil/Coin Toss, as in, throwing your own money at the enemy. lolz

So, getting the user's ATK/DEX/AGI/EVA/PDEF/MDEF via scripts would be like...
user.atk? user.dex? user.agi? user.eva? user.pdef? user.mdef?

Share this post


Link to post
Share on other sites
2 minutes ago, PhoenixSoul said:

@Kayzee Common events are run after the formula is checked, unless the formula box has a run common event script command in it. I think one could use $game_party.gold as a reference to a number in the formula box, but I'm not sure how one would then subtract the gold used for throwing afterwards, lolz

@Lord Vectra Actually, I was speaking of Gil/Coin Toss, as in, throwing your own money at the enemy. lolz

So, getting the user's ATK/DEX/AGI/EVA/PDEF/MDEF via scripts would be like...
user.atk? user.dex? user.agi? user.eva? user.pdef? user.mdef?

In XP, yes. And LUL, well, if you ever wanted to do a coin flip skill, at least you know what to do XD

We're getting off topic lol.

I decided to just go with user.atk - self.pdef for physical attacks and user.atk * self.mdef / 100.0 for magical attacks. I'll just have to make sure pdef is never greater than ATK.

Share this post


Link to post
Share on other sites

@Lord Vectra Wowsa! That's a big long post! Some of the details of what you are saying seem a little strange, but I never really scripted with XP before so you would know better them me there probably.

 

Also... 'his'? My gender is being assumed again! XD It's kinda funny cause I was just talking to someone the other day about that. Apparently 'singular they' still weirds some people out. Oh well it doesn't really bother me that much, gender is silly.

 

@PhoenixSoul You can actually tell the game to do just about anything in the formula box and I have seen people abuse it by sticking calls to change a state in it so sticking in a call to change the party's gold is probobly possible. ...Though I think that might cause problems with autobattle. Anyway doesn't really matter.

Share this post


Link to post
Share on other sites

Hmmm...since PDEF and ATK can both max out at 999...

Obviously, @Kayzee, mi amour. You're femme all the way.

Spoiler

And yeah; it was a bunch of word vomit to me too...lolz

 

Edited by PhoenixSoul

Share this post


Link to post
Share on other sites
2 hours ago, Lord Vectra said:

I decided to just go with user.atk - self.pdef for physical attacks and user.atk * self.mdef / 100.0 for magical attacks. I'll just have to make sure pdef is never greater than ATK.

 

Well if you are level 99 an go back to an area with level 1 enemies it probobly will be. Does XP not prevent attacks form doing less then zero damage like VX Ace does? If not you can use '[user.atk - self.pdef, 0].max' or something.

 

Also: wouldn't 'user.atk * self.mdef / 100.0' make it so it does less damage when mdef is low and more when it's high? It should really be 'user.atk - user.atk * self.mdef / 100.0' shouldn't it?

 

Wiaaat...  wouldn't that become 'user.atk - ((user.atk * self.mdef) / 100.0)' based on order of operation rules (PEMDAS) when you really want 'user.atk - (user.atk * (self.mdef / 100.0))'? Or wait... Did multiplication actually come before division or are they the same priority? I donno! Order of operations is such an pain, but that's what you get when everyone uses interfix notation.

 

Also that's assuming mdef maxes out at 100 of course.

Edited by Kayzee

Share this post


Link to post
Share on other sites
6 hours ago, Kayzee said:

@Lord Vectra 

 

Also... 'his'? My gender is being assumed again! XD It's kinda funny cause I was just talking to someone the other day about that. Apparently 'singular they' still weirds some people out. Oh well it doesn't really bother me that much, gender is silly.

I thought I remembered you saying male. Was gonna say her at first.

 

Also, I messed up. It's not mdef / 100 but its (100 - mdef) / 100..0

 

Multiply and Division has same priority like how adding/subtracting have same priority.

 

Also, I could put in minimum damage, but I have a multihit aspect in the game and I like the idea of multi hits being strong against low defense monsters and single hits being stronger and more able to blast through armor.

 

6 hours ago, PhoenixSoul said:

@Kayzee MDEF and PDEF in XP max out at 999.

Its currently capped at 85 for PDEF when I had damage resistance. MDEF is capped at 100.

Share this post


Link to post
Share on other sites
11 hours ago, PhoenixSoul said:

 

Pretty sure Vectrex would have to change it...

 

Hehehe... Vectrex....

 

4 hours ago, Lord Vectra said:

I thought I remembered you saying male. Was gonna say her at first.

  

Also, I messed up. It's not mdef / 100 but its (100 - mdef) / 100..0

 

Multiply and Division has same priority like how adding/subtracting have same priority.

 

Also, I could put in minimum damage, but I have a multihit aspect in the game and I like the idea of multi hits being strong against low defense monsters and single hits being stronger and more able to blast through armor.

 

Hehe... Honestly I usually tend to not really say one way or the other. Like I said, gender is silly. :P

 

Yeah I was thinking (100 - mdef) / 100..0 too at some point. Same result really.

 

And yeah I remembered something about that part way though my post. It's cause I remember the order though PEMDAS, which implies multiplication comes first. I still say interfix notation is dumb though. Prefix and postfix notation make waaay more sense. I like postfix in particular because it's basically stack machine logic.

 

Edit: I am not sure what having a minimum damage of 0 has to do with multihits, I am just saying that if XP doesn't do that already it would be a good idea so you arn't healed by weak attacks.

Edited by Kayzee

Share this post


Link to post
Share on other sites
On 2/10/2020 at 8:53 AM, Kayzee said:

Edit: I am not sure what having a minimum damage of 0 has to do with multihits, I am just saying that if XP doesn't do that already it would be a good idea so you arn't healed by weak attacks.

Ah, I thought you meant to make minimum damage like 5. The default game_battler 3 does include a minimum damage of 0 for damaging skills. I haven't included it yet but it will be included in the edits because I deleted it a while ago because I was going  through dmg  formulas and it's inconvenient to keep re-entering the code to make minimum damage 0 though I recently found a non-inconvenient way at least.

Share this post


Link to post
Share on other sites
6 minutes ago, Kayzee said:

Though I am curious... Why are you using XP anyway? No wait, It's the more flexible map layers isn't it? :P

It's actually the default battle system and RTP art style. I like how skills have User and target animation, etc. Its really the small things that added up and made me go to XP. I plan to draw eventually too, and Ace is a bit harder to copy than XP as far as art style is concerned.

Share this post


Link to post
Share on other sites

Oh I see! I know lots of people like XP's art style better for sure, but I think most people who do nowadays just use XP-style graphics in VX Ace instead. I don't know too much about the default battle system in XP though. In any case, your reasons remind me a lot of why I still use VX Ace and not MV actually. I actually like the VX/VX Ace art style myself, but think the MV art style is pretty bad, and I like Ruby more then Javascript. Also lots of little things also. Everyone has their own preference after all! Heck a lot of people are still using Rpg Maker 2k3 (probobly mostly because it's easier to do pixel art with the lower resolution and they have little need of scripts).

Share this post


Link to post
Share on other sites

RM2000/2003 == good for minimalistic approaches
RMXP == greatest mapping
RMVX/Ace == best implementation of RGSS.

But yeah; since I've had to deal with the unfair burden, I've switched back to XP because the project I have going there I can easily break away from...

Anyway, I like XP's art style and the battle system too.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×