Jump to content

Recommended Posts

Does anyone have experience with tournament brackets?? I have spent 5 weeks working out the filling logic for single elimination and have it working fine up to 16,384 players per tournament. which frankly is way more than a php program will permit with a standard setup.

 

But, when it comes to displaying the bracket, it works fine for up to 16 players, but then starts to break and display player distances incorrectly... i could do with some quick advice on the math for the display a) the offset from the top per round for the games b) the calculation of distance between the 2 players in a game per round c) the calculation of the distance between each game per round

 

what I have is this, it works and displays nice for 16 players or less:

 

for ( $r = 1; $r <= $num_rounds; $r++ ) {

    // display code here

    // variable increments
    $top_offset = ( $top_offset + ( $player_dist / 2 ) ) + ( $player_height / 2 ); 
    $game_dist =  ( $player_dist * 2 ) + $player_height;
    $player_dist = ( $player_dist * 2 ) + $player_height;
}

 

I have attached an 2 images. The first is a full 16 player bracket. Looks nice! The second is the bottom section of a 64 player bracket where you can see the positioning is all getting messed up the further down it goes.

 

 

[attachment deleted by admin]

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.