How are stats made available to HUD?

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

How are stats made available to HUD?

Postby RiverMeNow » Sat Jul 25, 2009 11:04 pm

Please forgive me if this is a stupid question...

I've noticed that there are some statistics from Holdem Tournament Player Statistics that appear in the HUD list of statistics you can choose, however some of them are not available to be used.

For example: the "Player" stat is available in HUD, but the "Position" stat is not.

Please ignore for the moment that some stats wouldn't make sense in HUD - I can't see where you set a value to say "This is allowed in HUD" or something like that.

How does HUD know which stats it can show and which ones it can't?
RiverMeNow
 
Posts: 38
Joined: Thu May 15, 2008 7:48 pm

Re: How are stats made available to HUD?

Postby WhiteRider » Sun Jul 26, 2009 4:07 am

There isn't a flag/option which says 'this is not available in the HUD' (although there may be something behind the scenes for some built-in stats).
It really comes down to which stats make sense in the HUD - for instance "Position" is used to group reports by position; it isn't built as a 'number of times something happened over all hands' stat/value so doesn't make sense in the HUD. I suspect that it is more to do with the way the SQL for the stat is constructed which means that it doesn't make sense, and therefore isn't available, to the HUD.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: How are stats made available to HUD?

Postby RiverMeNow » Sun Jul 26, 2009 6:46 am

Thanks,

As I said, I realized that particular example didn't make sense - but I'm still wondering how HUD gets it's data, I don't think it's considering how "sensible" something is (if it could it would be berating me over my stupid play :D )

For example the "Player" feild is available even though it isn't a stat.

I've been looking through the holdem_cache table in Postgres and it looks like whatever is there is available in HUD.

So if something gets into that table it appears you can use it.

So my next question would be (if my assumption is correct) is how does PT decide which stats it adds to the cache?

I'm pretty sure I can solve some of the problems of certain stats not being available in HUD by creating an external process that manipulates data in the cache, but for compatibility reasons when upgrading PT it would be better to stick as much as possible within the PT environment I think (although some stuff like joining tables will have to take place outside PT it seems).
RiverMeNow
 
Posts: 38
Joined: Thu May 15, 2008 7:48 pm

Re: How are stats made available to HUD?

Postby WhiteRider » Sun Jul 26, 2009 8:47 am

I don't know exactly what is happening in the code but I think that things like the Player stat are coded specially to work in the HUD.
Any stat which you create in the Holdem Cash Player Statistics section as a 'normal' sum/count of occurences over all hands should work in the HUD.

I'll mention this thread to our development team but they're very busy so please be patient if you don't get an answer immediately.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: How are stats made available to HUD?

Postby RiverMeNow » Sun Jul 26, 2009 7:31 pm

WhiteRider wrote:
I'll mention this thread to our development team but they're very busy so please be patient if you don't get an answer immediately.



Thanks, I understand them being busy.

In the meantime I'll start hacking
(let's see if dev reply before I'm submitting support tickets after I screw up my PT install :D )
RiverMeNow
 
Posts: 38
Joined: Thu May 15, 2008 7:48 pm

Re: How are stats made available to HUD?

Postby WhiteRider » Wed Jul 29, 2009 10:03 am

The general rule is that anything which uses 'Group By' can't be used in the HUD.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: How are stats made available to HUD?

Postby RiverMeNow » Sat Aug 01, 2009 2:24 pm

Thanks for that.

I'm going to start making changes to the holdem_cache table, however it's not mentioned in your documentation.

Is there anywhere I can get some documentation on this - I'm just a little concerned that if I start doing things to this table that weren't expected I could really screw things up - particularly if there are other tables that should be updated when updating this one. Part of what I'll be doing will include adding new colums to this table via Postgres.

Basically, there are a bunch of things I want to do that don't seem possible through the PT interface (like joining tables, adding colums for different types of information) and once I've done those things I want to put some of the results on the screen.

The best way to do this would be using HUD - I could just by-pass PT/HUD altogether and create an additional HUD-like overlay but that would use up too much resources, I'd much rather use your HUD as it's there already.

And if it works out I could share the results with other users on this forum who want some of the types of stats they currently can't get in HUD.

TIA
RiverMeNow
 
Posts: 38
Joined: Thu May 15, 2008 7:48 pm

Re: How are stats made available to HUD?

Postby WhiteRider » Sat Aug 01, 2009 2:45 pm

You will only be able to build custom stats from built-in PT3 database table fields, and you won't be able to display anything else in PT3's HUD.
It is possible that this kind of functionality will be made available in the future, but I doubt it will be any time soon.
Bear in mind that when the cache is rebuilt it will likely undo any changes you have made to the cache tables.
I don't think that any additions you make will cause any problems, but please do not remove anything that PT3 adds.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: How are stats made available to HUD?

Postby kraada » Sat Aug 01, 2009 2:46 pm

Just to give a bit more information:

The holdem_cache table is used to basically streamline the statistics generation process.

Whenever the Update Cache part of Housekeeping is run, PT3 goes through and rebuilds the value of any column needed for any stat for every player, and they're stored by name as columns in the holdem_cache table. So for example, cnt_vpip is the number of times someone had VP$IP at the time the cache was last built (that value is stored in the settings table). Then PT3 adds in a dynamically generated value for the newer hands and sums the two together - doing sums over all hands was too resource intensive previously, which is why the cache was added.

If your computer can handle without running with a cache (and some can), there are a few ways to disable the cache so the holdem_cache table won't be used at all by the HUD, the easist of which is to use the Last X Hands option on the Hud Options tab - if you don't want the actual functionality to kick in, set it to a large number (say, 100000) and that should work fine as well. (The other option is to build a new column, use it in a new custom stat, add it to the HUD and don't update the cache - then PT3 can't use the cache for that one stat, which results in the cache not being used at all.)

I hope that helps; if you still need more feel free to ask :)
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests