zengm-games / zengm

Basketball GM (and other ZenGM games) are single-player sports management simulation games, made entirely in client-side JavaScript.
https://zengm.com
Other
350 stars 126 forks source link

More than 2 conferences #323

Open mamamia5x opened 3 years ago

mamamia5x commented 3 years ago

I like the idea of having more than 2 conferences, but it messes up the playoffs. Instead of having the top teams from each conference, it's the top team from the whole league. Is there a way to do top 4 teams from each conference (or even division) to advance?

dumbmatter commented 3 years ago

The reason there's no option is because I'm not sure what exactly the option should be. Like I don't want to add an option just for 4 conferences being split into 4 brackets. Because there's tons of other playoff structures people might want too. What's the general solution? I'm not sure...

mamamia5x commented 3 years ago
if (numberOfConferences % 2 == 0){  // Don't really know the code too well, so I'm using numberOfConferences
  var perConf = numberOfPlayoffTeams / numberOfConferences; // Teams per conference = playoff team / number of conferences.
  // Basically if there are 16 teams in the playoffs, and there are 4 conferences, then there would be 4 teams per conference in the playoffs.
  setPlayoffs(); // Call the function that does the playoffs, sorry for my lack of knowledge of the code.
}

Just an example solution, but I don't know the code too well.

mamamia5x commented 3 years ago

You could also do the same code for division

var perDiv = perConf / numberOfDiv;  // Get the amount of teams per conferences and divide by divisions in this conference.
if(perDiv % 1 !== 0){  //checks if number is a fraction
 // Basically if 4 divisions and 6 per conference, it'll 1 for 2 divisions and 2 for 2 divisions
}
mamamia5x commented 3 years ago

@dumbmatter In genPlayoffSeries.ts on line 24 couldn't you do let playoffsByConference = g.get("confs", "current").length % 2 === 0; instead of let playoffsByConference = g.get("confs", "current").length === 2;?

quarterback commented 1 year ago

This is implemented and could be closed out