1. Hello and welcome to the brand new home for PlayDota!
    Please read through our Welcome thread to see what's new!
    Dismiss Notice

Testing for Pseudo-Random Distribution of Uphill Miss Chance

Discussion in 'Advanced Mechanics' started by stripeythetiger, Nov 14, 2017.

  1. stripeythetiger

    stripeythetiger New Member

    4
    2
    3
    Nov 14, 2017
    Hi,
    I am doing a math project on Dota 2 regarding Pseudo-Random Distribution (PRD). This is not to be confused with PRNG, or true random events in Dota 2.

    Here is a description of PRNG and PRD in Dota 2, from the Gamepedia Wiki:
    On the same wiki article, there is a section which mentions that as of 6.87, evasion has had PRD. However, it states that tests have not been made to determine if Blind or Uphill Miss Chance also use PRD.

    My question is this: How can i develop a program for monitoring miss rate? My plan at the moment is to:
    1. Spawn a Timbersaw and give him 6 hearts with max "Reactive Armor".
    2. Spawn a Sniper with max "Take Aim" and 6 Moonshards for fast attack rate and long range.
    3. Set sniper to attack the Timber from low ground at maximum possible range; Timber has enough armor that he will not die from Sniper.
    4. Set to run overnight.

    The only issue with this plan is that I cannot figure out a way to quickly monitor if the attacks miss or not. The combat log shows every time Timber gets hit, but not when an attack misses.

    If I zoom into Timber, then I will only be able to hear the shots hitting him. Any misses make no sound. However, using a sound threshold recording program would only display successful attacks; I would like to be able to record both misses and hits.

    If anyone had any tips on how to record misses and hits, I would appreciate it very much. I have zero coding experience, but I would be willing to learn.

    Thank you very much for taking the time to go through my post, I appreciate all help! :)
     
  2. stripeythetiger

    stripeythetiger New Member

    4
    2
    3
    Nov 14, 2017
    flamegod0 and mapdesigner like this.
  3. mapdesigner

    mapdesigner Member

    2,924
    148
    63
    Aug 11, 2011
    Hello, there is some info in the wiki that I doubt and here it is:
    1-) But I vaguely remember I have tested evasion and it could procc moment f courage even with butterfly.

    Nw eitherway, the wiki is probably right but if you want correct result you might as welldouble check that and it is easy to do so. Just buy 5 butterflies and see if timbersaw gains stacks.

    2-) once you establish that then you can begin. Now are you able to read combat log currently? If you are able to detect how many attacks were successful, you can easily work out how many were missed.

    3-) what you will need to work out then number of missed attacks is a convenient Base attack time and attack speed. If it was for me, I would select one of the following heroes: Queen of pain, Morfling, Wind ranger, or Terror Blade which all have 1.5 Base Attack Time. Given 300% attack speed, these heroes would make an attack every 0.5 seconds. Now if you count how many attacks were successful, you can work out how many missed;

    Total attacks = Total Attacking Time * (Attack Speed / Base Attack Time); in our case Aspd / BAT = 2 Attacks per second.

    You can also do semilar calculations for ther heroes with different BAT. huskar and lina might be convenient for calculations as well due to having 1.6 BAT and with 400 attack speed they would make 2.5 attacks per second.

    It might even not take too much yo get results. Please though tell us how you tackled the problem once done and maybe share the paper ;)

    4-) Thanks for the links. I didnt know old PD is still accessible.
     
  4. EebstertheGreat

    EebstertheGreat Forum Manager Staff Member

    10,787
    88
    48
    Sep 3, 2009
    Finding the total number of hits and misses won't tell you if it uses a PRD. You have to look at how the misses are distributed. If they look "clumpy," then it is true random. If they look relatively uniform, then it is PRD.
     
    mapdesigner likes this.
  5. stripeythetiger

    stripeythetiger New Member

    4
    2
    3
    Nov 14, 2017
    Hey, the weekend finally came so I could figure stuff out.

    Mapdesigner, thank you for your input! However, Eebester is right in saying that cumulatively I won't be able to see if it's PRD or not.
    I need to look at strings of hits and misses to figure out the probability of missing on each hit. (Eg % misses on first hit, % misses after 1 successful hit, % misses after 2 successful hits, etc.)

    I could just look at the distribution and see that if there's a long streak then it's probably true random, but since this is a math assignment I'm gonna have to go the extra mile and do data analysis to get a good mark. :(

    My process is going to be to monitor the combat log at the same attack speed as the attacker to see if a new line was added. It seems codeable, but because I have absolutely no experience in coding, does anyone have any idea how I could go about creating an app that monitors pixel changes at a constant rate and gives a 1 if it does and a 0 if it doesn't?
    I should also ask what language/program I should use to make this application.

    Thank you guys so much for helping me out.
     
  6. Blamagenkind

    Blamagenkind Member

    627
    88
    28
    Jun 10, 2009
  7. EebstertheGreat

    EebstertheGreat Forum Manager Staff Member

    10,787
    88
    48
    Sep 3, 2009
    The uphill miss rate is 25%. If this uses PRD, there will never be a string of 12 hits in a row. If it uses a true random distribution, you will expect to get a string of 12 hits in a row after about 122 attacks. Since it shouldn't take long to go through thousands of attacks, if you never get a string of 12 hits in a row, that should give you very high confidence that it uses PRD. If you do ever get a string of at least 12 hits in a row, you can be certain that it does not.
     
  8. mapdesigner

    mapdesigner Member

    2,924
    148
    63
    Aug 11, 2011
    @stripeythetiger

    So now the only problem is how to extract strings of attacks from the combat log to excel or some .txt
     
  9. stripeythetiger

    stripeythetiger New Member

    4
    2
    3
    Nov 14, 2017
    The combat log commands can only work in replays, and custom lobbies don't seem to save replays anymore. Yikes. Kinda lost here :( https://github.com/odota/core is an interesting app, it does parse replays and combat logs. However, it only shows kills, assists, and bounties. And, like I said before, you can't extract the combat log from replays.

    Now, my original plan was to monitor pixel changes and to updated if the pixel changed color or not. Then to look at these strings of y/n and then find probability of missing on first hit, second, etc via another script.
    I'm not experienced in coding at all so I'm not sure where to start. I downloaded...virtual Machine? And I guess I'm coding in Python?

    Anyone have any crazier pipe dreams? :cry:
     
  10. mapdesigner

    mapdesigner Member

    2,924
    148
    63
    Aug 11, 2011
    you might need to use -allvision command to make the test easier