The Tournament Director Forums

Main => Help Me => Topic started by: CruiseLite on January 28, 2007, 05:22:14 PM

Title: Error in points on Stats tab
Post by: CruiseLite on January 28, 2007, 05:22:14 PM
Hi Corey,

Think I may have found a bug in how the stats tab calculates total points?? Been using the software for over a year now without problems but we've just started using a "Points for playing" formula this year. We used Excel last year and calculated every thing there so don't know if this existed already.

Here is my situation.
The "Points for playing" formula, when tested, displays the correct total points earned for a given player. When I export the tournament to StatsGenie the correct points are exported. Actually, thats why I noticed an anomaly. As I was comparing point totals there to what the Stats tab showed in TD there was a difference. Closer checking seems to show that the point differences are related to any tournament that gives points to 5th position (if in the money).

Here is the formula I use:
((n-r)+1)+(if(r=1 and m,n*.4,0)+if(r=2 and m,n*.2,0)+if(r=3 and m,n*.1,0)+if(r=4 and m,n*.05,0)+if(r=5 and m,n*.025,0)+if(r=6 and m,n*.0125,0))+nh*.5

As you can see, each position gets a bonus if "in the money". The differences I'm seeing are exactly the bonus amount calculated for 5th place when in the money. We have not paid out 6 positions so don't know if that is a problem or not. I went through and compared total points in TD Stats to Statsgenie for every player and the only difference is the 2 tournaments I've had that paid 5 places. All players points who were in the money for 1-4 positions seem to be fine.

Here's an example:
Player Joe has played 6 tournaments. StatsGenie shows 81.78 total points. TD shows 81.2 on the "Stats" tab. The difference is exactly this players point bonus for his 5th place money win (23 players start, Joe was 5th and knocked out 1 player) - 23*.025=0.58 (.575 rounded up to 0.58).  81.78 - 81.2=0.58.

If you need any more info or need any of my game files just let me know. I'm glad to help any way I can.


Title: Re: Error in points on Stats tab
Post by: Corey Cooper on January 28, 2007, 09:15:17 PM
Sooo, you're saying that the points are correct on the Players tab, but when you run the Stats they don't total up correctly?

And the obvious question first: for the particular tournament, are you sure that 5th place was "in the money"?  That is, there is a prize defined to be awarded to whomever ranks 5th?
Title: Re: Error in points on Stats tab
Post by: CruiseLite on January 29, 2007, 11:32:23 AM
Hey Corey,

Yeah, weird huh?? I definitely have the prize configured properly. The "Prizes" tab shows positions 1-5, the % and the $ amount for both games that paid 5 places.

Now it gets more strange. I was showing a couple of players at work the situation but on my PC at work it shows the correct totals on the stats tab???

If it was just one players points I would think maybe I just was on crack or something  ;D  but to have the only two players that received 5th position points be off seems too weird.

You don't think is has something to do with my home PC's CPU being a Dual Core or something squirrelly like that maybe??
I'm going to recheck on both my laptop used at the tournaments (have not done it there yet)  and my home PC tonight when I get off work and I'll post back then.
Title: Re: Error in points on Stats tab
Post by: Corey Cooper on January 29, 2007, 11:41:01 AM
I switched my development machine to a Dual Core machine sometime last year, so I don't think that has anything to do with it.  Besides, if Intel CPUs had an issue (like they did with the math coprocessors some years ago), I think we would have heard about it by now...

Ok, if you see that the numbers are OK on one computer but not on the other, then I'm going to say that you've got a configuration issue.  It would imply that there isn't a bug in the software.

Check your Stats Filter, make sure it is the same.  Check that you are filtering the exact same set of tournaments.  Use the Info dialog on the Stats page to verify that the same tournaments are being loaded, and the same tournaments are being filtered.  Make sure the tournaments are the same on both machines (maybe one was saved before the tournament was over, and the same tournament on the other machine was saved later after the tournament was "complete").  Narrow it down to the tournament(s) where the player should have received points but apparently did not - is/are that/those tournaments the same on both computers? (ie, are the files identical?)
Title: Re: Error in points on Stats tab
Post by: CruiseLite on January 29, 2007, 10:15:48 PM
Ok, now it gets even more strange!  ???

When I got home and rechecked stats on my PC, the point difference was still there for the 5th place finishers. Through the course of loading played games to double check the prize configuration and refreshing the stats tab, I somehow got the points to be wrong for 5th place players in games that only paid 4 places but now the 2 players that actually did receive a payout for 5th place had their points show correct. I do not know what I did to cause this display and have not been able to repeat it so now I'm back to incorrect points for the 2 prize winning 5th place players.

When the points are wrong for the 2 5th place prize winners then the total points on the Stats tab are off by a negative amount that is exactly the bonus amount for "in the money" (bonus for 5th place not added when should have). When the points were wrong for the 4 5th place non-prize winners then the total points on the Stats tab were off by a positive amount that is exactly the bonus amount for "in the money" (bonus for 5th place added when should NOT have).

All games look to be ok to me, the prizes are configured properly and show up on the Prizes tab. The stats filter is only picking up the 6 games we've played this year. It does find 132 total games with 126 from last year not filtered. There are no unfinished games listed. I also copied the saved games to my thumb drive and then recopied them to my PC and laptop at home. The laptop also showed an incorrect point total when I look at the stats tab on it.

I have no idea what might be wrong. You are more then welcome to look at my saved games if you need/want and I'll try to do any thing you want me to to help figure this out. It is not hindering me too much as I just tell the players to check the StatsGenie site for the points but we miss being able to export a valid HTML page from the stats tab for display on my home page.

Hope I am being clear enough in my descriptions. Again, I'll do what ever you need to help track this down.

Thank you sir!!

Title: Re: Error in points on Stats tab
Post by: CruiseLite on January 30, 2007, 02:37:31 PM
Update - When I got back to work and checked on the work PC using the same files from the thumb drive I did again see the error on the stats tab. I added a note to the game tab to force a game file change then saved. I did this for both games that paid out a 5th place prize. After doing this and reloading the games into the stats tab all seems to be ok???

I'll take those 2 files home and try again. I'll save off the 2 suspect game files I have on the home PC first just in case there is something in them that is a problem for your inspection.
Title: Re: Error in points on Stats tab
Post by: CruiseLite on January 30, 2007, 08:51:12 PM
Corey - I just sent you the requested ZIP file. Thanks for your time on this. :)
Title: Re: Error in points on Stats tab
Post by: Corey Cooper on January 31, 2007, 12:50:02 PM
Very good catch.  OK everyone, take notes, this is how you report a bug.  :-)

Seriously though, your investigation made my investigation into this MUCH easier.  This is some complicated code, and it can be very difficult to set up a test case.  With your help, I was able to get up and going and find and fix the problem in less than 30 minutes.

The code that computes statistics for your currently loaded tournament is also used by the Stats tab to compute statistics for each of the tournaments it loads while compiling the stats.  This threw me off, since a player was getting one Points value with a loaded tournament, and a different Points value when the stats were computed.  The code is the same, so how could it be different?  Turns out, when computing which prizes are "in the money", the code was always looking at the "currently loaded" tournament (instead of the tournament for which it was computing statistics).  Which is why you got "good" stats on the Stats tab when you had loaded one of the tournaments in which a player in 5th place was in the money.

By the way, I also found this could be the case in some chop instances as well, but it looks like no one has hit that scenario yet...

This is now fixed (with the next release).  Thanks for your help, Cruise.

Title: Re: Error in points on Stats tab
Post by: CruiseLite on February 01, 2007, 05:03:47 AM
Cool! Glad to be of assistance.   ;D

So any idea on an ETA for next release?
Title: Re: Error in points on Stats tab
Post by: Corey Cooper on February 02, 2007, 09:36:02 AM
Not yet.