Weapons: how do they work?

Mar 29, 2012, 7:14 pm
#1
Joined: Mar 22, 2012
Posts: 11
I see a lot of threads that end up mentioning good weapon combo's. Usually people will give reasons why they think they are good weapons. But what makes them good reasons is still rather mysterious to me. I also see conflicting advice on some points, like some people claim weight doesnt affect attack "cooldown" others imply that it does.

Could anyone here explain the "formula" for how exactly the weapon damages your opponent and how often? What about parrying enemy blows?

More specifically:

Does armstrength increase the damage per blow? Or the blow cooldown?
Does weight influence those?
What determines the chance that your weapon will break enemy equipment?
What determines the distribution of your blows over parts of the enemies body?

Did you people actually make some precise calculation to come to your preference in weapons, or was it a kind of trial and error process?
Mar 29, 2012, 9:26 pm
#2
Joined: Dec 3, 2007
Occupation: Chaos Weaver
Location: Standing between all life and death
Posts: 2,825
No, we've had some people code-dive to find out the exact formulae. Here's some combat equations I've saved for a side-project which is currently on hold:

The strength requirement of an item is: 1.25 * 10^-10 * Weight ^ 2 * Size ^ 2

The hit strength of a weapon is: (Arm Strength) - (Strength Requirement) If you're dual-wielding, use combined arm strength and half the strength requirement.

Weapon skill bonuses are equal to: 1000 + 50 * (Skill Level)

Any weapon or armor's THVBonus (To Hit Bonus) is: Enchantment * 0.5

Move Ease is based on burden state: OverLoaded = 50 Stressed = 50 Burdened = 75 Unburdened = 100 Anything Else = 666 (Yeah. Shouldn't actually happen.)

Your to-hit-value when unarmed is: Dexterity * sqrt(2.5 * perception) * (Move Ease) * (Unarmed skill bonus) * (10 + Gauntlet's THV Bonus) / 5000000

Your to-hit-value when armed is: If the hit strength of your weapon is 0 or less, 0 If your weapon's hit strength is less than 10 but over 0, pretend it was 10. Base = 2 * 10 ^ -11 * (Weapon's hit strength) * (Weapon class skill bonus) * (Specific weapon skill bonus) * (Move Ease) * 10000 / (1000 + weapon weight + (enchantment / 2)) ThisToHit = dexterity * sqrt(2.5 * perception); And your to-hit-value is ThisToHit * Base. There are, however, special cases, if your other arm is usable. If your other arm has no weapon, and the first arm's weapon is two handed and not a sheild: Add (other arm's dexterity) * sqrt(2.5 * perception) to ThisToHit. Then divide ThisToHit by two. If your other arm does have a weapon, and neither weapon is a shield: Divide ThisToHit by 1 + (500 * (Arm2's weapon weight)) / (1000 + (Arm1's weapon weight) / 2)

The blocking modifier of a weapon is: Size * Roundness * 2. Multiply by an additional two for shields.

Blocking value is: ToHitValue * Block Modifier / 10000

The blocking capability of a weapon: If you have no weapon or our weapon's hit strength is 0 or less, then 0. If you're still here, pretend your weapon's hit strength was at least 10. Blocking Capability is (hit strength) * (weapon's strength) * (weapon skill class bonus) * (specific weapon bonus) / 10000000

For each arm you block with: BlockStrength = GetBlockCapability BlockValue = GetBlockValue if either of those are 0, do nothing and give up on this function

you'll block if: RAND() % int(100 + WeaponToHitValue / BlockValue / (1 << BlocksSinceLastTurn) * (100 + Success)) < 100) if you don't, give up on this function new damage is damage - blockstrength. Minimum is 0. lose (10000 / Arm Strength) stamina gain some strength based on the weight of the item you blocked with. gain some dex based on some crazy crud I can't be bothered to figure out (long DexExp = Weight ? Limit(75000L / Weight, 75L, 300L) : 300 if you're dual-weilding, do that same experience for both arms receive some skill in your weapon based on relative strength of who you blocked the item you blocked with recieves damage equal to the ORIGINAL damage before block

if what you blocked was an item (I THINK, could just be still existing) it recieves damage equal to the difference between original and new damages if your blocks since last turn isn't 16 yet, add one to that count.

Dodging attacks: if the attacker can't be seen by the target, double ToHitValue if the target can't be seen by the attacker, double DodgeValue if the attacker is confused, multiply ToHitValue by 0.75 if the attacker is fainting, halve ToHitValue if the attacker is exhausted, multiply ToHitValue by 0.75 if the target is fainting, halve DodgeValue if the target is exhausted, multiply DodgeValue by 0.75

If it's going to be a critical, target won't dodge. If it's a forced hit, target won't dodge.

Chance of dodge is: RAND() % int(100 + ToHitValue / DodgeValue * (100 + Success)) < 100 A comment in the source says this means: /* Effectively, the average chance to hit is 100% / (DV/THV + 1). */ Successfully dodging attacks trains agility and perception (twice as much agility)

Damage is boosted Success percent. (100 damage, 4 success = 104 damage). Two thirds of the time, one more point is added to damage. A critical hit adds an extra half to damage, then adds one more point.

!!! BodyPart = ChooseBodyPartToReceiveHit(ToHitValue, DodgeValue)

Only can block if it's not a critical, and it did damage, and this attack is blockable If you're doing something, you won't block (I think that's what that line means.)

If you have something in your right hand, it'll try to block with it. If there's still damage, you have something in your left, and (I think) there's still a weapon to attack you with, you'll block with your left.
Mar 30, 2012, 12:59 am
#3
Ischaldirh's avatar
Ex-Tyrant of the IVANers


Joined: Dec 8, 2007
Occupation: Junior Specialist Researcher
Location: California
Interests: (Astro)Physics, Exoplanets, Singing praise to Valpurus while smashing skulls with a bloody warhammer, Jogging
Posts: 2,831
I'll try to provide a tl;dr veresion:

wishcraft wrote
Does armstrength increase the damage per blow? Or the blow cooldown?

It increases damage and to-hit, up to Str.Requirement +10 AStr. I don't know if code-diving ever determined attack speed; that may be Dexterity and/or Weight related. Take that with a grain of salt.

Quote
Does weight influence those?

Weight does affect all three attributes of a weapon (+raw power, -attack speed, -accuracy).

Quote
]What determines the chance that your weapon will break enemy equipment?

Damage. If you're hoping to break a weapon, first they have to block with it. (It may be possible to break an attacker's weapon too.) Otherwise you just have to hit that body part, and if you deal enough damage (vs the item's material) it can break. Note that your weapon doesn't deal full damage to the item. If I'm recalling the code correctly, only rand(50-100)% of the item's armor value actually applies, and any damage above that is dealt to the person underneath and to the item itself. Not sure on the code for the item actually breaking, however.

Quote
What determines the distribution of your blows over parts of the enemies body?

Accuracy and (mostly) dexterity. High dexterity helps a lot with this; you will notice that a low-dexterity person with a two-handed sword will mostly land body blows (which is where most of the HP is located) while a high dexterity person with a whip, such as Shererax, will consistently remove legs, arms, and heads.

Quote
Did you people actually make some precise calculation to come to your preference in weapons, or was it a kind of trial and error process?

My weapon preferences are mostly flavor-based, in all games. I like big, heavy weapons, so I tend towards the large swords, maces, halberds, etc. The (well founded through trial-and-error) general community trend however is towards dual-wielding smaller weapons, such as short swords and whips. These afford many rapid, accurate attacks, which train dexterity and are likely to dis-assemble enemies from the arms in. Torsos aren't very threatening.
Mar 30, 2012, 3:16 am
#4
Joined: Mar 22, 2012
Posts: 11
Whow, that is a lot of information, thank you. What about attacks per time unit tho? Doesnt that vary with weight and size of weapon as well?
Mar 30, 2012, 3:58 pm
#5
Joined: Dec 11, 2008
Posts: 1,770
I'm reasonably certain that attacks per time unit are affected by weight and size too.

For example, one solid strike with an unwieldy heavy battle axe could do one attack per 2 hedgehog bites, whilst a whip could do upwards of 2 per hedgehog bite.
Only an example, I have no idea what the exact numbers are that determine it.

Also, kicks take significantly more time to strike than most, if not all weapons. I've been attacked six times in a row by a kobold whilst attempting to kick it.
Mar 31, 2012, 12:02 am
#6
Ischaldirh's avatar
Ex-Tyrant of the IVANers


Joined: Dec 8, 2007
Occupation: Junior Specialist Researcher
Location: California
Interests: (Astro)Physics, Exoplanets, Singing praise to Valpurus while smashing skulls with a bloody warhammer, Jogging
Posts: 2,831
wishcraft wrote
Whow, that is a lot of information, thank you. What about attacks per time unit tho? Doesnt that vary with weight and size of weapon as well?


Ischaldirh wrote
Weight does affect all three attributes of a weapon (+raw power, -attack speed, -accuracy).
Jump to