New account registration is temporarily disabled.

CRITICAL DAMAGE FORMULA?

Posts

Pages: 1
I was wondering if it were possible to manipulate the formula to determine critical hits and the damage they cause. I am very much not a fan of the flat Double/1.5x multiplier for critical hits, preferring instead a more dynamic rate of damage. In particular, the damage formula I wish to use for critical damage is this:

((offense - (defense * (1-(CV/100))) / 2 ) * (1 + (CV/100))) + CV

Where CV = Attacker's Level / 3

As you can see, it's based on the attacker's level - thus, as the character levels up, the critical damage bonus they get rises as well. Is it balanced? Not quite sure. The flat numbers seem fine, but what I really need is a field test against mock enemies... and in order to do that, I need to not only be able to manipulate the formula itself, but also the critical rate.

Between my approach and whether it's possible to do with RPG maker, I'd appreciate your thoughts very much.



Edit: Ack, I think I put this in the wrong forum - I can't seem to report my own posts, so I suppose I'll make the request here - could a mod move this to the correct location? I had thought I was in the Discussion and Development forum.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
It should be in the help requests forum, actually! Or maybe the programming forum. (Which should really be merged into the help requests & resources forum, because every single topic in there is a help request or resource.)

Question #1: Which version of RPG Maker are you using? We do kinda need to know that.

Question #2: Are you already using a custom battle system? Most big custom battle systems end up replacing almost every piece of combat code in the entire engine, so the way to change things like crit rates can be very different (and often they have built-in ways to do so).

Although since you posted this in game design & theory, I'll give you some game design & theory too. There are two major problems with this formula:
1) Higher defense causes the damage to increase. This is obviously not intended!
2) In the first half of the equation, you subtract CV, meaning higher CV = less damage. But then you multiply and add in CV again later, so it gets complicated. If defense is high enough or attack is low enough, though, CV will actually cause the crit bonus to decrease with level instead of increase. Also clearly not intended!

((30 + 67.5) * 1.1) + 10
((30 + 60) * 1.2) + 20

Which leads me to Question #3: What's your normal, non-critical damage formula?
Question #4: How much crit bonus do you want at level 1, and how much at your max level? And what is the max level in your game?

From those two questions I can at least give you a formula that'll work, though someone else might have to find a script for you.
I'll be using RPG Maker VX Ace, per suggestion.

@Higher Defense: Actually, yes. Yes it is. The whole idea behind what a critical hit is is that you're striking a weak spot - a chink or weakness in the armor. As such, on heavily armored foes, a critical hit is much more devastating than on a squishy foe.

The idea here is a threefold setup:

With CV as a value based on the attackers level:

Ignore an amount of the target's defense by CV%
Multiply damage by an additional CV%
Deal an additional CV% for good measure.

If I wrote it down wrong... it's because I've always written it in prose, rather than formulaic. Sorry about that.

@Battle System: My battle system will indeed be a custom one and is actually heavily influenced by the Golden Sun series. I seek to have it be a sort of strong evolution of that system. However, past that core system, that's where things change much more drastically, particularly in terms of how the game is balanced. Things are done much less by whim and much more formulaic in terms of balance. Summons are just flat out changed to act as actual legit summons rather than glorified spells. Weapons... are heavily changed so that weapon choice is more than just "higher attack power" - each weapon type serves a purpose and has its pros and cons.

Base, Non-critical formula is this:

((Attacker Offense - Target Defense) / 2 ) * (1 + (Power - Resistance) / EVal))

Offensive stats can be:

Attack
Casting
Agility

Defensive stats can be:

Defense
Warding

Power and Resistance are specific to the element of the attack being used (and as some weapons deal elemental damage, it is necessary to add this). If the attack/ability is non-elemental, this check is ignored.

EVal is a value that depends on the skill being used. These values are:

400 for Physical damage
300 for whatever I decide to use as a djinn analogue
200 for raw Psionic damage


Critical Damage is based on two things - Level, and Critical Might. Critical Might determines what percentage of the Attacker's level is used in the formula (and thus, determines the Critical Value), and is based on the currently equipped weapon (so some weapons will do more than others).

For testing, I want to use a 33% value for Critical Might before I start playing around with it more, to see what range of values seem balanced and for what levels. I don't expect this formula to be the final one I work with, just the one I start with.

If you were wondering, the crit formula for GS was:

final damage = ((base damage * 1.25) + (target's level / 5) + 6)

Where base damage is the equation I posted at the beginning of this post. Yeah, for some reason, it uses the Target's Level to determine damage, not the attacker's level... I never understood that, so I'm gonna just use a much different philosophy. The way I see it, an inexperienced fighter won't see much influence from a critical, while a master of combat can exploit it for all they're worth. Thus, the formula I provided that heavily scales with level. The question is, does it scale too much or too late, or...? Well, that's what testing is for.
Why would you want CV to cause the attack to ignore an amount of defense? Since the target's defense adds to the damage you deal, ignoring a percentage of it means you deal less damage than you'd otherwise do. This means that against high defense targets, you want weapons with a low Critical Might so you don't ignore too much of it.

Are you sure the first "+" in your formula shouldn't be a "-" instead?
Ah, that's what he was talking about. Sorry, didn't realize I had typoed that. I thought Locke was talking about the defense piercing aspect of the formula. Thanks for clarifying it.

Thanks for catching it, though I'm sure you knew what I meant to type, especially since a more accurate incarnation of the basic part of the formula was posted in my vary next post. I'd love to hear your impressions on the intentions, as well as a little bit of teaching as to how I might implement it.
The critical hit starts with doing double damage before defense is subtracted. This can be all from a good boost to overpowered depending on the defense of the enemies. That said, a critical hit already sort of pierces 50% of the enemy defense at CV 0, so the extra defense piercing you get with additional CV won't matter much unless the enemy has such a high defense that you wouldn't want to use a physical attack to begin with.
At CV0, no extra damage should be done. At CV1, 1% of the target's defense should be ignored, the base damage inflicted needs to be multiplied to 101% of the original value, and an extra 1 damage dealt on top of that.

If defense piercing occurs with CV0, then I don't think my formula has anything to do with it, and that means it's built in to VXA. Which also means it needs to be gutted without mercy. A tool that doesn't give me proper control over my system must be corrected so that it does - please assume that all formulas given here follow that, and that what I'm really looking for is


In case you didn't see it right, how damage works is:

(Attack - Defense) / 2

So half the difference between attack and defense. A critical hit will change the defense to this:

(Defense * (1-(CV/100))

Which modifies it to reduce the defense by a percent equal to CV. It also does this:

((Attack - Defense) / 2) * (1 + (CV / 100)))

Which gives a multiplier based on the CV, which if it is 7, multiplies the above by 1.07 (or 107%). Finally, it also adds a bit of additional damage at the end.

((Attack - Defense) / 2) + CV

So if CV is 7, then it does 7 extra damage. Putting it all together:

(((Attack - (Defense * (1 - (CV / 100)))) / 2 ) * (1 + (CV / 100))) + CV

So if the Critical Value is 7, then 7% of the enemy's defense is ignored, the attack does an additional 7% damage, and the attack does an additional 7 damage on top of that. So, plugging in values, let's assume the values of 200 attack, 120 defense, and a Attacker Level of 22. This gives us a CV of 7, as given in the example above. Final decimals will be floored after the equation, but count during it.

(((Attack - (Defense * (1 - (CV / 100)))) / 2 ) * (1 + (CV / 100))) + CV
(((200 - (120 * (1 - (7 / 100)))) / 2 ) * (1 + (7 / 100))) + 7
(((200 - (120 * (0.93))) / 2 ) * (1.07)) + 7
(((200 - (111.6)) / 2 ) * (1.07)) + 7
(((88.4) / 2 ) * (1.07)) + 7
((44.2) * (1.07)) + 7
(47.294) + 7
54.294
54

Whereas standard damage would be:

(Attack - Defense) / 2
(200 - 120) / 2
(80) / 2
40

To me, this is much more preferable than dishing out 80 damage because of some arbitrary decision that criticals always double damage. As for why it doesn't just ignore defense, I have three types of damage enhancing skills in the game:

  • Added Damage
  • Damage Multiplier
  • Defense Piercing

I wanted to do something that incorporates all three of them but in a balanced manner - thus the lower values for CV. And as I want it to reflect the strength of the character themselves, rather than just some static value, I used the Character Level to determine the CV itself.


The trick is, I've gotta find out how to modify VXA to give me much more control over variables, because from what I've seen so far all I can manipulate are the Core and Vitals stats. There are some other things I can alter and tweak, but the really in-depth stuff I don't yet have access to, and that's where most of the work needs to be done.
Then your original formula is still wrong. Due to the way you set up your brackets, the /2 in your formula applies to target defense, but not attacker's attack, hence the unintended x2 damage and 50% defense piercing.

Anyway, now that I know how your formula is supposed to work, critical hits looks rather underwhelming to me. In your example, you're gaining a 35% damage boost which is rather small. It will be better at higher levels, but there's a risk the earlier levels teaches the player that critical hits isn't something worth paying attention to. I think you should tone down the impact levels have a bit. Perhaps you could change "attacker's level" to "(attacker's level + 40) / 2" or something like that? Using your example, the final damage would then be 60, which is a 50% boost compared to a non critical hit, still rather low to be honest.

I have no idea how hard this is to implement as of now. I haven't looked at how the script handles critical hits yet.
That's because critical hits exist on top of another, similar entity called Unleashes. As I have mentioned before, this is heavily inspired/based on a game called Golden Sun, which essentially had two different types of critical hits.

The first is the standard type of critical hit native to all weapons. Oddly, it uses the target's level to determine damage.

The second is known as an Unleash. Unleashes aren't critical hits in the same manner as you'd normally think of them - they're full on abilities that trigger with the attack command. Unleashes and Criticals have a similar chance of being triggered, though it is the Unleashes that take priority. Furthermore, there is gear that exists that can increase the odds of these occuring - the original GS games allowed up to a 99% unleash rate. I plan to nerf that down to no greater than 60%, as well as some other alterations.

Do I expect people to care about criticals early on? Oh, heck no. The unleashes are what shine here, and the critical hits are more of a supplemental thing - a kind of middle ground between a standard attack and an unleash.


Furthermore, the Level Influence of the Critical Value is determined by the currently equipped weapon. A dagger, for example, won't use 30%, but 40-45% of the level, while an axe may only use 20-25%. The system is not simple, no, and I now believe I have to custom build the setup for it. None of the scripts I've seen do anything close to what they need to do...

I need to allow for much more involved stat manipulation and determination.
I need to allow for much more in-depth damage formula manipulation.
I need to be able to designate areas of 3, 5, 7, 9, and 11 targets.
I need to be able to designate the magnitude of spells, so I'm able to control how damage diminishing works from the center target.
I need to set up a GS-style class changing system, where the equipped modifiers determine class. However, it needs to be independent of Elemental Affinity, unlike the original GS games.
I need to designate new stats, period, that don't exist natively.
I need to change it so that stats are assigned to characters, not classes, and that classes give a multiplier to stats.

I need to pretty much overhaul the hell out of the thing. So to answer your last line... the answer seems to be "Hard as balls without a team". Especially for someone who's last programming class was AP CompSci II back in 2004.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
Sorry, I lost track of this topic.
@Higher Defense: Actually, yes. Yes it is. The whole idea behind what a critical hit is is that you're striking a weak spot - a chink or weakness in the armor. As such, on heavily armored foes, a critical hit is much more devastating than on a squishy foe.
No, this isn't what you want. Currently what you have is:
-Normally, the enemy does 500 damage to you when it crits.
-You buy new armor, or cast a protective buff on yourself, improving your defense.
-Now the same enemy does 600 damage to you when it crits instead. What the fuck?

Crits piercing defense is perfectly fine. Crits making it so defense has a reverse effect is absolutely not not not not fine. Improving your defense should not make you less likely to survive, what the hell!

What you actually want is defense piercing to occur on crits. Crits will effectively ignore a portion of the target's defense, going through their armor as if it weren't there. But they don't take more damage the more armor they have on! They just don't take less damage like usual.

((Attacker Offense - Target Defense) / 2 ) * (1 + (Power - Resistance) / EVal))

OK, here's a critical damage formula that works like you want: critical hits pierce the target's defense, and pierce more of it the higher level you are.

((Attacker Offense - (Target Defense / (2 + Attacker Level / 10))) / 2 ) * (1 + (Power - (Resistance / (2 + Attacker Level / 10))) / EVal)) * (1 + (Attacker Level / 100))) + Attacker Level

See what I did? Defense and Resistance are both divided by (2 + Attacker Level / 10). So at level 1 the target's defense is halved on a critical hit, at level 20 the target's defense is divided by 4 on a critical hit, and at level 100 the target's defense is divided by 12 on a critical hit. This should suit your needs and be a lot easier to balance for.

Dividing the target's defense instead of subtracting from it will work better - it'll mean there's more benefit against enemies with higher defense. For example, if you're level 40, you're piercing 80% of a target's defense, which means a target with 50 defense will lose 40 of its defense during a crit, but a target with 200 defense will lose 160 of its defense during a crit.

Then, like you said you wanted to do, I multiplied damage by an amount based on your level, and then added an amount for good measure, though I'm not sure that last part is strictly necessary.

Mucking with damage formulas is one of the easier things to do in scripting, so you might be surprised how much of this you can do yourself, especially if you've ever tried to learn any kind of programming language before. Damage formulas are how I first learned RGSS scripting, in fact. Just opened up the scripts, started looking around for damage formulas, and started editing them and trying to make my edits work.
Pages: 1