Miss Dodge Hit Calculation Problem

Started by
24 comments, last by Talin 16 years, 3 months ago
Well all this thread is going to be a pile of %Tohit formulas, thank you all very much, but I think we've solved that. Nevertheless I'd like another question to ask, when the Defender and Attacker are equal, what should their chances of success be %ToHit and %ToDodge? Currently it's a 50% for both. But I mean in reality, what is a chance for a Blind Guy to hit a Tree? Given no exact coordinates and just putting him in front of a tree would he really have a 50% chance to hit it? I know that this gives way to a lot of other factors (Sword length, arm length, etc.) But I tend to think that the guy's chance to hit should increase over time, that is, the guy who'll keep swingin on forever should hit the tree eventually. So since my attack sometimes has several hits, I think the %tohit chance should be modified by something like %TOHIT = %TOHIT + %HitsMissed. What do you guys think?

EDIT: Hmm.. Now I think I realised that it's a bit idiotic, because in combat none of the participants are Immobile and giving an attacker a higher chance to hit because he missed a few hits does not make much sense, well anyway, I'm waiting for someone else's opinion.
Advertisement
There are ways of having something like that make sense. I would do it like this:
%base_hit * (5 + #misses since last hit)/5
And display the information on the screen as a "rage meter."

Alternatively, you could have a "fatigue" mechanic that does the opposite.

Note that these sorts of mechanics will lead to counterintuitive strategies. This may be a good thing or a bad thing.
My game's text based :>
The suggestion to cap the values comes mainly from the side of the attacker and as a benefit to them. In melee range, you shouldn't miss much. But if the values for the equation I gave aren't capped/floored then really high defense values or really high accuracy values will make missing 100% of the time possible and hitting 100% of the time possible.

Capping/flooring it would mean that you can't completely negate defense and accuracy of opposing players / foes.

Of course if a target has no defense, then a 100% hit chance is understandable with high enough accuracy.

In practice, with that equation capped at 95% chance to hit, you rarely get hit as the defender if you can have 45% defense.

The cap/floor may not even be an issue if you keep accuracy and defense values moderate. You could probably manage to keep it 80/20 in either direction.

Also if, as you said, range makes a difference to you ; just add some kind of range modifier to the basic equation.

Instead of (1+acc%) * (50-def%) add in a range factor like :

(1+acc) * ((50* (1+range mod)) - def)

have range mod be a % of the range, so if a ranged attack has a range of 10 feet and you are 1 foot away, you get a 90% bonus to your chance to hit (1.9 * 50 will mean you almost never miss)

That would make melee attacks far more accurate than ranged attacks, but also means a defender has very little in the way of safety in most cases.
Well as far as if the attacker and defender are equal, then yes a 50% chance to hit is fine, if you add some defense debuffs or accuracy buffs to some attacks. This means that once a hit lands, more will start to land soon thereafter.

As for constant missing,just decide how many misses in a row are 'too many' and force the next hit to automatically land.
Quote:Original post by snarles
... Still, I would rather use "critical hits" to increase the luck factor in games, as missing lots of attacks simply leads to frustration for the player.


This sentence is very important, many people do not even consider frustration in game making, it is one of the main reasons why people stop playing any game.
Critical hits would definitely be a better choice, I would completely avoid misses if possible and instead introduce glancing blows(50% damage or similar).
Only if you really need these events though.

Better still would be to try and use special charasteristics of weapons/units/items to make effective ranges and make those scale depending on the range. In a semi-complex game the end result is the same but the player may put the odds in their favor by playing their own way. A huge difference to just hoping to crit or not miss, or any defensive chance based event.

Example:

Ranged - 100m 200m 300m 400m 500m
Weapon Uzi: 100% 80% 60% 20% no reach
Weapon Ak47: 100% 100% 100% 100% 80%

Melee - 1m 2m 3m 4m 5m 6m
Weapon Sword 100% 100% no reach
Weapon Spear 0% 50% 100% 100% 100% no reach

Add in different shape,ammunition,alloys etc to somewhat change the ranges and characteristics. Weaknesses vs some alloys, thresholds of tolerance, breakpoints.. there are alot of variables to be considered, and are much more intuitive than a straight up % chance.
Minimize or eliminate the amount of and magnitude in the chance based events, such as crit, miss, dodge, parry. Nobody likes to roll the dice in games really if they could rather plan ahead and customize for themselves. There are other aspects of this but bottom line is what it is.
Chance based events should never be preferred IMO, IMHO very bad. Versatility and variety is key.
Well my equations have again been reformed, now I'm using the exponent instead, now chances of success are something like this beetween even players:

Unarmed Attacker
~95% To Hit
~15% To Be Dodged
Melee(With something in hand, you can call it Armed, I guess.) Attacker
~85% To Hit
~20% To Be Dodged
Ranged Attacker
~60% To Hit
~10% To Be Dodged
I've tested this a few times and I rarely see a Dodge and almost no Misses this made battles a bit quicker,but currently their low-hp-newbie-cat-fights so they sort of have to be quick.
I've also taken in to account that although Ranged(Bow,Gun) attacks are harder to land they are also harder to dodge.

To ColeFreeman: I like the idea of 'effective range', but currently my combat system does not support any landscape, environment, thus making range values impossible, I cannot say I will not implement movement in combat, but currently it's picking out what to do(defend,evade,collide,use that,throw that, etc..) in the given situation, sort of thing.
Also I've already started thinking about something like Weapon Material vs Armor Material = Damage Effectiveness, currently though I have no Idea what alloys should be better/worse when opposed to others. Ideas like different techniques vs different armor also come to mind, like Sword-Slashing vs Metal Platemail < Hammer-Crushing vs Metal Platemail.
When you think about it, there is only one difference between an attack string going "miss-miss-miss-miss-miss-killing blow hit" and "hit-hit-hit-hit-hit-monster dies". And the difference is that in the second example, player can actually feel/see the progress he is making in the battle - it's a hit, so it must mean the monster is down a few HP, which means the player is one step closer to a victory. If he keeps missing, the player feels he isn't making any progress - in fact, he's just waiting for that one decisive lucky roll.

That said, I still dislike having battles in which a player keeps hacking an enemy with a battleaxe, damaging him over and over again until the HP drops to 0. It's still very linear, and you can never fully ignore the fact that no humanoid is likely to (ever) get up after being hit by a battleaxe once.

What you could do (and I did :p) is implement a "concentration" category. There are no actual misses, attacks are parried and dodged by the defenders instead, and concentration level is used to determine the defender's ability to dodge and parry attacks.

Every single attack damages the defender's concentration - the defender dodges or parries the attack and suffers no physical damage, but his concentration drops. So the player still makes notable progress with every roll. As the defender's concentration drops, attacker's chances for landing a "critical" blow that physically damages the defender increase. One such blow with a heavy/blunt weapon would usually be enough to kill or disable an average human.

It allows you to balance the duration, fun factor -and- realism of the battle in a way that would be logical given the characteristics of combatants and their weapons, with rather simple base rules.

(You can decide yourself the rules for concentration damage, and if / how fast the concentration regenerates during battle. Both these things depend on the rest of your game's mechanics - character abilities, classes, skills and the like)
That's an interesting idea. What you could do is let each unit have a "concentration" value starting at 100%. Attacks may have low hit rates like 20%, but if they miss, you subtract the attacker's base hit rate from the defender's concentration.
The hit formula would be:
%hit = attacker's %base_hit/(defender's %concentration * defender's %evasion)
Concentration resets to 100% whenever a unit takes damage.

What this system effectively does is replace "critical hits" with normal hits (which can be quite powerful, sometimes on the order of one-hit or two-hit kills depending on accuracy.) And even though most of your attacks will miss, the random factor is reduced because you can always get a guaranteed hit after multiple attacks.

It also encourages having a team with varying accuracies of attacks. For example a team with several 100% hit archers and one 10% hit axeman would not be very synergistic, since the archer would always reset the other units' concentration to 100%, making it hard for the axeman to hit. However, a team with a 100% hit archer, 30% hit spearman, a 40% hit horseman, some 20% hit swordsmen, and a 10% hit axeman could distribute their attacks to allow the axeman to hit frequently.

With this system it's also easy to implement special attacks that only reduce concentration, or that don't reduce concentration, or that modify your own units' concentration. For example a Mage might have an ability called "Charge" that costs 50% concentration, but that doubles the damage he deals the next turn. Soldiers might have a "Focus" ability that restores +10% concentration.

[Edited by - snarles on January 3, 2008 9:37:59 AM]
The number crunching and formula tweaking is really a matter of personal preference. It's basically fine-tuning battles to get what -you- really want them to be like - more luck based, less luck based, longer, shorter, etc. and fit them into your setting.

What the feature essentially does is substitute the classic "healthbar" concept and its importance. Health is pretty much a last barrier between life and death - not a resource to be expended. Whereas concentration* takes over the role of determining advantage in battle.

It also adds another dimension to the otherwise linear battles. When the concentration reaches low levels, any next hit could be fatal - maybe it will happen next turn, maybe not for another 3 turns. It adds risk and tension in closely matched battles, while still being predictable enough and allowing the combatant to withdraw from a dangerous situation on time.

Finally, it reduces unnecessary abstraction and some rather absurd situations like having to hack at some poor creature over and over again, slowly reducing its health, or rely on pure luck to hit a critical.

* - come to think of it, "concentration" might not be the best name for this. "Fatigue" or "Guard" might be more suitable, but english isn't my first language so I'm not sure which term describes it the best.

This topic is closed to new replies.

Advertisement