Jump to content
Server Maintenance - January 18, 6:00 CET (5:00 UTC) Read more... ×
Server Maintenance - January 18, 6:00 CET (5:00 UTC) Read more... ×
You need to play a total of 50 battles to post in this section.
Istrilyin

Calculate your Ranked Battle Chances!

12 comments in this topic

Recommended Posts

[GOT]
Players
7 posts
5,807 battles

 

Save stuff below the line as an html file, and run the numbers to see your chances of getting that rank! For rank 10 to 1 only...

 

Hope this editor actually supports this stuff. Feel free to improve upon, edit, flame, host, whatever. It ran nicely on Chrome, didn't test it anywhere else as it's late in the afternoon already. Just needed a break from x-layer programming and felt like hacking a bit with html/javascript.

 

%<---------------------------------------------------line------------------------------------------------

<!DOCTYPE HTML>

<html>

<head>

  <style>

    table { border-spacing:0px; border-collapse:separate; border:1px solid black; }

      td { margin:0px; padding:0px; vertical-align:bottom; }

  </style>

</head>

<body>

<h1>Ranked Battle Progress Estimation</h1>

<form onsubmit="try { estimate(); } catch (err) { alert(err.message); } return false;">

  <p>

  My name is <input type='text' id='fldName' maxlength='30'/>.

  <br/>

  I am rank <select id='fldCurrentRank'>

  <option>2</option><option>3</option><option>4</option><option>5</option>

  <option>6</option><option>7</option><option>8</option><option>9</option>

  <option selected>10</option>

  </select>

  with <select id='fldCurrentStars'>

  <option>0</option><option>1</option><option>2</option><option>3</option><option>4</option>

  </select> stars...

  <br/>

  Reaching rank <select id='fldTargetRank'>

  <option selected>1</option>

  <option>2</option><option>3</option><option>4</option><option>5</option>

  <option>6</option><option>7</option><option>8</option><option>9</option>

  </select> is what I'm dreaming off!

  <br/>

  Probably I can play <input type='text' id='fldGamesToPlay' maxlength='4' size='4' value='200'/> more games this season.

  <br/>

  My winrate in the rank 10-6 bracket is like <input type='text' id='fldWinrate10' maxlength='8' size='3' value='51'/>%.

  <br/>

  In the rank 5-2 bracket? Well let's say <input type='text' id='fldWinrate5' maxlength='8' size='3' value='49'/>%.

  <br/>

  Okay Istrilyin, show me, <input type=submit onclick="return checkForm()" value='what are my odds'/>?

  </p>

</form>

<div id="consoleDiv">

</div>

<table width="100%">

  <tr id="timeCurveRow">

  </tr>

 </table>

 <table width="100%">

  <tr id="statsRow">

    <td style='color:green;text-align:left;'><span id='nameSucces'></span> SUCCES CHANCE: <span id='succesChance'></span>%</td>

    <td style='color:red;text-align:right;'><span id='nameFail'></span> FAIL CHANCE: <span id='failChance'></span>%</td>

  </tr>

</table>

<script>

var name, currentRank, currentStars, targetRank, gamesToPlay, winrate10, winrate5;

function checkForm() {

    var message = '';

    name = document.getElementById('fldName').value;

    currentRank = parseInt(document.getElementById('fldCurrentRank').value);

    currentStars = parseInt(document.getElementById('fldCurrentStars').value);

    targetRank = parseInt(document.getElementById('fldTargetRank').value);

    gamesToPlay = parseInt(document.getElementById('fldGamesToPlay').value);

    winrate10 = parseFloat(document.getElementById('fldWinrate10').value);

    winrate5 = parseFloat(document.getElementById('fldWinrate5').value);

    if (name == null || name.length == 0) { name = 'NOOB'; } else { name = name.toUpperCase(); }

    if (isNaN(gamesToPlay)) { alert('How many games you think you will play? Like 200 or so.'); return false; }

    if (gamesToPlay > 1500) { message += 'We assume 1500 more games!\n'; gamesToPlay = 1500; }

    if (gamesToPlay < 1) { message += 'We assume one game, okay?\n'; gamesToPlay = 1; }

    if (isNaN(winrate10)) { alert('Fill in the winrates... Like 50.5 or so...'); return false; }

    if (winrate10 > 100) { message += 'Guess winrate cannot be higher then 100...\n'; winrate10 = 100; }

    if (winrate10 < 0) { message += 'Guess winrate cannot be lower then 0...\n'; winrate10 = 0; }

    if (isNaN(winrate5)) { alert('Fill in the winrates... Like 48.5 or so...'); return false; }

    if (winrate5 > 100) { message += 'Guess winrate cannot be higher then 100...\n'; winrate5 = 100; }

    if (winrate5 < 0) { message += 'Bracket 5-2 is not THAT hard! Ok we assume 0...\n'; winrate5 = 0; }

    document.getElementById('fldGamesToPlay').value = gamesToPlay;

    document.getElementById('fldWinrate10').value = winrate10;

    document.getElementById('fldWinrate5').value = winrate5;

    if (message != '') { alert(message); }

    return true;

}

function prepareDisplay() {

    var timeCurve = document.getElementById('timeCurveRow');

    timeCurve.innerHTML = '';

    for (var i=1; i <= gamesToPlay; i++) {

        timeCurve.innerHTML += "<td title='Odds of getting it in " +i+ " games.'>"

        + "<div style='width:100%;background:green;' id='t" +i+ "'></div>"

        + "</td>";

    }

    for (var i=targetRank+1; i <= 10; i++) {

        timeCurve.innerHTML += "<td title='Odds of getting stuck at rank " +i+ ".'>"

        + "<div style='width:100%;background:red;' id='r" +i+ "'></div>"

        + "</td>";

    }

    document.getElementById('nameSucces').innerHTML = name;

    document.getElementById('nameFail').innerHTML = name;

    return;

}

function estimate() {

    prepareDisplay();

    var fails = 0;

    for (var x=1; x <= 10 * gamesToPlay; x++) {

        var rank = currentRank;

        var stars = currentStars;

        for (var t=1; t <= gamesToPlay; t++) {

            var won = Math.random() * 100.0 < (rank > 5 ? winrate10 : winrate5);

            if (won) {

                stars++;

                if ((stars >= 4 && rank > 5) || (stars >= 5 && rank <= 5)) {

                    rank--;

                    stars = 1;

                    if (rank <= targetRank) {

                        updateStats(fails, x);

                        if (upHeightAndCheckForDone('t' + t)) {

                            return;

                        }

                        break;

                    }

                }

            } else {

                stars--;

                if (stars < 0) {

                    if (rank == 10) {

                        stars = 0;

                    } else {

                        rank++;

                        stars = rank > 5 ? 3 : 4;

                    }

                }

            }

        }

        if (rank > targetRank) {

            fails++;

            updateStats(fails, x);

            if (upHeightAndCheckForDone('r' + rank)) {

                return;

            }

        }

    }

}

function updateStats(fails, runs) {

    document.getElementById('succesChance').innerHTML = (100.0 * (runs - fails) / runs);

    document.getElementById('failChance').innerHTML = (100.0 * fails / runs);

}

function upHeightAndCheckForDone(id) {

    var div = document.getElementById(id);

    var newHeight = parseInt(div.style.height) + 1;

    div.style.height = newHeight + 'px';

    return (newHeight >= 400);    

}

</script>

</body>

</html>

 

 

Edited by Istrilyin
  • Cool 3

Share this post


Link to post
Share on other sites
[PLO]
Alpha Tester, In AlfaTesters
5,411 posts

And how am I supposed to use it? For me, all it looks like is a bunch of random signs, letters and numbers...

 

Read carefully first sentence.

Share this post


Link to post
Share on other sites
Beta Tester
2,286 posts
9,870 battles

 

Read carefully first sentence.

 

Hmmm, funny I don't remember seeing that, well, not all of us understand that kinda stuff so I don't need a code to tell me how much more battles will I have to tolerate noobs...

Share this post


Link to post
Share on other sites
[GOT]
Players
7 posts
5,807 battles

 

Hmmm, funny I don't remember seeing that, well, not all of us understand that kinda stuff so I don't need a code to tell me how much more battles will I have to tolerate noobs...

 

Of course! Noobs cannot be tolerated under any circumstance anywhere. :-)

 

The idea is to give the average player an estimate of the return on (time) investment.

 

Removed two debug lines in the script - sorry for the alert spam if you saved it before that.

Edited by Istrilyin

Share this post


Link to post
Share on other sites
[KOKOS]
Beta Tester, Players
3,368 posts
8,807 battles

Hmmm, if i use different names, but the same numbers, the odds vary...

Also, if you use the same name and numbers, the odds keep changing after you click again... 

Looks like the numbers/odds are just a random generated variable/result.

 

The results can be (after clicking what are my odds multiple times with the same name/numbers) +/- 3% higher or lower then the result you get after the first check.

 

correct me if i am wrong

 

:ohmy:

Share this post


Link to post
Share on other sites
Beta Tester
2,286 posts
9,870 battles

 

Of course! Noobs cannot be tolerated under any circumstance anywhere. :-)

 

The idea is to give the average player an estimate of the return on (time) investment.

 

 

Average players have the same chance as both noobs and pros in reaching rank 1, its all about how lucky or unlucky will you get (more or less bad players).

Share this post


Link to post
Share on other sites
[GOT]
Players
7 posts
5,807 battles

Hmmm, if i use different names, but the same numbers, the odds vary...

Also, if you use the same name and numbers, the odds keep changing after you click again... 

Looks like the numbers/odds are just a random generated variable/result.

 

The results can be (after clicking what are my odds multiple times with the same name/numbers) +/- 3% higher or lower then the result you get after the first check.

 

correct me if i am wrong

 

:ohmy:

 

You're right about that. The exact distribution is a less obvious mathematical problem. Simulating with a random number generator is quick and easy. If you get odds of 62% to reach the desired rank in 300 battles, the next run may give 60%. Of course one can make the script run longer by tweaking it, then it becomes more accurate. However it's about the ballpark figure that's otherwise hard to estimate. And that ballpark figure is, if I didn't make some dumb mistake, pretty useful.

 

Also, it gives you some idea about the spread. Like how likely it is that instead of 200 battles it will take you 80 or 400.

  • Cool 1

Share this post


Link to post
Share on other sites
[KOKOS]
Beta Tester, Players
3,368 posts
8,807 battles

 

You're right about that. The exact distribution is a less obvious mathematical problem. Simulating with a random number generator is quick and easy. If you get odds of 62% to reach the desired rank in 300 battles, the next run may give 60%. Of course one can make the script run longer by tweaking it, then it becomes more accurate. However it's about the ballpark figure that's otherwise hard to estimate. And that ballpark figure is, if I didn't make some dumb mistake, pretty useful.

 

Also, it gives you some idea about the spread. Like how likely it is that instead of 200 battles it will take you 80 or 400.

 

:honoring:

Share this post


Link to post
Share on other sites
[GOT]
Players
7 posts
5,807 battles

 

Average players have the same chance as both noobs and pros in reaching rank 1, its all about how lucky or unlucky will you get (more or less bad players).

 

Sure, but now see how long it takes them.

 

Noobs with a winrate of 48% can climb from rank 10 to rank 1, surely, but after 500 battles only half of them will have made it.

47%? 650 battles.

47% but more like 45% after reaching the 2-5 bracket? Think 1000 battles... Half of them are still sailing around.

 

On the other hand, 52%? 245 battles.

55%? 175 battles.

 

That's what the tool is for.

 

Share this post


Link to post
Share on other sites
[PORT]
Modder
1,492 posts
10,972 battles

Hm, ~70 rounds to reach Rank 5. But I'm a Cruiser-User, that will probably have to be taken into account too :X

 

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×