tadhg.com
tadhg.com
 

sfmagic.org Rewrite: Minor Head-to-Head Progress

23:53 Thu 10 Jan 2008. Updated: 02:34 12 Jan 2008
[, , ]

I haven’t had much time to work on the rewrite, because I’ve had some serious computer problems at home—rather than being able to move from my laptop to the faster and more coding-suited (multiple monitors, better keyboard, etc.) desktop, I’m still on my laptop because my desktop is completely unstable and needs to be replaced.

I have made some basic progress towards head-to-head, setting up the table and the attendant infrastructure in Pylons. The columns in the table are now:

match_id
round
player1
player2
wins
losses
draws
tournament_id
resultid1
resultid2

Yes, I decided to keep tournament_id despite the fact that it could be extracted from either of the resultid columns. I added round, which is important because it will allow for determination of streaks, which are always interesting to stats geeks. (Without knowing what rounds matches are, it’s difficult to tell e.g. whether a 2-1 player ended a draft with a two-match winning streak, a one-match winning streak, or a one-match losing streak.)

This will be a fair amount of data, more than the current results table (which it is supplementing, not replacing)—a typical draft will be three rounds and eight players, thus twelve matches. (The same tournament would generate eight result rows, one per player.) That will definitely grow over time, but I think (hope!) that the queries I’ll be running against it will be more straightforward than the ones run against results that ultimately required creating some caching tables.

The most complicated operation I can think of would be to do FIDE- or DCI-style ratings, starting all players at 1600 and progressing from there. I would probably cheat that at least a little and give players the same rating throughout a draft (FIDE do it that way, but the DCI don’t, instead updating rating after each individual match), which would at least allow for caching the player’s rating-at-time-of-tournament somewhere instead of having to generate it from scratch every time (which would require generating the ratings of all that player’s opponents, which would require generating the ratings of all their opponents, etc.)

Hopefully, with the computer problems put aside and some setup done, I’ll make more progress tomorrow.

One Response to “sfmagic.org Rewrite: Minor Head-to-Head Progress”

  1. Niall Says:

    I am disappointed that you chose to store the data twice, since that means you’ll have to do twice the work to keep it /consistent/.

    Thinking of it as being easier on the SQL level is not that useful, since that logic will almost undoubtedly be wrapped in a python object anyway!

Leave a Reply