Would someone be awesome and do the forum archeology to find out how speed_bonus and the 2 damage_speed_powers are calculated? I'm guessing math.pow() raises the first argument to the power of the second, so this multiplies raw damage by d_s_p to the s_b power. This will have huge effects on damage, and if it includes missile projectile speed, may well be the decisive factor in choosing a bow, but I need to know the math on how it works. So if someone could run down the code from a dev post somewhere while I wrestle with the other stuff that'd be worth at least one virtual beer.cmpxchg8b said:Code:if weapon_type == 'one_handed' or weapon_type == 'two_handed' or weapon_type == 'polearm': raw_damage *= math.pow(melee_damage_speed_power, speed_bonus) elif weapon_type == 'crossbow' or weapon_type == 'bow' or weapon_type == 'throwing': raw_damage *= math.pow(missile_damage_speed_power, speed_bonus)
else:
raw_damage *= proficiency * 0.01 * 0.15 + 0.85
if weapon_type == 'bow':
raw_damage *= min(power_draw, difficulty + 4) * 0.14 + 1
if mounted:
raw_damage *= horse_archery * 0.019 + 0.8
if raining:
raw_damage *= 0.9
elif weapon_type == 'throwing':
raw_damage *= power_throw * 0.1 + 1.0
if mounted:
raw_damage *= horse_archery * 0.019 + 0.8
elif weapon_type == 'one_handed' or weapon_type == 'two_handed' or weapon_type == 'polearm':
raw_damage *= power_strike * 0.08 + 1.0
raw_damage += strength / 5.0
if (weapon_type == 'two_handed' or weapon_type == 'polearm') and (has_shield or mounted):
raw_damage *= 0.85
if weapon_type == 'polearm':
raw_damage *= 0.85
if weapon_flags & itp_two_handed:
raw_damage *= 0.9
raw_damage = clamp(raw_damage, 0, 500)
armor = appropriate_armor_value_for_hit_location
if hit_shield_on_back:
armor += shield_resistance + 10
soak_factor = armor * module.ini_soak_factor_for_damage_type
reduction_factor = armor * module.ini_reduction_factor_for_damage_type
if item_flags & itp_extra_penetration:
soak_factor *= module.ini_extra_penetration_soak_factor
reduction_factor *= module.ini_extra_penetration_reduction_factor
randomized_soak = (random.random() * 0.55 + 0.45) * soak_factor
randomized_damage = (random.random() * 0.1 + 0.9) * raw_damage
soaked_damage = randomized_damage - randomized_soak
if (soaked_damage < 0.0):
soaked_damage = 0.0
randomized_reduction = math.exp((random.random() * 0.55 + 0.45) * reduction_factor * 0.014)
reduced_damage = (1.0 - 1.0 / randomized_reduction) * soaked_damage
if (reduction_factor < 0.00001):
reduced_damage = 0.0
damage_difference = round(reduced_damage + randomized_soak)
effective_damage = randomized_damage - damage_difference
if hit_bone == head:
effective_damage *= 1.2
if item_is_ranged:
effective_damage *= 1.75
elif hit_bone == calf or hit_bone == thigh:
effective_damage *= 0.9
effective_damage = clamp(effective_damage, 0.0, 500.0)
Unless the code for that is posted elsewhere, the indentation on the chunk we have indicates that it's not subordinate to any parent ifs about weapon type. Dunno.Huscarlton Banks said:I don't think the game gives any ranged weapons holding bonuses.
Read off wrong column from spreadsheet, mea culpa. Will edit.The holding bonus itself gets multiplied by 0.5 before being added to 0.5, so the max bonus you can get from it is 25%.
Yup Will fix that too.You missed a decimal on the horse archery, you need 0.2 total to get to even footing with unmounted archers, each point only gives 0.019, so at 10 HA you are just barely under an unmounted archer.
PoP said:armor_soak_factor_against_cut = 0.9
armor_soak_factor_against_pierce = 0.75
armor_soak_factor_against_blunt = 0.7
armor_reduction_factor_against_cut = 1.1
armor_reduction_factor_against_pierce = 0.75
armor_reduction_factor_against_blunt = 0.70
Native said:armor_soak_factor_against_cut = 0.8
armor_soak_factor_against_pierce = 0.65
armor_soak_factor_against_blunt = 0.5
armor_reduction_factor_against_cut = 1.0
armor_reduction_factor_against_pierce = 0.5
armor_reduction_factor_against_blunt = 0.75
Except for the fact that you can get 75 of pierce in Pop but only 45 of blunt IIRC. Hence my nerdly obsession with figuring out all the mechanics and creating these tables. I only want to equip my CKO one time, with the best.Huscarlton Banks said:Blunt damage seems to always be superior to pierce damage in PoP. In native, pierce tends to win out once you get past ~60 damage.
So, a table of damage for all of PoP projectile weapons (according to the wiki, there are a few from the latest patch still missing), with power draw/throw of 10 but no WPF, STR, target armor, etc.,Pode said:I'm going to assume that both melee and missile speed damage bonuses work from the general form of damage = base damage * (impact speed/reference speed)^damage_speed_power. This fits physics (well, if the 1.9 for missiles was actually 2.0 for both, but eh) and my game observations reasonably well. It also allows us to explain some game effects I've never seen explained anywhere else, more on that in a follow up post.
So for missiles, the reference speed is obviously the missile weapon's initial launch speed, the hidden projectile speed stat. Current speed is a function of the relative motion of the shooter and target (bugged, as discussed above), launch angle, ballistics, and aerodynamic drag. For balancing purposes, we want to hold all that constant. The easy way is to assume knife fighting range, where there is no loss of speed due to drag, the ratio becomes 1, and there's no bonus to damage. Problem is that except for possibly doing ladder defense, that's not how you use ranged weapons.
There exists some range where the drag has reduced the horizontal speed of a shot from a bow to zero. (Still some vertical speed due to gravity, but pulling off such a shot is pretty much blind luck so let's ignore that.) If we take the slowest bow in game and subtract it's projectile speed from the speed of all the others for our balancing, now we're doing a comparison at a real range. We don't know exactly what that range is, but it's the farthest you can shoot/throw the slowest projectile in game if you're just throwing for distance.
I play the Prophesy of Pendor mod, so my examples are pulled from it. There, the throwing axes are the slowest projectile with speeds of 18. So at the farthest distance you can throw an axe, the axe's speed is zero, its speed ratio is zero, zero squared is zero, and no damage results. Javelins have 25 base speed, so at that same distance they have 25-18 = 7 speed remaining, their ratio is 7/25 = 0.28, and their 42 base damage is multiplied by 0.28^1.9 = 8.9% for a result of 3.74 damage (before armor). A siege crossbow with speed 85 still has 67 speed at that same range, so it still does (67/85)^1.9 = 63.6% of its base damage of 92 for a total of 58.5. So we conclude that at range, the cross bow does more damage and is the better weapon. Well, at least we have a damage at range stat that we can use along with rate of fire, skill reqs, etc to do our balancing. And that's the part I've not seen anywhere else.
Pode´s lecture said:Almost as if the devs worked hard on that or something