Author Topic: Help with the formula in TD  (Read 1814 times)

DragonII

  • Newbie
  • *
  • Posts: 37
    • View Profile
Help with the formula in TD
« on: February 17, 2008, 11:51:49 AM »
Hi!

Wondering how i can get those formula like:
Rankpoints = "Postionplace-factor" * "Prizepool-factor" * "Number of player-factor"

This 1 st colum (Postionplace):
Winningplace  Factor
1st                150
2nd               120
3rd                100 and more to 9th place

2nd colum (Prizepool):
Prizepool              Factor
=> 2400                2
2500<=>9900       3
10.000 and higher   4

3rd colum (Number of players):
Players            Factor
=>24                1
25<=>49          2
50=>               3

Example:
A player came 1st place and there was 61 players and 6100 in prizepool:
150 * 3 * 3 = 1350 points

Other player came 4th get that point:
80 * 3 * 3 = 720 points.

Another example:
A player came 3rd place and had 11 players, 1100 in prizepool:
100 * 2 * 1 = 200 points.

How should i make that in TD?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Help with the formula in TD
« Reply #1 on: February 18, 2008, 11:15:26 AM »
if(r == 1, 150, if(r == 2, 120, if(r < 10, 100))) * if(pp < 2500, 2, if(pp < 10000, 3, 4)) * if(n < 25, 1, if(n < 50, 2, 3))

There are issues with what you described:

1 - your example shows that a 4th place player gets 80 points ("position place"), but your description doesn't show what 4th through 9th places should get.  I assumed 3rd through 9th gets 100, based on your text.

2 - "position place" will be 0 for anyone ranking 11th or higher, which means they will get 0 total points.  Is that what you want?

3 - your "prize pool" section has gaps in the ranges.  I assume your buy-in is 100, so the prize pool will be an even multiple of 100.

DragonII

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Help with the formula in TD
« Reply #2 on: February 18, 2008, 05:43:22 PM »
Thank you! Figured out for 4th to 9th place.

if(r == 1, 150, if(r == 2, 120, if(r == 3, 100, if(r == 4, 80, if(r == 5, 70, if(r== 6, 60, if(r == 6, 50, if(r == 7, 40, if(r==8,30, if(r==9,20)))))))))) * if(pp < 2500, 2, if(pp < 10000, 3, 4)) * if(n < 25, 1, if(n < 50, 2, 3))

Sorry, i didnt told about 4th to 9th place. but there are formula. From >10th gets 0 points. And that are correct.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Help with the formula in TD
« Reply #3 on: February 18, 2008, 06:10:14 PM »
You have got a bug in there: 6th place has been awarded twice.

DragonII

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Help with the formula in TD
« Reply #4 on: February 19, 2008, 09:52:28 AM »
darn. lol. u have right. Maybe u need whack at me with a sledgehammer? heh heh.

Anyway, it should be r==6 ,60 then r == 7, 50, r==8,40, and more.

Done fixed there. Thank for a quick looking! ;)
« Last Edit: February 19, 2008, 09:54:33 AM by DragonII »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Help with the formula in TD
« Reply #5 on: February 19, 2008, 09:58:10 AM »
FYI, you could make it a tad simpler by using "switch()":

switch(r, 1, 150, 2, 120, 3, 100, 4, 80, 5, 70, 6, 60, 7, 50, 8, 40, 9, 30, 0) * if(pp < 2500, 2, if(pp < 10000, 3, 4)) * if(n < 25, 1, if(n < 50, 2, 3))