How does combat really work?

Discussion in 'The Veterans' Lounge' started by mackal, Jun 25, 2015.

  1. mackal Augur

    Basically, I want to know more details about combat. Sadly some of the resources have fallen off the Internet. I'm not sure the best way to ask, so I guess I'll explain what I've been able to find with research and at least some what confirm through parses.

    First, thanks to https://forums.daybreakgames.com/eq...st-update-06-10-15.223510/page-2#post-3261772 we know the current live order of the checks. So Ripo,etc is checked. Lets say they all fail. We move on to the hit/miss check. This is avoidance roll vs accuracy roll. The avoidance part is the computed defense discussed here https://forums.daybreakgames.com/eq/index.php?threads/ac-vs-acv2.210028/#post-3078126

    I also assume this is where Evasive is added in. Then the attacker has an accuracy stat that is most likely largely based on skill and level with a drunk check given what's in computed defense post. +Accuracy should also be added in here. These two numbers are somehow rolled against each other.

    Now more mathy stuff. For a long time it's been known that the mobs damage is DB + DI_roll * DI for mobs (damage bonus and damage interval). Using test dummy names (so probably EQ's real names) min damage + base damage * roll. This roll is the defenders mitigation AC (AC Sum in AC vs ACv2 thread) vs some part of the attack, often called Power, but probably many other things. Defensive (SPA 168, warriors got an innate 5% here in GoD I think?) lowers the DI portion and Shielding lowers the DB portion. Now players have a bit more, I'm sure I'll miss a few spell effects, but this is what I was able to find / verify.
    This function most likely takes the weapon damage value or the damage value from a spell (ex. Backstab Attack for 400 with 10000% Accuracy Mod on Massive Strike. Backstab also has it's own formula.)
    Stolen from a post by Brogett DB + Floor(Heroic_str/10) + C*(Random(1 to 20)*weapon_damage/10 * Random(100 to PC_DAM)/100). (DB = damage bonus, C = Crit mod)
    The Random(1 to 20) part is the damage interval roll. This is some how decided by AC sum vs attack power.
    The Random(100 to PC_DAM) is the damage table roll. This rolls between 100 and whatever your damage table value is. I believe sub 50 this is a function of skill/stats but 50+ it's a look up based on level with monks getting their own? I do remember seeing these numbers posted before, but I can not find them again, but from some posts ex level 100 rog it should be 395, level 60 war 285.
    The damage table roll also the source of what was called "modal hit" for while, which works out to DB + (20 * weapon_damage / 10) + 100 / 100. How this roll is done has eluded me. All of the theory crafting I can find just says "random some how" So I guess run through it in pseudo-code (this is mostly int math as far as I can tell):

    Code:
    DI_roll = RollDI(attacker, defender)
    PC_dam_roll = RollDamageTable(attacker->GetDamageTable()) # No idea how roll is done
    damage = ((DI_roll * weapon_damage / 10) * PC_dam_roll) / 100
    damage = TryCriticalHit(damage) # this generates a message too, which doesn't include some SPA mods (ex. Cragbeast Queen mitigates from some skills, crits report non-mitigated damages)
    if (damage < SPA(186 Min Damage Done Mod) * weapon_damage)
        damage = SPA(186 Min Damage Done Mod) * weapon_damage
    damage = damage_bonus + heroic_str / 10 + damage # note the crit mod was already applied
    I'm sure that's missing lots of SPAs like 185 and stuff that mitigates damage. Damage bonus is also calculated based on level for 1h in the primary, offhanders don't have a DB unless you have Sinister Strikes AA. The DB from SS is delay based I believe? 2h have their own formula that is based on delay and level.

    So I guess to wrap it up, what are all the "damage table" values and how is the roll done! And any other associated stuff -- I just want to know and haven't been able to come up with anything further with parses :(
    Brudal likes this.
  2. Goth Augur

    I have no idea.. I hit the "Q" button and stuff dies.. How we get there irreverent.

    [IMG]
    Caixaa likes this.
  3. Khauruk Augur

    There are some old posts on evilgamer giving detailed info for both player combat and NPC combat. There's some old combat pseudocode that I copied from a developer post on thesteelwarrior floating around somewhere on beastlords.org *I think*. If not, toss this into the wayback machine: http://www.thesteelwarrior.org/forum/showthread.php?t=7710 and hope you get a hit.
  4. mackal Augur

    Yeah, that's what I was talking about with resources being gone and it looks the Wayback Machine is having issues with that page :( sounds like something I'd like to read, I probably did back when it was still up, but I would love to read it again. Which is why I kind of started this thread, hoping people would post any info from dead websites they may have had copies of :p
  5. Khauruk Augur

    You might be able to find it on beastlords.org - look for submissions by Khauruk. I think at one point I copied it over there verbatim, but just couldn't find it immediately when I wrote that post.
  6. Beimeith Lord of the Game

    The answer is no one really knows. Anyone who tells you differently is wrong.
    Sancus likes this.
  7. Brogett Augur

    Get rid of any worn ferocity and just do a couple min parse on a dummy. You'll see the min, max and "2x" damage spikes falling out from max PCDam, Min PCDam, with DI roll of 20. You';ll probably also see DI roll 1 with max PC Dam.

    Both rolls I believe are rolls of a much larger range (with some unknown distribution - it's not flat and it doesn't seem to match a gaussian either) which then get clipped to the min/max range. This is why you so often see min and max hits. DI roll is obviously skewed by attack vs AC, but I don't think anything skews the PCDam roll.

    You can graph the shape of the DI roll if you're patient. Using say a G11 keyboard or similar, or just the old range "autofire" tool from years back, you can get regular "increase mitigation" (or increase defense? I forget) requests to an arena dummy and then parse the DI1 and DI20 rolls out, seeing how they change over time. I did this with me attacking the dummy, but in reverse is easier (dummy attacking you) as there is no PC Dam to have to compensate for. It's just much much slower to get meaningful stats.

    Edit: you mention backstab has its own formula. Sort of. I think there is a base hit formula used by players and NPC alike where you plugin the weapon damage and out pops a number. This then gets modified by damage table for players, and then subsequently for damage bonus components. Backstab fits in this well. It is identical to any normal weapon swing but with the damage being the BS damage listed multiplied by (2 + skill/50).
  8. Brogett Augur

    The graphs I mentioned earlier:

    [IMG]

    This as average hit after varying increase mitigation messages.

    [IMG]

    These are the fraction of hits coming from DI 1 and DI 20 rolls. Notice how DI20 has an asymtote to 0 (sort of like 1/x, but perhaps not that function) while DI1 shows some clipping tendances as it crosses the axis at a defined angle, meaning no DI1 rolls at all below a certain amount.

    This leads it to look more like a poisson distribution, but I'm still not convinced. Maybe it's just a clipped distribution making the numbers look odd. I lost interest before I explored this further.

    [IMG]

    The complete frequency distribution, with no worn ferocity. You can clearly see the stages of DI rolls vs PCDam rolls. Given large enough hits (like backstab has) you can verify the granularity of 0.01 incremements (ie why PCDam is /100) as it means some vaues are impossible to obtain.

    Finally, on my own guild forums I found my post from 2013. No idea if it's still the same.

    Code:
    # Between 1 and 20 inclusive
    DI_roll = get_DI_roll(player.attack, target.AC)
     
    # PC Damage Table roll, between 1.00 and 3.95 (for rog level 100) in 0.01 increments.
    PC_damage_roll = get_damage_roll(player.damage_table)
     
    if (attack_type == backstab)
        weapon_damage = floor(backstab_damage * (2 + backstab_skill/50.0))
     
    # Round 823.5 to 824. Always .5 to 1, or .5 to even?
    skill_attack_dam = round(DI_roll/10 * weapon_damage)
     
    # This is where skill attacks like Massive Strike enter this code.
    # 1: Backstab Attack for 1200 with 10000% Accuracy Mod
     
    # PC only. NPC's don't have this and anything below except the final damage bonus.
    if (PC_damage_roll == 1.00)
        pc_damage = skill_attack_dam
    else
        pc_damage = ceil(skill_attack_dam * PC_damage_roll + 1e-30)
    # or only where pc_damage_roll >= 3.95?
     
    pc_dam_mult = 1.00
     
    # Apply SPA-185 "Increase Hit Damage by x%"
    # Eg Rogue's Fury, Executioner's Disc, Lethality
    pc_dam_mult += MAX_SPA_185
     
    # Apply Mastery AAs, eg:
    pc_dam_mult += get_rank(AA_scouts_mastery_of_piercing) * 0.02
     
    # Add heroic dex
    if (is_ranged_attack)
        pc_damage += heroic_dex / 10
     
    # Compute critical hit multiplier.
    crit_mult = 1.7  # 1.5 for war/berserker?
    if (attack_type == backstab)
        crit_mult += 0.1 * get_rank(AA_assassins_wrath)
    else #assume pierce, crush, slash
        crit_mult += VW_table[get_rank(AA_veterans_wrath)]  # +1.8 at AA rank 21
     
    if (pc_damage > 20000)
        if (crit_roll == 1)
            pc_damage = crit_mult * (5 + pc_damage)
     
     
    # Check SPA-186: Increase Minimum Hit Damage by x%
    if (pc_damage < MAX_SPA_186 * weapon_damage)
        pc_damage = MAX_SPA_186 * weapon_damage
     
    # Apply heroic str
    pc_damage += heroic_str / 10
     
    # Add other damage bonuses
    if (attack_type == pierce)
        pc_damage += etherium_blade_bonus[get_rank(AA_etherium_blades)]
     
    pc_damage += damage_bonus
    "I'm still not 100% sure of all the floor, ceil and round type functions. Unless stated maths here is integer based and automatically floors. Modifiers like crit_mult and pc_dam_mult are floating point.

    Also I expect the ceil is implemented via a hack floor(x+1), as I see 1000.0 gets rounded to 1001."

    Clearly rogue oriented. :) I have other stats explaining etherium blade somewhere or other. (A flat 1+0.02*rank IIRC, but I'd have to double check). Also
  9. mackal Augur

    the 2+ skill / 50 was what I was talking about for BS.

    The PC dam is kind of easy to parse, just very time consuming (105 levels, 16 classes... although I'm not sure if all of the classes are different or not) which is why I did ask. People may have parsed them out for some classes already, and I know I've seen dev quotes some where before ><

    Another thing I was wondering about, is Evasive Discipline (and Combat Agility) the same as item avoidance or is it really a percentage increase like the incredibly bad source of info Lucy/Alla is :p The description for CA mentions a percentage, but it wouldn't be the first time the descriptions are entirely separate from reality :p
  10. Fanra https://everquest.fanra.info

    This link has less official information and more from players: http://everquest.fanra.info/wiki/Skill_Modifiers_and_Combat_Effects
  11. mackal Augur

    Sadly the dev quote does not answer the question I asked.

    Code:
    compute_defense * (100 + TotalSPA172) / 100
    is very different from
    Code:
    compute_defense + TotalSPA172
    This should actually be provable, sadly I don't have enough gear and a warrior to do the parses :( (basically need to do a parse with 50 avoidance, then remove 50 avoidance and test Evasive, agi and hAgi would need to stay the same, if the parses are long enough you should be able to tell if the effect a percentage or not [ex. if you have a computed defense of 500 and it's a percentage then 750 would be used instead of 550, which would be VERY different] this also assumes that at least for players there isn't much else done after the computed defense to decide hit/miss)
  12. Fanra https://everquest.fanra.info

    Sorry. I don't bother with math and trying to understand any of this. I just post what other people say so it is there for reference. In this case it appears I don't have what you are looking for.