More prebuilt code: 2012-12-20 16:47:16 |
Fizzer
Level 64
Warzone Creator
Report
|
Unfortunately I don't. The only thing I have is the code that does WarLight's built-in tournaments, and that's written in a different language against a different database so it'd have to be re-written to use in CLOT.
The hope is that players build this stuff (even better than the built-in ones) and share the code so that other people can pick it up and extend it.
It sounds like you already have a handle on how to do a RR. I can give you a short explanation on how you would do a single-elimination tournament.
To the Game table, add two integers: RoundNumber and PositionFromTop. RoundNumber is 0 for all first-round games, 1 for second-round games, etc. PositionFromTop is 0 for the uppermost game of that round, and increments as you go down.
Starting the tournament is easy. Just create all of the first-round games (RoundNumber = 0) and increment PositionFromTop for each one. WarLight matches players randomly, but you may want to seed them based on the previous tournament.
Then, after each game finishes, just check if the game above/below it is also finished. If both are finished, then create the next round game from the winners of those two.
|
More prebuilt code: 2013-01-14 18:50:50 |
unknownsoldier
Level 57
Report
|
Hi Chris - you seen my post about code I put on github? That should be of use to you.
|