tournament-js / tournament

A tournament base class for static tournament types
MIT License
64 stars 13 forks source link

Undo damage when changing history OR lockdown history #3

Closed clux closed 10 years ago

clux commented 11 years ago

At the moment when scoring matches were winners have already been propagated in the tournament may lead to inconsistencies.

The simplest example is a 4 player single elimination Duel tournament where the semis have been scored. If one rewrites history by scoring the first round (quarter finals) this will cause different players in the already scored finals.

At the moment, the semi finals does not suddenly lose its scores because of this and so the already propagated winner (that gets put in the final) may not suddenly have been eliminated in round 1 so the tournament is inconsistent.

As I see it, there are two options. Either:

  1. If scoring changed the winner, delete all future scores along this branch (tracing this shouldn't be too hard - Duel is the only difficult one, and there we have the internal right and down functions to trace with) so they have to be scored again.
  2. Disallow changing the winner of a such a match (where the new winner propagation is not enough to fix everything), which could be checked reasonably easily in all tournaments.

Since rewriting history is a special request anyway, it's not so much of a priority. But I'd be interested to hear some opinions on this before I do anything.

I'm leaning towards undo damage at the moment because it means the tournament is always in a consistent state, but it might be hard to do if the scores are changed very far back, in which case it's a very silly and likely erroneous operation anyway.

clux commented 11 years ago

This is only an issue with progression based tournaments: FFA, Duel and KnockOut, as GroupStage avoided the issue cleverly by having a separate entity force freezing of the matches before tiebreaking could start.

clux commented 10 years ago

Since progressing now will be done via Klass.from in the future, this freezing will be general. As long as the decision to proceed to the next tournament is initiated by someone in power (vs. done automatically) this is now a non-issue.

clux commented 10 years ago

Rescoring history in progression matches is still technically an issue (FFA/Duel/Masters), but every admin must operate under the assumption that this will happen. Administrators can go in and rewrite as is intended, so it should not be a problem.