Giter Site home page Giter Site logo

jujoka / prd-algorithm-example Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

Pseudo-random number generation algorithm commonly used for competitive games that include RNG based mechanics like critical strikes

License: MIT License

Java 100.00%

prd-algorithm-example's Introduction

PRD-Algorithm-Example

Pseudo-random number generation algorithm commonly used for competitive games that include RNG based mechanics like critical strikes

Explanations of the algorithm can be found here:

https://www.fatalerrors.org/a/prd-critical-hit-algorithm-of-the-common-pseudo-random-algorithm-in-the-game.html

https://dota2.fandom.com/wiki/Random_distribution#Definition

How to use: Run the program, input your choice for what probability to simulate and input the number of attempts to simulate. The program will print the incrementing probability of the event based on failed attempts provided by the algorithm (0-1), the roll (0-1) and any successful events. After the simulation is finished more information will be printed like average attempts until success and actual probability of the event based on the simulation (successes / attempts).

NOTE: User input is not sanitized

For Dota 2 players: the algorithm is working correctly for high chance events like MKB (80%), however the game actually rolls for the chance of failure instead of success, so in the case of MKB every attack will proc the effect unless a 20% PRD roll would result in a success.

prd-algorithm-example's People

Contributors

jujoka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.