Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Attack Formula (from Toady)  (Read 19153 times)

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Attack Formula (from Toady)
« on: June 19, 2009, 08:04:35 am »

I create this thread so the formula is in the first post. I will add this to wiki this night.

Here I wrote the formula for the attack without the defender wearing an armor (with an armor it's too long, you can do it yourself):
Spoiler (click to show/hide)
This attack is multiplied by 2 if the defender is prone and the attacker is standing.

RND(A) means a random number from 0 to A.
DMG = weapon damage
QLT1 = quality modifier of weapon
MAT1 = material modifier of weapon
STR1 = strength level of attacker
DMBL2 = damblock of defender
TOU2 = toughness level of defender
Also skill modifier applies to this damage.

Now all 1..6 make sense. It means that a creature rolls from 1 to 6 instead of usual (damage*quality*material/10) for a weapon.
For critters as dragons that's size that matters the most.
Thus, giving it 3..12 (as author suggested) is... way too extreme.

P.S. In example of dragons, it's -14 to attack of a dwarf. Thus if the dwarf is not charging and not berserk and has no skill levels and strength, it means that to be able to even scratch a dragon the MINIMUM damage of weapon should be 150... And then it will be a chance (1 of 15) to damage the dragon (and as far as I know, there's no weapon with a damage of 150 in DF without modding -> no chance to scratch a dragon for a farmer).

For the whole explanation from Toady One read this spoiler:
Spoiler (click to show/hide)
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Faenaris

  • Guest
Re: Attack Formula (from Toady)
« Reply #1 on: June 19, 2009, 10:32:01 am »

Thanks for the headsup and explanation, Deon. And thanks to Toady for the numbers in the first place. :)
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Attack Formula (from Toady)
« Reply #2 on: June 19, 2009, 02:04:04 pm »

I didn't say it in the message, but the armor skill modifiers can range from x4 to x2, based on the quality of the skill roll.  This is applied to the damblock.

Oh, and the damblock should also be divided by 10 in the formula (since the raw armor scale is x10 like the weapons).

For the person that asked about dodging (I think in the other thread):

First grab the unarmed skill (this will be changed in the next release).

Then take 0-10 + 0-(skl*5/2) + 0-(skl*5/2).  That's the base roll.  skl is 0 if unskilled, 15 if legendary.

Now we modify the roll.  Minus 0-clunk, where clunk is the clunkiness of inventory (this number depends on the weight and strength).

Then add 0-(agility*10).  Or you would, if the current version weren't bugged.  This has already been fixed for the next one, due to the att rewrite.

Nauseous?  roll/2.
Winded?  roll/2.
Stunned?  roll/2.

Blind?  roll/4.

In pain and not in a trance?  roll/2.

At least tired and not in a trance?  roll*3/4.
At least over-exerted and not in a trance?  roll*3/4.
Exhausted and not in a trance?  roll*3/4.

Somewhat webbed?  roll/2.

Mostly paralyzed?  roll/4.
Just a little paralyzed?  roll/2.

Completely paralyzed, webbed or unconscious?  roll=0.

Using a two-handed weapon without two hands?  roll/2.

Enraged or berserk or throwing a tantrum?  roll/2.


Hit, block and parry rolls are similar.  Weapon skill is used instead of unarmed, but this skill level is modified by the item quality.  At the highest level, skill is sklx2+5, at the lowest level, skill is sklx6/5+1.  So with a masterpiece weapon, a mere proficient fighter is effectively legendary, although the other effects associated to being legendary like higher atts aren't there of course, and I think there are other skill effects here and there that don't get the quality modifier.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Xanares

  • Bay Watcher
  • Cut them all down!
    • View Profile
    • Youtube channel
Re: Attack Formula (from Toady)
« Reply #3 on: June 19, 2009, 02:34:22 pm »

Ahh thanks for this!

and I thought it was going to be complicated  ;D ;D

Easy to see how creature size really rules a lot.
Logged

Leafsnail

  • Bay Watcher
  • A single snail can make a world go extinct.
    • View Profile
Re: Attack Formula (from Toady)
« Reply #4 on: June 19, 2009, 05:49:16 pm »

This looks quite incredible, I must say.  To think that all this happens when you attack... in 90% of games it's just a random number generated that then gets knocked of the opponent's hitpoints.

A few questions:
1. Does "Enraged" have the same bonuses as "Beserk" (although obviously without the whole rampaging thing)?
2. Am I right in thinking that a trance only helps when a dwarf is in pain, tired, over exerted or exhausted?
3. I thought that being on the floor decreased your chance of being struck by a ranged opponent (although it would increase the damage and the amount of arrows they get to fire at you).  Is this at all true?
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Attack Formula (from Toady)
« Reply #5 on: June 19, 2009, 06:55:02 pm »

1.  Yeah, tantruming too.

2.  A trance also removes any unhappiness and the need for food/drink/sleep while it lasts, though this would hardly ever matter.  And my post didn't include the most important thing about trances and all combat skill rolls: effective skill = (skill+1)*5.  This is applied after the weapon modifiers to skill, so everything magnifies obscenely.  A trance also lets the dwarf see when they are blind, and not just for combat purposes.

Also, in case it never came up, dodge/parry/block rolls are simply opposed to the hit roll and the winner wins.  The order is dodge, block, parry, if I remember, so if you have a shield and you see a parry message, that means the other two rolls failed.  You gain skill according to the roll you opposed.

Wrestling is different in general.  Strength and especially size matter a lot more there.  The rules are also applied to charge effects.

3.  Grounded units cannot be hit by projectiles until their "ground effectiveness" kicks in, unless they don't have one in which case they can always hit.  For shots or thrown projectiles, this is the range of the shot (or maybe that -1).  The idea was to have them pass over intervening grounded guys to hit their intended target.  However, people mostly shoot at the closest enemy, so it's mostly for you in adventure mode.  I don't think there are any other modifiers for being prone, though there reasonably should be.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Earthquake Damage

  • Bay Watcher
    • View Profile
Re: Attack Formula (from Toady)
« Reply #6 on: June 19, 2009, 09:37:06 pm »

Shields have a block chance and a block power.  How do those work?

Also, I assume the shield's quality affects skill similarly to weapon quality?

I'm not sure I understand how armor skill works (you mentioned x4 and x2 multipliers?).

Finally, you mention shooting over creatures to hit another.  How does that work?  I've never noticed myself hitting an unintended target when I throw something, with one exception:  If I throw in some general direction rather than at a particular enemy, I sometimes hit an enemy.

I'm finding all these technical combat details quite fascinating, by the way.
Logged

CobaltKobold

  • Bay Watcher
  • ☼HOOD☼ ☼ROBE☼ ☼DAGGER☼ [TAIL]
    • View Profile
Re: Attack Formula (from Toady)
« Reply #7 on: June 21, 2009, 08:44:20 am »

Finally, you mention shooting over creatures to hit another.  How does that work?  I've never noticed myself hitting an unintended target when I throw something, with one exception:  If I throw in some general direction rather than at a particular enemy, I sometimes hit an enemy.

I'm finding all these technical combat details quite fascinating, by the way.
Me too. And you'll hit the wrong target sometimes if you're low-skill, since it'll be going in the wrong direction.

Any chance of getting the critical hits formulæ out of you?
Logged
Neither whole, nor broken. Interpreting this post is left as an exercise for the reader.
OCEANCLIFF seeding, high z-var(40d)
Tilesets

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Attack Formula (from Toady)
« Reply #8 on: June 21, 2009, 03:55:19 pm »

The block chance is the size of the die on your base skill roll.  So a shield is 1-20+all of whatever, and a buckler is 1-10+all of whatever.

The block power is the effect of the shield as a piece of armor on your arm/hand, in case your arm/hand is struck, and it works the same as any other armor.  The upstep is from the grasp.

Shield quality effects the block power as with armor, and it also effects your block rolls as in a weapon attack roll (using your shield skill).

It'll do a simple die skill roll against your armor skill (as a flat number without any randomization, though all of the detrimental effects apply).  You don't get a huge trance bonus here, but it does prevent pain/exertion from lowering your effective skill.  Depending on how well you do, you get a x2, x3 or x4 multiplier to the damage blocking.  It's pretty hard to make these rolls though.  The x2 comparison is beating 0-49, the x3 is 0-99, the x4 is 0-999.  So a legendary will quite often get the x2 bonus, but rarely the x4.  You try the rolls in turn from x4 to x3 to x2, and you stop at the first one you get.  Altogether, kind of a quirky little thing that was thrown in.

Your projectile activates as hitting grounded opponents once it flies past your intended target/target tile.  It can hit intervening standing targets -- it doesn't look like it respects your intended target at all in this.  You cannot hit your buddies (unless you are tantruming).

The crit formulas are highly variable and numerous.  In general, you attach a percentage to the attack given by MIN((hitroll/8 + damage)*2 + agility*5 + 3 , 50).  Then you roll that number against 100 for various effects one by one.  If you have a crit boost on your weapon type, you can reattempt your rolls that many times for certain criticals (general those that involve sticking deep, like a circulatory part shot).  Sometimes a critical also has a damage condition, like the damage from the attack has to be at least 5, in addition to making the roll.  Most of the criticals also have damage type restrictions, such as the inability of burning damage to knock you out on impact.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: Attack Formula (from Toady)
« Reply #9 on: June 21, 2009, 07:03:46 pm »

Are there any differences between Burn and Cold attack types, aside from the combat messages?


You're awesome as always, Toady. Thanks for sharing these arcane secrets with us! I'm definitely donating as soon as I get a job.
« Last Edit: June 21, 2009, 07:09:13 pm by Untelligent »
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Byakugan01

  • Bay Watcher
    • View Profile
Re: Attack Formula (from Toady)
« Reply #10 on: June 21, 2009, 07:13:17 pm »

How does speed enter into this equation? Is it simply the speed in the SPEED token for both land and water, or is the attack speed if the creature is submerged dependent on it's swimspeed instead?
Logged
From Mr. Welch's 1350 things he is not allowed to do in a RPG:
148. There is no Gnomish Deathgrip, and even if there was, it wouldn't involve tongs.
171. My character's dying words are not allowed to be "Hastur, Hastur, Hastur"
218. No matter my alignment, organizing halfling pit fights is a violation.
231. I am not allowed to do anything that would make a Sith Lord cry.
240. Any character with more than three skills specializing in chainsaw is vetoed.

Earthquake Damage

  • Bay Watcher
    • View Profile
Re: Attack Formula (from Toady)
« Reply #11 on: June 21, 2009, 07:22:34 pm »

The crit formulas are highly variable and numerous.  In general, you attach a percentage to the attack given by MIN((hitroll/8 + damage)*2 + agility*5 + 3 , 50).  Then you roll that number against 100 for various effects one by one.  If you have a crit boost on your weapon type, you can reattempt your rolls that many times for certain criticals (general those that involve sticking deep, like a circulatory part shot).  Sometimes a critical also has a damage condition, like the damage from the attack has to be at least 5, in addition to making the roll.  Most of the criticals also have damage type restrictions, such as the inability of burning damage to knock you out on impact.

So why exactly do ranged weapons currently cause so much organ damage (seemingly regardless of damage type, too)?  Do they have an inherent crit boost?  Does the weapon's crit boost affect its projectiles?  Also, does a negative crit boost mean no critical hit rolls at all?
Logged

Leafsnail

  • Bay Watcher
  • A single snail can make a world go extinct.
    • View Profile
Re: Attack Formula (from Toady)
« Reply #12 on: June 22, 2009, 11:32:17 am »

The crit formulas are highly variable and numerous.  In general, you attach a percentage to the attack given by MIN((hitroll/8 + damage)*2 + agility*5 + 3 , 50).  Then you roll that number against 100 for various effects one by one.  If you have a crit boost on your weapon type, you can reattempt your rolls that many times for certain criticals (general those that involve sticking deep, like a circulatory part shot).  Sometimes a critical also has a damage condition, like the damage from the attack has to be at least 5, in addition to making the roll.  Most of the criticals also have damage type restrictions, such as the inability of burning damage to knock you out on impact.

So why exactly do ranged weapons currently cause so much organ damage (seemingly regardless of damage type, too)?  Do they have an inherent crit boost?  Does the weapon's crit boost affect its projectiles?  Also, does a negative crit boost mean no critical hit rolls at all?
Hmm, according to the raws, it would seem ammo doesn't have crits.  I'm guessing it's hardcoded.  I'm guessing the reason why the effects of arrows tend to be more dramatic than the effect of spears is because spears tend to get stuck in before landing a critical blow.
Logged

Qwernt

  • Bay Watcher
    • View Profile
Re: Attack Formula (from Toady)
« Reply #13 on: June 22, 2009, 07:02:16 pm »

Um... only because I am a stickiler...

"15*5=65 pain"  should be "15*5=75 pain"
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Attack Formula (from Toady)
« Reply #14 on: June 22, 2009, 08:11:48 pm »

Um... only because I am a stickiler...

"15*5=65 pain"  should be "15*5=75 pain"

Stickler.
Logged
The Toad, a Natural Resource:  Preserve yours today!
Pages: [1] 2 3