How do we feel about a re-write of Tournament for Drupal 8? Personally I would like the module to have a lot more flexibility as it makes way too many assumptions. We could strip out a lot of the advanced features and just keep the bare minimum for organizing tournaments. Any thoughts on this?

Comments

Eysteinh’s picture

Fenda I would really for a drupal 8 tournament script that has more flexbility. In general there are very few ladder / league scripts out there that allows for fight for all match types or that are fitted for other type of games than mainstream. For example 4x games like Civilization (Having several million players) uses multiplayer concepts like the fight for all, for example with 8 players. For this to work you need a league script that allows 1 player to report say it came in at first place, one came in at second, third etc and then other uses confirming these results. The losses should be distributed with 1st place winning vs everyone else, 2nd place loosing only to 1st place and winning vs rest etc.

Are you still interested in this?

globaltask’s picture

Hi Fenda,
maybe we can give you some help.
How would you like to proceed ?

fenda’s picture

I think a good place to start is that we go through the current Drupal 7 module functionality and see what can be stripped out or generalized.

I think we should try to ensure complete compatibility with:

  • Views
  • Rules
  • Token

The module should only offer the bare minimum which would allow for creating different types of tournaments and matches. I even think we could strip out Teams and open it up to allow any type of entity to be a participant. That way, other modules such as Organic Groups (although no D8 port soon..) could be used instead. Alternatively, someone could create a new content type of Teams with a multi-value user reference field - that is basically the same as what Teams do in our D7 module anyway.

FallenRiteMonk’s picture

Hy,

I'm interested in seing this/such a module on drupal 8. What is the current state of this port? Has any work been done? Is any work going to be done?
Could you please update me on the state.

Thanks and greetings

fenda’s picture

Hey @FallenRiteMonk,

No work has been done yet for a Drupal 8 port and unfortunately I currently do not have plans to start anytime soon. It'd be a big undertaking for sure.

simon_j_nichols’s picture

I would suggest looking hard a the design stage at how to leverage other Drupal modules. One of the things that struck me when I was going through the D7 modules was just how stand alone it all was.

The obvious candidate I would suggest would be a D8 version of Date especially Date Popup API (I think the date field is going to be in core but not sure about the full set of sub-modules), and I am sure there would be other infrastructure and field presentation modules which would add enormous value to the module.

This probably means waiting until we have a stable(ish) D8 ecosystem and I gotta say I am not exactly looking forward to having to learn Drupal 8 object programming.

youkho’s picture

I would love to see this module take some ideas from Tourney module.

nuez’s picture

I would like to help you with the Drupal 8 version but I most likely need your help. I think it's important to first get the architecture right: the entities, bundles, classes and methods that allow us to create any type of tournament (round-robin), here's a start:

Entities

Tournament
Tournament-Match (aka tie, fixture, heat)
Game Match (aka rubbers, legs)
Participants

Tournament entity
- Properties
-- Tournament type
-- Participant
- Fields
-- Title
- Methods
-- generateFixtures
-- generateMatches

Fixture
- Properties/fields
-- Game Match Reference

Match
- Properties
-- Participant Home
-- Participant Away
-- Date
- Fields

Participant
- Properties
- fields
--User reference
--Team title
--Description

Tournament types to be taken into account (not to be implemented necessarily)

fenda’s picture

@neuz We can probably simplify further. Let's think about the bare minimum requirements for this module as a starting point:

  1. Create a tournament
  2. Add participants
  3. Create matches
  4. Add scores
  5. View matches

Based on that, a simple architecture would be:

  • Tournaments and matches as new node content types
  • Custom field for "Participant Type" per tournament. This would set which entity type can be a participant. So out of the box it could be a User or Node
  • Custom field for "Participants" per tournament which stores a list of all participants (i.e. entities)
  • Custom form for a "Create matches" batch process that takes the participants and runs it through an algorithm. Algorithms could be written as plugins so that its easy for users to create their own.
  • Custom field for "Scores" and "Winner" attached to matches.
  • Custom node displays for tournaments. e.g. Bracket or Groups which would render participants/matches appropriately. This is the hardest part and is likely where people require a lot of customization. Do we provide the bare basics or perhaps look to 3rd party solutions to render?

That's my 2 pence anyway!

nuez’s picture

Thanks @Fenda,

I've started development of the D8 version of the module, with the following focus:

  • Tournament is a Content Entity Type (not node!- since it isn't really a node)
  • Participant is a Content Entity Type with base fields for 'wins' , 'lost', 'points' etc, and also an entity reference to a team or user, and a entity reference base field to the tournament
  • Haven't decided yet weather to separate Match and Fixture, or just to have Matches
  • There is a PluginType for Tournaments with an interface with methods such as: processResult, generateLeague, etc. Submodules only need to implement that plugin to create, for example, a round robin tournament type.
  • Implemented Tourament Plugin Instances are at the same time the bundles for the Content Entity 'Tourament'

The idea is to get the general architecture right, so it doesn't matter which workflow we give it, if the objects relate to each other correctly, and the methods and interfaces are there, then we can built the UI around it (and maybe add a RESTful API for uploading scores and all that). About rendering the different brackets, you're right: that could well be the difficult bit, as long as we use the proper theme functions so people can customize themselves, I wouldn't bother to make it look nice.

I hope to upload the first version within the next month or so, I'll keep everyone updated

btriest’s picture

Hello @Nuez and @Fenda,

I see already great progress in the Tournament Module. I think it wil be a great to have this module in drupal 8. To be honest i am just understanding a little bit about the creation of modules in drupal 8 and just started to be part of the drupal-community, but i would like to contribute (testing/documention?) and learn by practice. So if you need help....

olimejj’s picture

How has this project been going? I am using Drupal 8 right now to build a tournament sites and stumbled on this. Once looking at the current progress I may be interested in picking it up and pushing it forward a bit.
Thanks for your help.

fenda’s picture

Hey @olimejj - as far as I am aware there hasn't been any progress made with a Drupal 8 version of this module. You'd be starting off from scratch.

For a slightly less integrated experience, but quicker implementation, you could look into 3rd party services and embed them in your site. Such as BracketCloud or Challonge.

olimejj’s picture

Thanks for the speedy reply! I have looked at Challonge before and I like it however I am looking for an integrated experience. Currently I'm trying this module out in 7 and looking at its features to see if its something I would want to use. I'll let you know if I decided to do anything with it.

nuez’s picture

I'm sorry I didn't follow through with this: I have started development a while ago on github, but nothing elaborate enough to publish as a module,

https://github.com/nuez/tournament

Maybe you can use it as your starting point.

montag64’s picture

Would also be interested in this as well. Any update?