Author Topic: Points/payout formulas - May need a genious for this one  (Read 2701 times)

brunobus

  • Newbie
  • *
  • Posts: 47
    • View Profile
Points/payout formulas - May need a genious for this one
« on: July 10, 2007, 01:07:47 PM »
okay, I know one of you smart individuals will figure this one out for me.  It is a 2 part question, one for payouts and one for points.

for the tournament that I ran for 2 years and will probably start doing again in a few months will have anywhere from 45 to 65 players each month and the season will run for 12 months with a EOY championship at the end of the 12 months.

These are the payouts that I used, but I had to save each of the groups of payouts as a separate prize template, but I know there must be an easier way, even if it involves a bunch of IF statements,

There will be 1 position paid for every 6 players per the table below.

42-47 players – 7th-$50 6th-6% 5th-8% 4th-10% 3rd-16% 2nd-20% 1st-40%   
48-53 players – 8th-$50 7th-4% 6th-6% 5th-8% 4th-10% 3rd-12% 2nd-20% 1st-40%
54-59 players – 9th-$50 8th-3% 7th-4% 6th-6% 5th-8% 4th-9% 3rd-12% 2nd-20% 1st-38%
60-65 players – 10th-$50 9th-3% 8th-4% 7th-5% 6th-6% 5th-7% 4th-9% 3rd-11% 2nd-18% 1st-37%

So see if you can create a formula for this.


Second is the points structure.  I want there to be more points available depending on how many players play in the tournament.  Again, I had to save a different template for each one of different levels on #'s of players. 

60-65 players
1st – 46 2nd – 38 3rd – 32 4th – 27 5th – 23 6th – 20 7th – 18 8th – 16 9th – 14 10th – 12 11th – 10 12th-17th – 9
18th-23rd – 8 24th-29th – 7 30th-35th – 6 36th-41st – 5 42nd-47th – 4 48th-53rd – 3 54th-59th – 2 60th-65th – 1

54-59 players
1st – 44 2nd – 36 3rd – 30 4th – 25 5th – 21 6th – 18 7th – 16 8th – 14 9th – 12 10th – 10 11th – 9 12th-17th – 8
18th-23rd – 7 24th-29th – 6 30th-35th – 5 36th-41st – 4 42nd-47th – 3 48th-53rd – 2 54th-59th – 1

48-53 players
1st – 40 2nd – 32 3rd – 26 4th – 21 5th – 17 6th – 14 7th – 12 8th – 10 9th – 9 10th – 8 11th-17th – 7 18th-23rd – 6
24th-29th – 5 30th-35th – 4 36th-41st – 3 42nd-47th – 2 48th-53rd – 1

42-47 players
1st – 36 2nd – 28 3rd – 22 4th – 17 5th – 13 6th – 10 7th – 9 8th-9th – 8 10th-11th – 7 12th-17th – 6 18th-23rd – 5
24th-29th – 4 30th-35th – 3 36th-41st – 2 42nd-47th – 1

Now, the points do not have to exactly match these tables, but I'm sure you get the gist that the more players there are, the more points you can get for finishing higher.  If I were able to automate it all in a formula without having to switch around templates every time I get to another break level, that would sure make my life easier.


The final thing, and this has to do with new overall scoring system, is that rather than taking all 12 scores and adding them up to come up with the final points standing for the season, I am thinking of taking the top 9 or 10 scores for the year so that the regular players won't get penalized for missing a couple of months or just plain having a couple of bad months.  Is it possible to write a formula for this as well?


Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6220
    • View Profile
Re: Points/payout formulas - May need a genious for this one
« Reply #1 on: July 10, 2007, 02:39:15 PM »
You note that you're switching these at each break.  Does that mean that your tournament may start out with 45 players and you allow players to buy-ins as they arrive during the tournament, so you may eventually have 65 players before the tournament is over?

To automate the prizes, you can create your own automatic prizes file and point your TD to that file.  Then, just turn on automatic prizes and the prizes should adjust automatically as you buy players into the tournament.

Here's your automatic prizes file:

Code: [Select]
<prizeLevels>
  <prizeLevel minPlayers="1" maxPlayers="47">
    <prize rank="1" percent="40" shareLeftover="true" />
    <prize rank="2" percent="20" />
    <prize rank="3" percent="16" />
    <prize rank="4" percent="10" />
    <prize rank="5" percent="8" />
    <prize rank="6" percent="6" />
    <prize rank="7" fixed="50" />
  </prizeLevel>
  <prizeLevel minPlayers="48" maxPlayers="53">
    <prize rank="1" percent="40" shareLeftover="true" />
    <prize rank="2" percent="20" />
    <prize rank="3" percent="12" />
    <prize rank="4" percent="10" />
    <prize rank="5" percent="8" />
    <prize rank="6" percent="6" />
    <prize rank="7" percent="4" />
    <prize rank="8" fixed="50" />
  </prizeLevel>
  <prizeLevel minPlayers="54" maxPlayers="59">
    <prize rank="1" percent="38" shareLeftover="true" />
    <prize rank="2" percent="20" />
    <prize rank="3" percent="12" />
    <prize rank="4" percent="9" />
    <prize rank="5" percent="8" />
    <prize rank="6" percent="6" />
    <prize rank="7" percent="4" />
    <prize rank="8" percent="3" />
    <prize rank="9" fixed="50" />
  </prizeLevel>
  <prizeLevel minPlayers="60" maxPlayers="65">
    <prize rank="1" percent="37" shareLeftover="true" />
    <prize rank="2" percent="18" />
    <prize rank="3" percent="11" />
    <prize rank="4" percent="9" />
    <prize rank="5" percent="7" />
    <prize rank="6" percent="6" />
    <prize rank="7" percent="5" />
    <prize rank="8" percent="4" />
    <prize rank="9" percent="3" />
    <prize rank="10" fixed="50" />
  </prizeLevel>
</prizeLevels>

Note that this configuration will use the first set of prizes for any number of players from 1 to 47.  Save the above code as a text file.  Then in the TD, go to the Preferences tab, press the Config Files button on the left, and set the Automatic Prizes file to point to your saved file.

For awarding points, I'm not going to write out the entire formula for you, but I'll start you off:

Code: [Select]
if(n >= 60, if(r < 12, switch(r, 1,46,2,38,3,32,4,27,5,23,6,20,7,18,8,16,9,14,10,12,11,10)) + if(r > 11 && r < 18, 9)
  + if(r > 17 && r < 24, 8) + if(r > 24 && r < 30, 7) + if(r > 30 && r < 36, 6) + if(r > 35 && r < 42, 5) + if(r > 41 && r < 48, 4)
  + if(r > 47 && r < 54, 3) + if(r > 53 && r < 60, 2) + if(r > 59 && r < 66, 1))
+ if(n >= 54 && n <= 59, if(r < 12...

For your Overall Score: set your Score formula to be simply:

Code: [Select]
p
This will give each player a Score value that is equal to their Points value, for each tournament.  Then set your Overall Score formula to:

Code: [Select]
sum(top(10, scores))
You can replace the 10 with how many scores you want to use.  Easy if you know exactly how many tournaments you will play.  If you simply wanted to drop the bottom 2, you could use "s-2" in place of the 10.

brunobus

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Points/payout formulas - May need a genious for this one
« Reply #2 on: July 10, 2007, 06:05:35 PM »
The break level that I'm talking about is the break between # of players, i.e. from 47 to 48 or 53 to 54.  Sorry to be confusing, but to answer your question, everyone buys in at the same time.

I did do some digging in the version 2.3 help file and found the prize file setup.  I haven't even opened the software since February of this year and was pleasantly surprised by the number of changes the you made since the last version. 

I actually downloaded a free xml editor since I'm not all that familiar with this kind of stuff, but it's good to know that it will work just as a text file as well.  I was going to try it as a test file, but with the abilitiy to expand and collapse the different rows, I assumed it was a lot more sophisticated than that.  I was able to set it up very similar to what gave me.

On the points awarding, can I also incorporate that into the prizes rather than having to write out that huge equation?  If I do that though, will the "in the money" token work for just people who collected cash or will it end up showing that everyone ends up in the money?  I seem to recall that when I used all the different templates, it always showed that everyone placed.

Thanks for the help Cory!


brunobus

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Points/payout formulas - May need a genious for this one
« Reply #3 on: July 10, 2007, 06:45:12 PM »
Never mind, I went ahead and did the whole formula and it seems to work great based on the testing.  Now to work on the scores.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6220
    • View Profile
Re: Points/payout formulas - May need a genious for this one
« Reply #4 on: July 10, 2007, 07:20:41 PM »
You can awards points with prizes, but since you award money to 7 to 10 players, but want to award points to everyone, I wouldn't recommend going that route, because you'd have to define a prize for every rank that received points.

Sorry, I didn't realize that after your first 10 or so places, the points become linear (if they are linear before that, it's beyond my math skills to figure out how).  Here's your formula:

Code: [Select]
if(n >= 60, switch(r, 1, 46, 2, 38, 3, 32, 4, 27, 5, 23, 6, 20, 7, 18, 8, 16, 9, 14, 10, 12, 11, 10, max(ceil((66 - r)/6), 1)),
  if(n >= 54, switch(r, 1, 44, 2, 36, 3, 30, 4, 25, 5, 21, 6, 18, 7, 16, 8, 14, 9, 12, 10, 10, 11, 9, max(ceil((60 - r)/6), 1)),
    if(n >= 48, switch(r, 1, 40, 2, 32, 3, 26, 4, 21, 5, 17, 6, 14, 7, 12, 8, 10, 9, 9, 10, 8, 11, 7, max(ceil((54 - r)/6), 1)),
      switch(r, 1, 36, 2, 28, 3, 22, 4, 17, 5, 13, 6, 10, 7, 9, 8, 8, 9, 8, 10, 7, 11, 7, max(ceil((48 - r)/6), 1)))))

brunobus

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Points/payout formulas - May need a genious for this one
« Reply #5 on: July 11, 2007, 12:54:23 PM »
ceil, huh? well that's a cool little command.  What's the max for though?  it seems that no matter what, the ceil result is going to be more than 1.

I does work though, I just haven't been able to figure out why yet and I think it's because I just don't understand the switch function well enough. 

Quote
For your Overall Score: set your Score formula to be simply:

Code:
p
This will give each player a Score value that is equal to their Points value, for each tournament.  Then set your Overall Score formula to:

Code:
sum(top(10, scores))
You can replace the 10 with how many scores you want to use.  Easy if you know exactly how many tournaments you will play.  If you simply wanted to drop the bottom 2, you could use "s-2" in place of the 10.

Why can't I figure out where to change the score and overall score formulas?  I click on Stats, then Filter, then Tournament Scoring or Overall Scoring, but it doesn't let me change the formula that is defaulted for some reason.  I can highlight it, but not overwrite it.
« Last Edit: July 11, 2007, 02:03:38 PM by brunobus »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6220
    • View Profile
Re: Points/payout formulas - May need a genious for this one
« Reply #6 on: July 11, 2007, 03:31:40 PM »
Those formulas are specific to tournaments of no more than 65 players.  The "ceil((66 - r)/6)" part of the formula would result in a negative number if you happened to have, say, 70 players.  That is, it would result in 0 for rank 66, and negative numbers for ranks 67 and above.  max() returns the maximum of its two parameters.  By giving "1" as one parameter, it assures that it will always return at least 1 - never anything less.  The max(ceil((66 - r)/6), 1) assures that everyone would get at least 1 point.

The first filter is the "Default" filter, and it's there as an example.  It filters nothing (meaning it will include any tournament that it finds).  You can't change anything about this filter.

To change something, create your own filter.
« Last Edit: July 12, 2007, 10:31:13 AM by Corey Cooper »

brunobus

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Points/payout formulas - May need a genious for this one
« Reply #7 on: July 11, 2007, 04:57:13 PM »
Well, duh!!  ;D

I also have this little item called a Pity Seat that I can use the "bottom" command for.

Two PITY seats will be given to the two players who played in at least 8 tournaments and finished with the lowest number of points based on their worst 8 points totals for the year.  Negative point values do not count of course.  If there is a tie in lowest points, then the person who attended the tournaments the most number of times will get the seat.  If there is still a tie, then there will be a random drawing for the seat.

Previously, I was manually loading every months score into Excel and then using the Small function to work this one out for me.

Now I just set up a second overall score, renamed it Bottom 8 and plugged in the command
if(buyinscount>7,sum(bottom(8,scores)),0)
and it's all done automatically for me.