Author Topic: Assistance with the pointsforplaying token  (Read 3355 times)

Skellbasher

  • Newbie
  • *
  • Posts: 4
    • View Profile
Assistance with the pointsforplaying token
« on: December 29, 2006, 07:29:54 PM »
Happy holidays all!! After using a version of TD back in the 1.x days, I recently rediscovered it, and bought the 2.2 version for use in an upcoming league. (GREAT product Corey!! Well worth the price!!)

I've got a question about the display of league points. Some previous posts have somewhat answered my questions, but I still have a few.

Some setup. Our league has decided that for 2007, when a player buys in, they have the option to toss in an additional $2 to earn points for that game in addition to the cash that's up that evening. A player can still play in our game for the night without this extra $2, but they'll simply earn no points.

To that end, I setup TD with a buy-in value of $22, and a per player rake of $2. When we buy a player in and they choose to play for points, we're all set. If a player doesn't want to play for the points, we change the buy-in to $20 with no rake. I built our points formula with as :

if(tr=2,{actual points formula still in discussion},0)

This works perfectly in mock tourneys that I've run so far.

While working on layouts, I decided to show two things, and here's where my questions come in.

1. Pre-tournament, show a list of the current point totals a player would win per final position. From my reading, it seemed like the pointsforplaying token would accomplish this. Our points formula is going to be position based only, with no bonuses, so the calculation should be right on.

However, I am unable to get this token to display anything but '0.00' for every position, regardless of what tournament state I try to view it in.

2. Post-tournament, I wanted to have two sections. First would be the normal cell showing cash prizes, and the second would be a list of all players who participated and their earned points for that tournament only. I am not having any success showing the totals earned for anyone.

And to summarize, the points displayed on the player rankings screen are correct under all circumstances.

So, my questions.

1. Could someone provide some help in the proper usage of the pointsforplaying token to display this data, if what I'm trying to do is possible?
2. Some of what I've read leans me toward thinking that a complete list of earned points won't be possible until the extended rankings token comes in. Am I correct in stating that I can't do this now, or is there a way I haven't come across yet?

Thanks for the help in advance!!

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5428
    • View Profile
Re: Assistance with the pointsforplaying token
« Reply #1 on: December 29, 2006, 10:11:26 PM »
The <pointsforplaying> token works like the Points for Playing dialog on the Game tab of the Settings page.  It only displays what points might be for any given ranking, based on your formula.  Only the "numberOfPlayers" variable is taken from actual tournament state.  The other variables all are player specific, so you must set them in the <pointsforplaying> token, and they will be the same for each rank.

Now, why it shows 0.00 for each rank I cannot be sure.  Why don't you post the actual token you are using in your layout?

For part 2, the <rankings> token is what you will want to use.  It currently does not display points, but in the next version of the software it will.

Skellbasher

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Assistance with the pointsforplaying token
« Reply #2 on: December 30, 2006, 11:09:06 AM »
Corey-

Thanks for the response.

The actual token I'm using is:

<pointsforplaying orient="vertical" ranks="1-10" totalRake="2">

For comparison , I loaded the sample tournament provided with the distribution, and inserted a new cell into the pre-tournament layout containing this token. Leaving all 45 players bought in, but not running the tournament, I still show 0.00 for all ranks

Kinda of a last ditch idea, I installed TD on my laptop and tested it there with only the sample tournament. My workstation is running an AMD64, and while I'm running 32-bit WindowsXP, always a possibility of something there. Laptop is a P4, same thing on that machine.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5428
    • View Profile
Re: Assistance with the pointsforplaying token
« Reply #3 on: January 05, 2007, 10:52:28 AM »
Sorry for leaving you hanging ... I was on vacation.

Ok, I've had a chance to take a closer look at the token and here is the deal.

(1) The numberOfPlayers variable is set to the total number of entries in your tournament.
(2) The buyinCost variable is set to the current buy-in cost of the tournament.
(3) All other variables are set to the value you specify in the token.
(4) *Only* the long variable names are currently set, and herein lies the issue.  So, numberOfPlayers is set, but n is not.  So, if your formula is n-r+1 for example, you will not get a valid result.  If you change the variable to numberOfPlayers - rank + 1, you should see the expected values.  I'll fix this for the next release.

Note that this represents an issue only with the <pointsforplaying> token.  There is no issue with the Points for Playing field or formula.

Skellbasher

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Assistance with the pointsforplaying token
« Reply #4 on: January 05, 2007, 05:10:44 PM »
Not a problem Corey, the vacation was a better choice!!

Glad to see you could figure it out, although I apologize for creating more work for ya!!

Thanks for tracking it down, I can actually see some benefits for spelling out the full variable names while creating some more complex formulas.

EDIT: While fiddling with my test tournament, I noticed something else minor I thought I'd mention. When viewing the result in the layout, the point totals for ranks that don't currently exist are still calculated and displayed.

For example, my current points for playing formula is :

if( totalrake=2, log((numberOfPlayers+1)/rank)*10 , 0)

[ I added the 10x multiplier simply for appearances sake. A couple of the guys complained that the point totals seemed too 'low', so I just multiplied everything by 10 and decided to be done with it. :) ]

For my test tournament, I have 4 players that I buy in.

So, with the layout using : <pointsforplaying orient="vertical" ranks="1-10" totalRake="2"> , I now see data and correct point totals for ranks 1 through 4, BUT I also see ranks 5 through 10 with point totals that are mathematically correct, but don't make sense.  (IE, how can someone end up with rank 8 in a 4 man game?)

It's easily mitigated by changing the formula to :

if( (totalrake=2) && (rank <= numberOfPlayers), log((numberOfPlayers+1)/rank)*10, 0)

The rank check doesn't really affect the final points calculation, since in that case rank can never be larger than numberOfPlayers, but it allows for a more correct point display from the token.

Do you think it's worthwhile to extend pointsforplaying to ignore ranks that can't exist , or is it not worth the effort?

Thanks again Corey.
« Last Edit: January 05, 2007, 05:39:56 PM by Skellbasher »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5428
    • View Profile
Re: Assistance with the pointsforplaying token
« Reply #5 on: January 06, 2007, 11:47:42 AM »
It can also be fixed by changing the token to: <pointsforplaying orient="vertical" ranks="1-4" totalRake="2">

Note that it's just doing what you told it to do, which was display the theoretical points for playing for ranks 1 through 10.  It certainly can't know that someone else might or might not buy-in after the tournament has started...

But I can see a small addition, perhaps using ranks="1-n", which would display ranks 1 through however many players have currently entered the tournament.

Skellbasher

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Assistance with the pointsforplaying token
« Reply #6 on: January 08, 2007, 12:37:48 AM »
Makes sense. Didn't doubt the data that was displayed at all ; it was correct for what I was asking for from the token. The slight change you suggested I think works well. Not sure how much help it is to others, but personally, I'd put it far down your list. Should be able to live with a few extra zero's on screen if we're short one night. :)