1. Hello!

    First of all, welcome to MapleLegends! You are currently viewing the forums as a guest, so you can only view the first post of every topic. We highly recommend registering so you can be part of our community.

    By registering to our forums you can introduce yourself and make your first friends, talk in the shoutbox, contribute, and much more!

    This process only takes a few minutes and you can always decide to lurk even after!

    - MapleLegends Administration-
  2. Experiencing disconnecting after inserting your login info? Make sure you are on the latest MapleLegends version. The current latest version is found by clicking here.
    Dismiss Notice

Attack animation probabilities?

Discussion in 'Help & Advice' started by deer, Jan 13, 2021.

  1. deer
    Offline

    deer Pac Pinky

    195
    398
    191
    Oct 27, 2020
    Female
    Oddville
    11:45 AM
    cervid
    Bishop
    130
    Oddjobs
    Attack animation probabilities?

    As you already know, basic-attacking (bound to the Ctrl key by default) with a melee weapon (sword, axe, blunt weapon, wand, staff, spear, polearm, dagger, knuckler, etc.) produces a certain animation. These animations are classified as “swings” or “stabs” (“stabs” are sometimes known as “thrusts”). For some weapons (swords, daggers, knucklers, etc.), the animation is purely cosmetic. For other weapons (polearms, spears, axes, blunt weapons, wands, staves, etc.), the animation determines how the attack’s damage is calculated. In particular, the PSM (primary stat multiplier) changes based on the animation. Note that from here on out, “animation” does not refer to the visual/cosmetic animation, but instead to the virtual animation that actually determines the attack’s PSM. All of the PSMs for these types of weapons are already known:



    Weapon typeSwingStab
    Polearm5.03.0
    Spear3.05.0
    One-handed axe4.43.2
    One-handed blunt weapon4.43.2
    Wand4.43.2
    Staff4.43.2
    Two-handed axe4.83.4
    Two-handed blunt weapon4.83.4
    When an animation for a particular weapon type has the greater of the two PSMs, we call it a “good” animation. Otherwise, we call it a “bad” animation.

    Sometimes, certain attacking skills force a certain animation type. For example, Spear Crusher is known for its high damage due to always stabbing and requiring a spear to be equipped. This forces a good animation, and the PSM is thus always the highest possible PSM in the game (5.0). Conversely, Pole Arm Crusher acts like Spear Crusher in that it always stabs, but because it requires a polearm to be equipped, this forces a bad animation, and thus gives a very low PSM (3.0).

    The question

    What I want to ask is: what is the exact probability of a swing (or, complementarily, of a stab, since swing and stab are the only two possibilities), given a particular attacking skill and a particular weapon type? We consider basic-attacking to be its own special “attacking skill”, even though it is not a skill at all.

    We assume

    This assumes two things:
    • We can treat each particular use of an attacking skill as its own Bernoulli trial, with a “success” being defined as a swinging “animation”, even if the visual/cosmetic animation does not reflect this.
    • Given a fixed weapon type and fixed attacking skill, the parameter p of each trial is identical. This implies that the outcome of each trial is fully independent of any other event or condition. This further implies that any series (in no particular order, and not necessarily uninterrupted, as long as no trials are selectively discarded and/or reordered) of attacks with given skill and given weapon type is a Bernoulli process.
    What we know so far
    In the following table, “1H” stands for “one-handed”, “2H” stands for “two-handed”, and “BW” stands for “blunt weapon”.

    Question marks (“?”) by themselves are used to indicate unknown values. Question marks accompanying other information means that that information is uncertain.

    “n/a” means that there are no such thing as “swings” nor ”stabs” in the given case, except possibly for visual/cosmetic purposes.



    Attacking skillWeapon typep
    [basic attack]polearm0.6ᵃ
    [basic attack]spear0.6ᵇ
    [basic attack]1H swordn/a
    [basic attack]1H axe0.6ᶠ
    [basic attack]1H BW0.6ᶠ
    [basic attack]2H swordn/a
    [basic attack]2H axe0.6?ᵍ
    [basic attack]2H BW0.6?ᵍ
    [basic attack]wand1.0?ᶜ
    [basic attack]staff1.0?ᶜ
    [basic attack]daggern/a
    [basic attack]knucklern/a
    Power Strike[any][same as basic attack]?
    Slash Blast[any][same as basic attack]?
    Panic: Sword1H sword, 2H sword?
    Panic: Axe1H axe, 2H axe?
    Coma: Sword1H sword, 2H sword?
    Coma: Axe1H axe, 2H axe?
    Shout[any]?
    Rush[any]0.0?
    Brandish[any]0.5ᵉ
    Charged Blow[any]?
    Blast[any]0.6ᵉ
    Heaven’s Hammer[any]?ᵈ
    Spear Crusherspear0.0
    Pole Arm Crusherpolearm0.0
    Dragon Fury: Spearspear1.0
    Dragon Fury: Pole Armpolearm1.0
    Sacrifice[any][same as basic attack]?
    Dragon Roarspear, polearmn/a
    Disorder[any][same as basic attack]?
    Double Stabdaggern/a
    Steal[any][same as basic attack]?
    Savage Blowdaggern/a
    Assaulterdaggern/a
    Band of Thievesdaggern/a
    Assassinatedaggern/a
    Boomerang Stepdaggern/a
    Flash Fistknucklern/a
    Somersault Kick[any]0.0
    Backspin Blowknucklern/a
    Double Uppercutknucklern/a
    Corkscrew Blowknucklern/a
    Energy Blastknucklern/a
    Energy Drainknucklern/a
    Shockwaveknucklern/a
    Dragon Strikeknucklern/a
    Energy Orbknucklern/a
    Demolitionknucklern/a
    Snatchknucklern/a
    Barrageknucklern/a
    Air Strike[any]0.0
    Footnotes for “What we know so far”

    a: This value has long been rumoured to be 0.6. Slime tested 1000 trials of this, and got 586 swings (and thus 414 stabs).

    b: This value has long been rumoured to be 0.6. A set of 1017 trials done by geospiza (see https://stab-swing-counter.geospiza.me/) tested this, and got 611 swings (and thus 406 stabs).

    c: This one’s actually off the top of my head. I don’t think wands and staves can stab…?

    d: I don’t even know what the damage formula is for Heaven’s Hammer. IIRC, the damage is calculated purely on the server-side, so I’m sure MapleLegends has tweaked it to hell and back.

    e: These values are due to Nise, in this reply.

    f: Some data collection due to Slime (using a one-handed axe) gave 599 swings and 401 stabs (p = 0.599). Data collection due to Pedro_ (using a one-handed blunt weapon) gave 62 swings and 38 stabs (p = 0.62). If these were combined (not necessarily warranted, since they are two separate weapon types), that would be 661 swings and 439 stabs (p = 0.60091).

    g: These are the assumed values, based on the p for one-handed versions of these weapons.

    How do we know?

    The obvious answer is: testing. For attacks whose virtual animations are manifest (you can see them), you can do this manually (marking down one of two different symbols, one for swing and one for stab, each time you attack, then counting them up programmatically afterwards), or, you can possibly intercept the attack packets and count them purely programmatically.

    For attacks whose virtual animations are not manifest, it may be necessary to test damage values and then analyze them using some statistical methods.

    Ideally, (almost) all of these can be simply reverse-engineered by someone(s) with enough binary analysis/decompilation expertise.
     
    • Great Work Great Work x 6
    • Like Like x 1
  2. Nise
    Offline

    Nise Supervisor Staff Member Supervisor Game Moderator

    2,059
    693
    500
    Jul 5, 2017
    Male
    Korea
    8:45 PM
    NoraONE
    Corsair
    189
    Sweetdreams
    From what I know, the swing/stab probabilities are actually hard coded in the files. I know for the 4th job skills:

    Brandish = 50% chance to swing, 50% chance to stab
    Blast = 60% chance to swing, 40% chance to stab
    Crusher = 100% stab
    Fury = 100% swing

    Basic attacks are just 50/50 I believe with no weightages.
     
  3. OP
    OP
    deer
    Offline

    deer Pac Pinky

    195
    398
    191
    Oct 27, 2020
    Female
    Oddville
    11:45 AM
    cervid
    Bishop
    130
    Oddjobs
    The *.wz files? Gotcha, I'll have to take a look ^^

    Do you have anything to back this up? As stated in my post, 1000 trials with a polearm yielded 586 swings, which is, if nothing else, closer to 600 than it is to 500. Also, it doesn't seem to me that wands and staves have a 50/50 chance of swinging/stabbing. I have them both in the table as p = 1.0.
     
  4. Nise
    Offline

    Nise Supervisor Staff Member Supervisor Game Moderator

    2,059
    693
    500
    Jul 5, 2017
    Male
    Korea
    8:45 PM
    NoraONE
    Corsair
    189
    Sweetdreams
    I just dont rmbr anything in the files that showed any skew towards one over the other, but I could be glossing over something. That said, a single trial of 1000 isn't really a solid data set. You'd need multiple sets of 1000 to be come to some conclusion. 580 is a bit high if the probability was truly 50/50, but it is also highly possible your single data point was an outlier (in the grander scheme of things). But as of now, there's no real way to check that out, without doing another 10+ trials of 1000.
     
    • Agree Agree x 1
    • Disagree Disagree x 1
  5. OP
    OP
    deer
    Offline

    deer Pac Pinky

    195
    398
    191
    Oct 27, 2020
    Female
    Oddville
    11:45 AM
    cervid
    Bishop
    130
    Oddjobs
    I would really need some probability theory worked out for me before I believe that 586 is "highly possible". You call 1000 trials a "single data point", but for our purposes, it is 1000 data points; every time that you basic-attack with a polearm, that is one more datum, even if the number of times that you basic-attack isn't a multiple of 1000. If we had tested 1100 trials, would that be enough? 1101? 2345? The only way to know is by setting an acceptable confidence and then doing at least enough trials to establish that confidence level.

    Actually, as it turns out, there is an English Wikipedia article on exactly this subject. Using the technique that they call "Estimator of true probability", we see that the margin of error is defined as:

    Code:
    E = Z / (2 * sqrt(n))
    ...where "Z" is the Z-value of a standard normal distribution, "sqrt" is the square root, and "n" is the number of trials (n = 1000, in our case).

    In order to have 0.5 lie within our confidence interval, we would need a margin of error that is at least 0.586 - 0.5 = 0.086.

    We can now solve algebraically for the Z-value (and thus corresponding confidence level) that gets us this margin of error:

    Code:
    0.086 = Z / (2 * sqrt(1000))
    
    0.086 = Z / 63.245553203367585
    
    Z = 0.086 * 63.245553203367585
    
    Z = 5.439117575489612
    Now, if you look at many Z-tables (like the one on Wikipedia), they won't even give you a p-value for 5.4. Beyond a Z-value of 5 or so, they just give values for "large integers", that is, 5, 6, 7, 8, 9, 10, 20, 30, etc. So I asked Wolfram Alpha, and it quotes a confidence level of "1 - 5.358*10^-8".

    That means that 0.5 could only be the true probability if we got a fluke that had a probability of 5.358*10^-8, which is one in 18,663,680 (roughly 18.7 million).
     
    • Like Like x 1
    • Great Work Great Work x 1
  6. geospiza
    Offline

    geospiza Web Developer Staff Member Web Developer

    212
    449
    215
    Apr 16, 2020
    4:45 AM
    geospiza
    Dark Knight
    146
    Funk
    For spears and pole-arms in particular, the ratio of stab to swing is 2:3 (see Alyosha's DK guide). This make 2nd job pole-arm a bit nicer for grinding.

     
  7. Slime
    Offline

    Slime Pixel Artist Retired Staff

    641
    1,184
    381
    Apr 8, 2015
    Male
    Israel
    1:45 PM
    Slime / OmokTeacher
    Beginner
    102
    Flow
    I heard it's 2:3 many times before, I also heard it's 1:1 many times.
    What these people claim, is what deer is testing mathematically here.
    You go deer! Not all heroes wear capes!
     
    • Friendly Friendly x 1
  8. OP
    OP
    deer
    Offline

    deer Pac Pinky

    195
    398
    191
    Oct 27, 2020
    Female
    Oddville
    11:45 AM
    cervid
    Bishop
    130
    Oddjobs
    This appears to be quite a bit more likely, given the 1000 trials that SlimeSlime was so kind enough to collect for us (I did not collect any of the data myself)! Doing the same math that I did in my previous response to this thread, we end up with 0.6 (that is, a 0.6 probability of swinging) being within our CI as long as our confidence level is at least 62.4%. And I should hope that we do want a confidence level of at least 62.4%, since 62.4% confidence is not that great. In order words, given that the observed probability was 0.586, then the actual probability could be as far away as 0.6 (a margin of error of 0.6 - 0.586 = 0.014), given a "fluke" that has probability 100% - 62.4% = 37.6%. That's not nearly as unlikely as one in 18.7 million; in fact, it's about one in 2.66. So I'm much more inclined to believe that the "true" p here is 0.6, than I am to believe it to be 0.5.
     
    • Like Like x 1
  9. geospiza
    Offline

    geospiza Web Developer Staff Member Web Developer

    212
    449
    215
    Apr 16, 2020
    4:45 AM
    geospiza
    Dark Knight
    146
    Funk
    I did some of my own data collection with sky skis and got 406 stabs and 611 swings for a ratio very close to to 2:3. It's been an interesting exercise! I automated animation counting through video recordings, and might try it again with a sword/axe to help fill in one of those (?) boxes.
     
    • Great Work Great Work x 2
  10. Slime
    Offline

    Slime Pixel Artist Retired Staff

    641
    1,184
    381
    Apr 8, 2015
    Male
    Israel
    1:45 PM
    Slime / OmokTeacher
    Beginner
    102
    Flow
    Awesome, that further strengthens the 2:3 estimate we already had, please do post sword/axe results too!
     
  11. OP
    OP
    deer
    Offline

    deer Pac Pinky

    195
    398
    191
    Oct 27, 2020
    Female
    Oddville
    11:45 AM
    cervid
    Bishop
    130
    Oddjobs
    That's really cool!!! I don't know anything about classifiers or computer vision or anything so I don't really understand what you've done here in detail, but that's a really cool way of automating this non-invasively.

    I've added this new info to the initial post, and removed the question marks from the polearm and spear swing probabilities.
     

Share This Page