News:

**Inspired by recurrent discussions in FIBS shouts on issues concerning science and consciousness, we have introduced an ISP Board on Fibsboard.com ...a space set aside for more considered esoteric meanderings on ideas science and philosophy --- "concept formation and elucidation" .....> the philosophy/physiology/ structure and function of a fibster or fibsboarder!
take a look at http://www.fibsboard.com/ideas-science-and-philosophy/

Main Menu

tbot website integration

Started by tryout, April 10, 2004, 03:25:32 PM

Previous topic - Next topic

tryout

In the last poll for tbot features website integration was quite high on the list. I can offer at least the most important part of it.

Some will remember the webpage where the bracket for Fridays3 was displayed in a graphical way. Before Fridays3 was run with tbot I wrote a programme to help Kari and houtx manage the bracket building and collection of match results.

So far it wasn't possible to use this programme since tbot didn't generate correct brackets. But now that tbot (probably) uses the same algorithm like my programme the brackets should be compatible.

Well, I'll describe how it would work:

The setup of a tournament remains untouched. After player registration when the tournament is started tbot will implicitly call a web page with the list of players and some additional data like title, TD names and tournament description. The programme on the website generates a graphical representation of the bracket and publishes it on a web page so that every player can look at it.
It should also be possible to start this action manually by entering a command (as a TD), i.e., "publish <tourney number>". At the moment only one bracket can be displayed at the same time. So a subsequent tournament will overwrite the last bracket. Usually, this is no problem since the short time tournaments are then finished anyway and normally not run concurrently. For the other cases the "publish" command comes in handy. Any time that the bracket of a long duration tournament gets overwritten by one that started later, the TD can just issue the command and the bracket gets regenerated. On the other hand, a long time tournament should have an own web page anyway.

Technical: The data communication for this is nothing more than a simple HTTP GET request, thus just opening a socket and sending a text string, which is what tbot does all the time. The details like value names, URL and exact formats we'll have to sort out privately between MadMatt and I.

For an example bracket please see: http://storm.prohosting.com/gnubg/FIBS/
GammonLeague -- Join free Backgammon tournaments
[size=8] [/size]
FIBS TEAM League -- Play Backgammon with friends in a team

alef


diane

I was thinking - and i know this has been skirted around before - could we have a website that displayed all the tournament winners.  Then a kind of prize for the winner would be 'their name in lights'.  I wondered if it would be a lot more work to extend this work to cover that too?
Also was going to volunteer to do this long hand in the mean time (ie type in the weeks winners, once a week) - if we got some space for it now.
Never give up on the things that make you smile

webrunner

i can provide the space, that is no problem at all.
If Tryout privides the script, i can put it somewhere and dress it up to fit in the board.

It would be nice if the names where clickable and pointed to their profile in fibsboard wouldn't it?
"There is a difference between knowing the path and walking the path."
Bruce Lee
===================================
Orion Pax |

diane

Yes - that would be nice - and as i say - if it is set up soon - and the bot isnt ready to do it automatically - i can do it the hard way for a bit.
Never give up on the things that make you smile

MadMatt

I dunno about this, there are several problems with it. Tryout himself mentions the first one - only one tourney could be displayed at a time.

In addition, I don't quite think TourneyBot generates the bracket exactly the same way as that javascript page does. Tryout, when there is an odd number of matches in the first round (let's say 3, for example), does your page put 2 matches in the upper half of the bracket and 1 in the lower or vice versa?

Secondly, this thing is not general enough. It only works for single elimination bracket tourneys. I will start working on double elimination very soon and then other types of competitions as well.

Thirdly, while tryout's page visualises the brackets neatly, I somewhat prefer the HTML-table style (the kind that burper posts here) for several reasons, most importantly because you can fit more information in a table cell than in the kind of layout tryout uses.

Now, we have really already worked out how generating HTML pages will work. I refer you to the Webspace for moderators topic, especially this post.

Tryout, if you're willing to help with that, I'd be more than glad of it.

Cheers,
MadMatt
----------

TourneyBot Website

tryout

Quotei can provide the space, that is no problem at all.
If Tryout privides the script, i can put it somewhere and dress it up to fit in the board.
Thanks for your offer. You'd need Perl installed and Apache CGI enabled, however. Actually, the script is ready to run on the same webpage that Fridays3 used before tbot.
Btw, it's capable of both generating a static page for subsequent viewing via a different URL (minimizes server load) and on-the-fly generation.

QuoteIt would be nice if the names where clickable and pointed to their profile in fibsboard wouldn't it?
Sure, no problem if you provide me with the details of the URLs to the profiles. Does the URL-showuser-value also accept player names instead of the numerical index?
GammonLeague -- Join free Backgammon tournaments
[size=8] [/size]
FIBS TEAM League -- Play Backgammon with friends in a team

tryout

QuoteI dunno about this, there are several problems with it. Tryout himself mentions the first one - only one tourney could be displayed at a time.
It shouldn't be a real problem to extend it for multiple tournaments. But IMHO it's not even necessary for the reasons I already stated. People just want to have an _easy_ way to see who their next opponents are and get a quick visual overview of the tournament that is currently running.

QuoteIn addition, I don't quite think TourneyBot generates the bracket exactly the same way as that javascript page does.
The current version is a CGI script written in Perl, but uses the same algorithm like the source I was pointing you to some time ago.
It's quite easy to check whether both programmes build identical brackets. Could you generate brackets for a player count from 3 to 32 with an ordered player list as input (that is, numbers from 1 to e.g. 32)? Then we can simply compare the brackets.

QuoteTryout, when there is an odd number of matches in the first round (let's say 3, for example), does your page put 2 matches in the upper half of the bracket and 1 in the lower or vice versa?
Two in the upper half. But actually it should neither way make a difference. If they were in the lower half one could simply revert the initial player list. The following brackets are after all identical:

1 \_
2 / \_
3 --/

3 --\_
2 \_/
1 /

and even this one:

3 --\_
1 \_/
2 /

QuoteSecondly, this thing is not general enough. It only works for single elimination bracket tourneys. I will start working on double elimination very soon and then other types of competitions as well.
But where's the problem? Right now there are only single elimination tournaments. If we'll have found an algorithm or rules and there is a new tournament format I can implement this as well. The algorithm for creating the graphical bracket will need to be written in any way.
I don't think there is a general solution since every new tournament format requires new coding. And even if there really was a general one, there's none right now.

QuoteThirdly, while tryout's page visualises the brackets neatly, I somewhat prefer the HTML-table style (the kind that burper posts here) for several reasons, most importantly because you can fit more information in a table cell than in the kind of layout tryout uses.
The first is obviously a matter of taste. And to the second: which more information that should not be possible to fit into my layout?
Btw, imho the line style makes one's way through the tournament far clearer.

QuoteNow, we have really already worked out how generating HTML pages will work. I refer you to the Webspace for moderators topic, especially this post.
I was including the last part because I remembered you saying that tbot would have to re-implement the logic of a webbrowser for calling up a webpage, when I suggested something along these lines some time ago.

QuoteTryout, if you're willing to help with that, I'd be more than glad of it.
Well, depends. My time is limited and also the point is that what I'm suggesting is ready to use right now. I even have the webspace available. The script was set up long ago and I just made some small modifications so tbot could use it, too. And as I was pointing out the necessary implementation in tbot is almost trivial.
GammonLeague -- Join free Backgammon tournaments
[size=8] [/size]
FIBS TEAM League -- Play Backgammon with friends in a team

webrunner

I will have to agree about the clarity with tryout.. the lines are better imho.

I can provide space if neccesary, both servers got apache with cgi, perl and cpan installed. So if more perl modules are needed it can be arranged.

A users profile can not be called with the username, but you can do a serach in the memberslist on the username. I think that may be best since not all players have a fibsboard account.

On the other hand.. some people have a different name here on the board then on fibs, wich makes it even more complicated.

I am still looking for a way to connect the accounts of this board and the fibs accounts. That would be best, also for future enhancements and integration of more features with fibs, TB and fibsboard.
"There is a difference between knowing the path and walking the path."
Bruce Lee
===================================
Orion Pax |

jinnate

QuoteI am still looking for a way to connect the accounts of this board and the fibs accounts. That would be best, also for future enhancements and integration of more features with fibs, TB and fibsboard.

what would you need in order to be able to do that?

webrunner

someone with php programming skills and time :)
"There is a difference between knowing the path and walking the path."
Bruce Lee
===================================
Orion Pax |

tryout

QuoteA users profile can not be called with the username, but you can do a serach in the memberslist on the username. I think that may be best since not all players have a fibsboard account.

On the other hand.. some people have a different name here on the board then on fibs, wich makes it even more complicated.

I am still looking for a way to connect the accounts of this board and the fibs accounts. That would be best, also for future enhancements and integration of more features with fibs, TB and fibsboard.
I think it should be done within fibsboard. Parsing the html output isn't really elegant. The best (and imho only) way is probably to write a php function that gets the user id for a user name or outputs some HTML error that this user name doesn't exist on Fibsboard. Then any external application or link on a webpage will just call index.php?showuser=userXY.

If you need this, please contact me privately. I'd have to know the appropriate db table names and such.

On the other hand... just tried a few things. We could simply use what's there already:

http://www.fibsboard.com/index.php?act=Mem...ins&name=tryout

But this doesn't show the profile directly.
GammonLeague -- Join free Backgammon tournaments
[size=8] [/size]
FIBS TEAM League -- Play Backgammon with friends in a team

webrunner

QuoteI think it should be done within fibsboard. Parsing the html output isn't really elegant. The best (and imho only) way is probably to write a php function that gets the user id for a user name or outputs some HTML error that this user name doesn't exist on Fibsboard. Then any external application or link on a webpage will just call index.php?showuser=userXY.

If you need this, please contact me privately. I'd have to know the appropriate db table names and such.

On the other hand... just tried a few things. We could simply use what's there already:

http://www.fibsboard.com/index.php?act=Mem...ins&name=tryout

But this doesn't show the profile directly.
Of course the neatest way would be to have a fibsboard fibs account that logs on to fibs and does a whois on a username.

But we've seen with the status script that speed is a big problem there.
Also we have to be carefull not to put to much load on the fibs server since Patti might ban the fibsboard account in case of exessive whois requests.

So it is probably easiest to use the search as you suggested in the last lines.

or do you have any other ideas?
"There is a difference between knowing the path and walking the path."
Bruce Lee
===================================
Orion Pax |

tryout

QuoteOf course the neatest way would be to have a fibsboard fibs account that logs on to fibs and does a whois on a username.

But we've seen with the status script that speed is a big problem there.
Also we have to be carefull not to put to much load on the fibs server since Patti might ban the fibsboard account in case of exessive whois requests.

So it is probably easiest to use the search as you suggested in the last lines.

or do you have any other ideas?
Ah, I didn't realize you wanted to check the username on FIBS. I simply assumed you had a/the username from whereever and would only like to provide a link to fibsboard for convenience. Since one can't be sure that the same user also exists here, the function or the search will have to return an error if it doesn't.

What (other) purpose did you have in mind for this feature?
GammonLeague -- Join free Backgammon tournaments
[size=8] [/size]
FIBS TEAM League -- Play Backgammon with friends in a team

webrunner

it gives a lot of possibilities to integrate fibsboard with fibs more.
F.I.  it would be nice if the profile showed a persons current rating.

The sky is the limit. :D  
"There is a difference between knowing the path and walking the path."
Bruce Lee
===================================
Orion Pax |

tryout

Quoteit gives a lot of possibilities to integrate fibsboard with fibs more.
F.I.  it would be nice if the profile showed a persons current rating.
For this a bot would be necessary that is always logged in on FIBS. Else as you already noted, we might get it in the neck from Patti if the account logs in and out all the time.
GammonLeague -- Join free Backgammon tournaments
[size=8] [/size]
FIBS TEAM League -- Play Backgammon with friends in a team

tryout

Quote
QuoteIn addition, I don't quite think TourneyBot generates the bracket exactly the same way as that javascript page does.
The current version is a CGI script written in Perl, but uses the same algorithm like the source I was pointing you to some time ago.
It's quite easy to check whether both programmes build identical brackets. Could you generate brackets for a player count from 3 to 32 with an ordered player list as input (that is, numbers from 1 to e.g. 32)? Then we can simply compare the brackets.

QuoteTryout, when there is an odd number of matches in the first round (let's say 3, for example), does your page put 2 matches in the upper half of the bracket and 1 in the lower or vice versa?
Two in the upper half. But actually it should neither way make a difference. If they were in the lower half one could simply revert the initial player list.
I've generated the sample brackets. You can look at them at http://storm.prohosting.com/gnubg/FIBS/03.shtml to http://storm.prohosting.com/gnubg/FIBS/32.shtml

Btw, sorry for the false statement before, if it's 3 players the first has a bye and the match is in the lower half. But as already mentioned this shouldn't be a problem.
GammonLeague -- Join free Backgammon tournaments
[size=8] [/size]
FIBS TEAM League -- Play Backgammon with friends in a team

burper

Those look great, except for one thing: they lack the player names.
I would love to have table cell background images just like that, with cell strings of the player names,
but I don't think you can do it with legal HTML? If there is a way, please tell me, as I am palying around with the bracket tab on the TB GUI just now.

burper

#18
I suppose you could do something like this, which could look pretty good if you tweak the images and colors a bit:

[dohtml]
<table cellpadding="0" cellspacing="0" border="0" align="center">
         <tbody>
                                                   <tr>
                                 <td valign="bottom" halign="center" bgcolor="#ccccff"
height="20" width="78">   name 1

             </td>
             <td valign="top" bgcolor="#ccccff" height="20" width="3">
       

         </td>
        <td valign="top" bgcolor="#ccffff" height="20" width="78">

        </td>
                                                                       
                                                                       
                         </tr>
           <tr>
                                 <td valign="top" bgcolor="#ccccff"
height="20" width="78"><img
src="http://www.fibsboard.com/chouettebot/images/top.png">
           

             </td>
             <td valign="top" bgcolor="#ccccff" height="20" width="3">

             </td>
        <td valign="top" bgcolor="#ccffff" height="20" width="78">

        </td>
                                                                       
                                                                       
                         </tr>
           <tr>
                                 <td valign="top" bgcolor="#ccccff"
height="20" width="78">

             </td>
             <td valign="top" bgcolor="#ccccff" height="20" width="3"><img
src="http://www.fibsboard.com/chouettebot/images/middle.png">
         

             </td>
        <td valign="top" bgcolor="#ccffff" height="20" width="78">   winner
     

        </td>
                                                                       
                                                                       
                         </tr>
           <tr>
                        <td valign="top" bgcolor="#ccccff" height="20"
width="78">

          </td>
          <td valign="top" bgcolor="#ccccff" height="20" width="3"><img
src="http://www.fibsboard.com/chouettebot/images/middle.png">
         

          </td>
        <td valign="top" bgcolor="#ccffff" height="20" width="78"><img
src="http://www.fibsboard.com/chouettebot/images/winner.png">
       

        </td>
                                                                       
                                               </tr>
        <tr>
                                 <td valign="top" bgcolor="#ccccff"
height="20" width="78">   name 2

             </td>
             <td valign="top" bgcolor="#ccccff" height="20" width="3"><img
src="http://www.fibsboard.com/chouettebot/images/middle.png">
         

             </td>
        <td valign="top" bgcolor="#ccffff" height="20" width="78">

        </td>
                                                                       
                                                                       
                         </tr>
           <tr>
                                 <td valign="top" bgcolor="#ccccff"
height="20" width="78"><img
src="http://www.fibsboard.com/chouettebot/images/bottom.png">
   

             </td>
             <td valign="top" bgcolor="#ccccff" height="20" width="3">

             </td>
        <td valign="top" bgcolor="#ccffff" height="20" width="78">

        </td>
                                                                       
                                                                       
                         </tr>
                                                                       
                                     
 </tbody>        
</table>
[/dohtml]

As for TB GUI, I think I will use java.swing.JTable with a couple of custom cell renderers.

burper

#19
Heading in the right direction? Tough getting those lines to line up :)  ...but you get the idea.
Can't seem to close those tiny vertical gaps either, but maybe that's my browsers' fault.
That smudge is just to show how using images in otherwise blank cells could help blend background colors together. You can also tweak the images of the lines instead of using the background colors too, but an artist is needed to do anything really cool with the technique. Basically, you can do anything you want except for the names/text cells which have to have a solid background color

[dohtml]
<table border="0" cellspacing="0" cellpadding="0">
                  <tbody>
                     <tr>
                 <td height="20" width="78" bgcolor="#ccbbff"
align="center" valign="bottom">name 1  </td>
                      <td valign="top" height="20" width="20"
rowspan="2" colspan="1" bgcolor="#ccddff"><img
src="http://www.fibsboard.com/chouettebot/images/top3.png">
             

                     </td>
                     <td valign="top" bgcolor="#ccffff" height="20"
width="78" rowspan="2" colspan="1">

             

              </td>
                            </tr>
                  <tr>
                <td height="20" width="78" bgcolor="#ccbbff"><img
src="http://www.fibsboard.com/chouettebot/images/winner.png">
                 

                    </td>
                           </tr>
                  <tr>
                    <td height="40" width="78" bgcolor="#ccbbff"
rowspan="2" colspan="1"><img
src="http://www.fibsboard.com/chouettebot/images/bbdd.png">
                          </td>
                    <td valign="top" bgcolor="#ccddff"><img
src="http://www.fibsboard.com/chouettebot/images/middle3.png">
         

                    </td>
              <td valign="top" bgcolor="#ccffff" height="20" width="78" align="center" valign="bottom">&nbsp;name
   3

              </td>
                  </tr>
                  <tr>
                               <td height="20" width="20"
bgcolor="#ccddff"><img
src="http://www.fibsboard.com/chouettebot/images/middle3.png">
         

                    </td>
              <td valign="top" bgcolor="#ccffff" height="20" width="78"><img
src="http://www.fibsboard.com/chouettebot/images/winner.png">
             

              </td>
                  </tr>
                  <tr>
                <td height="20" width="78" bgcolor="#ccbbff" align="center" valign="bottom">name 2   </td>
                    <td height="20" width="20" rowspan="2" colspan="1"
bgcolor="#ccddff"><img
src="http://www.fibsboard.com/chouettebot/images/bottom2.png">
               

                    </td>
              <td valign="top" bgcolor="#ccffff" height="20" width="78"
rowspan="2" colspan="1">

             

              </td>
                  </tr>
                  <tr>
                <td height="20" width="78" bgcolor="#ccbbff"><img
src="http://www.fibsboard.com/chouettebot/images/winner.png">
               

                    </td>
                           </tr>
                                                                       
 </tbody>                  
</table>
[/dohtml]