Hello.
We are building an esports platform that allows users to assemble into teams and then compete in tournaments. What I would like to ask is just for some guidance on a method for achieving this with Toolset. We have the team system already set up and ready to go.
1. Now we thought to use post relationship to make teams as children of the tournament so that we know which teams are in each tournament.
2. Teams must now be split into pairs (randomly)
3. After the set of teams compete, the team authors must be able to specify which team won.
4. The winning team must advance to the next round - until there is one winner.
I'm not asking for help to design the system, I would like to ask for ideas and guidance for methods to achieve this (we will write all custom functions needed).
Hello,
1) Now we thought to use post relationship to make teams as children of the tournament so that we know which teams are in each tournament.
In you case, if:
- One team post can connect to multiple tournament posts
- One tournament post can connect to multiple team posts
Then I suggest you try with many-to-many relationship, otherwise, you can setup one-to-many relationship between them.
see our document:
https://toolset.com/documentation/post-relationships/
2) Teams must now be split into pairs (randomly)
In my opinion, you can create another post type "pairs", setup two post type relationships, for example:
- One-to-many relationship "pair-1" between "Teams" and "Pairs"
- One-to-many relationship "pair-2" between "Teams" and "Pairs"
Create/edit each "pairs" post, connect it with two "Teams" posts using above relationship "pair-1" and "pair-2", in your case, you can setup custom codes to create the "pairs" post, and connect the random "Teams" posts(split into pairs randomly)
3) After the set of teams compete, the team authors must be able to specify which team won.
You can add a custom field "win or lose" in post type "pairs", so authors will be able to edit the "pairs" post, and mark the match result
4) The winning team must advance to the next round - until there is one winner.
You can add a custom field "Loser" in post type "teams", when author setup the "win or lose" field, use custom codes to mark the team post as "Loser", so you can setup query to find teams isn't "Loser", then setup new "pairs" posts and connect it with other left "teams" posts.
For your reference.
Hello Luo.
Thank you very much for taking the time to help us think this through. Your suggestions make sense and hopefully soon we'll be on the road to a working tournament application.
Have a wonderful day further.