summerpewp Posted November 21, 2009 Share Posted November 21, 2009 Is making a double elimination tournament style bracket system capable of being done in php? After dealing with numerous very well qualified programmers to only turn down the project due to difficulty or lack of a solution I am curious if anyone has figured this out. I have run across a few sites that have some programs but all turn up to have some issues with the pairing of teams. Please let me know! If you know the solution, we can work something out as far as payment. This is not a looking for work post, but merely a "can it be done" and if so and you are willing to share the info, it would be greatly helpful. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/ Share on other sites More sharing options...
Cardale Posted November 21, 2009 Share Posted November 21, 2009 I am working on a system such as this if I understand you correctly. PM me. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962370 Share on other sites More sharing options...
genericnumber1 Posted November 21, 2009 Share Posted November 21, 2009 Nearly anything that can be done server-side is doable with php as it is turing complete, including tournament systems. We can help you figure out how to make it if you work to make it yourself and ask small questions as you go (things like "how do I do it?" are unlikely to be answered). If you feel like asking someone to make it for you, hop on over to the freelance forums to ask for someone to help you there. I'd refrain from going into too much troubleshooting over PMs as it takes away from the general knowledge available and because it is against the rules (for the before mentioned reason), not that you would get in trouble for it. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962408 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 I personally am not qualified to program this. I do not have enough experience with php. The programmers I have all ran into the same problem with the pairing of the losers bracket on the number of players not being a factor of 2 (which makes a perfect bracket) 2, 4, 8, 16, 32, 64, etc. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962550 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 Bump, just curious if there is any mathematical formulas for this? That would give me a large step forward! Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962777 Share on other sites More sharing options...
cags Posted November 21, 2009 Share Posted November 21, 2009 The way I understand a double elimination tournament is that you start with x amount of teams (with x being equal to a power of 2), those teams all play a match so you have x/2 matches. The winners form the upper/winners bracket and the losers form the lower/losers bracket. They then proceed like two independent single elimination tournaments untill dwindled down to a winner of each bracket. I know from back when I used to participate/follow e-sports the 2 winners would then play each other, with the team from the lower bracket needing to win two and the team/player from the upper bracket only needing one. Whether thats standard I don't know. If the number of teams is not a power of 2, then you introduce a random bye in the first round, after than point there should be a multiple of 2 teams left in the tournament. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962787 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 Yeah you have a general understanding. It is only complicated when you start issueing the bye's (people who sit out due to not having anyone to play, which is also used to re-balance the brackets) For example, with 5 players, it would look like this: Team 1 -- Team 1 -- Team 2 -- Team 3 Team 3 -- Team 4 -- Team 3 -- Team 4 -- Team 5 -- Now this seems easy and is very easily done in single elimination. But when you move to double elimination it gets more complicated. I have the single elimination done, but once it gets to double elimination , thats where it all goes crazy. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962794 Share on other sites More sharing options...
Gem Posted November 21, 2009 Share Posted November 21, 2009 I cant help with programming as I dont have a club ... but I do run tournaments (judo) using the double elimination system, so I might be able to help help you understand how it works ... PM me if interested Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962798 Share on other sites More sharing options...
cags Posted November 21, 2009 Share Posted November 21, 2009 I see what you mean, it does get a bit more complicated when the numbers aren't x^2. I've not sat down and worked it out, but does it work if you pad the fixtures with BYES? Looking at your diagram I don't think it does, as you appear to play the fewer game earlier to pad the later fixtures which makes more sense. I'll think about it see what I can come up with. Seems like the kind of thread Daniel0 might chip in on, he tends to be pretty good on the maths. Round 1 1. Team 1 v Team 2 2. Team 3 v Team 4 3. Team 5 v BYE 4. BYE v BYE Round 2 Upper 5. (Team 1 or Team 2) v (Team 3 or Team 4) 6. Team 5 v BYE Lower 5. (Team 1 or Team 2) v (Team 3 or Team 4) 6. BYE Etc. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962805 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 well another factor into the losers bracket is it doesn't look anything like the winners bracket. the top half looks standard ... 1 winner 1 loser that that winner plays another winner.... but when you get to the losers half 1 loser plays 1 loser, 1 is eliminated. That loser moves foward, and plays another loser, not the one that wins the next match.. but instead the next loser in the winners bracket. It gets VERY complicated at this point.... now factor in the bye's, and game is over! heh, thats where it gets insanely complex and hard to manage with code. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962808 Share on other sites More sharing options...
cags Posted November 21, 2009 Share Posted November 21, 2009 Oh crap yer, your right, I forgot to factor in the fact that the loser from the upper bracket gets dropped down to the lower bracket For another chance. Double eliminations are a little foreign to me as they aren't really used in any (common/well known) tournaments here. The only reason I had a vague idea of what your talking about is because of Counter-Strike. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962812 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 After a year of searching for a programmer capable of doing this and all of them not finding a solution I posted here in the hopes that someone here knows a solution or could help figure out the problem everyone was running into. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962815 Share on other sites More sharing options...
Gem Posted November 21, 2009 Share Posted November 21, 2009 1/4 final semi final Final team 1 team 1 team 5 team 1 team 3 team 3 team 7 team 1 team 2 team 2 team 6 team 2 team 4 team 4 team 8 FIGHT FOR 3rd PLACE team 5 team 5 team 7 team 4 team 4 team 6 Team 3 team 6 team 8 team 3 team 3 This is how to seed players ... if your not that bothered, then u can put them in randomly ... but following the numbers, any byes go in the last numbers, i.e. if you have 7 teams, them "team 8" would be a bye. Every team gets at least two matches. Teams 3 and 4 drop down into the second round of the losers as semi finalists. This is for 8 teams, but I can go up to 64 teams. Hope that helps a little bit xxxx PS: Team 1 - Gold Team 2 - Silver Team 3 - Bronze Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962819 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 that example shown there is not for double elimination ... that is simple a ranking system to show the 1st, 2nd, 3rd, 4th places in a single elimination tournament. This i am not having a problem with... Double elimination, where each player has to lose 2 times to be kicked out... Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962822 Share on other sites More sharing options...
Gem Posted November 21, 2009 Share Posted November 21, 2009 You do have to lose 2 fights to be out ... trust me, it happens to me all the time!! Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962823 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 now factor in a bye for the losers bracket.... that is where i get lost... i can manually draw them no problem and run these tournaments, but the coding behind this mechanic is what is the issue. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962826 Share on other sites More sharing options...
Daniel0 Posted November 21, 2009 Share Posted November 21, 2009 Is making a double elimination tournament style bracket system capable of being done in php? Semi-off-topic: PHP is Turing complete, so yes, you can. Anything you could write in another programming language, you could write in PHP. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962828 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 that being said, are there any other programs out there that do this? I haven't found any myself... I lied... http://www.northbyte.com/index.php?lang=eng&page=tourneymaster seems to do it... but i haven't been able to find an open source one Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962831 Share on other sites More sharing options...
cags Posted November 21, 2009 Share Posted November 21, 2009 I could be wrong but it seems to me there is at least some kind of difference between the type of 'double elimination' you are both (gemmerz and summerpewp) talking about. @gemmerz - Your version assumes that once you are in the lower bracket the highest result you can expect is silver. @summerpewp - Your version means that you can still win even from the lower bracket. Technically the logic probably isn't that different to start with, they both seem to act the same, but there is a slight difference at the end. By the way, search google for 'double elimation software' and you'll find there are programs that do it. I still need to get round to adding single elimination support to my pool league site, keep putting that off because I'm not sure how it will fit in with what I already have. If I get bored tomorrow I might have a look at this again see what I can come up with. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962838 Share on other sites More sharing options...
Gem Posted November 21, 2009 Share Posted November 21, 2009 now factor in a bye for the losers bracket.... You dont get a bye in the losers bracket ... all the byes happen in the top bracket. I'll leave it at that, was just trying to help :-\ Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962839 Share on other sites More sharing options...
Gem Posted November 21, 2009 Share Posted November 21, 2009 The highest result you can get if u lose a match is 3rd. To win, you have to win every fight, to get silver, you can only lose to the winner. Its the only fair way, other than pools. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962840 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 in a normal double elimination, that i'm aware of... you have to lose 2 times before you are eliminated from the tournament. If you lose the first game just because you aren't warmed up or what ever, you still have a chance to prove yourself. If you end up making it to the winner of the losers bracket, you face the winner of the winners bracket. If the losers bracket wins there is another face off since it is double elimination the person in the winners bracket has a chance to prove himself one more time. If he loses again, the obvious winner should be the person who just started off weak. You can not issue all the byes in the winners bracket accurately enough to do double elimination, because those who are not on a bye still have to play... and that means there is going to make the losers bracket uneven. Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962844 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962845 Share on other sites More sharing options...
Gem Posted November 21, 2009 Share Posted November 21, 2009 You do it whatever way you want to mate, my way is the fairest way which is why it is used internationally. If you dont get warmed up for your first fight, thats your fault, bronze or nothing!! If you do it my way, all the byes are in the first bracket. Much easier, Much fairer ... http://www.britishjudo.org.uk/competitions/guidancedocs.php Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962847 Share on other sites More sharing options...
summerpewp Posted November 21, 2009 Author Share Posted November 21, 2009 yeah, just 2 different versions, thats not the debate of this topic The main reason I am posting is to know if there is a way or any one know of a source of this that can be easily reviewed to program a working auto-generating bracket system for double elimination. It seems to be a complex code for every programmer i have managed to get my hands on to do this project. They all stop when it comes to this part because its over their heads. Now these programmers are good and can code fairly well, but can't wrap their heads around this part not sure what the problem is... Quote Link to comment https://forums.phpfreaks.com/topic/182363-tournament-brackets-double-elimination/#findComment-962850 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.