johnridesabike / coronate

A Swiss-style chess tournament management app.
https://coronate.netlify.app/
Mozilla Public License 2.0
140 stars 22 forks source link

Support for Asynchronous Tournaments #62

Closed StanleyGoldman closed 1 year ago

StanleyGoldman commented 1 year ago

I'm using Coronate to conduct tournaments between friends similarly to how lichess4545 conducts a tournament.

Pairings are assigned and players are expected to play their games and report back within a timeframe.

Playing this way adds a few result states and I'd like to have them supported, probably behind a setting in the tournament as I'm sure it wouldn't apply to most use cases.

Aborted - Match never occured, no blame placed. No round points awarded. ELO should remain the same. WhiteAborted - Match never occured, blame placed on White. Round point awarded to Black. ELO should remain the same. BlackAborted - Match never occured, blame placed on Black. Round point awarded to White. ELO should remain the same.

netlify[bot] commented 1 year ago

Deploy request for coronate rejected.

Name Link
Latest commit c5c62df30cbd1b65539a9e26414a426d95ccf1ed
StanleyGoldman commented 1 year ago

👋 @johnridesabike

I'm slowly plodding my way though. I'm unfamiliar with all the places I need to change to make this work.

If you got time to throw a pointer or two out. Let me know.

johnridesabike commented 1 year ago

Thanks for the contribution! I don't think I have any objections to this kind of feature, at least not from glancing at it so far.

Right now, I'd be fine keeping these new result types available by default without a setting. I've been conservative with adding new settings, since they increase the complexity of the overall app. I think having a few extra items on the dropdown menu won't be problem for general use.

Some points of interest:

The match results and player ratings are updated in this function: https://github.com/johnridesabike/coronate/blob/af065a85741de975e45fac4087dc34b6018ee22d/src/PageTournament/PageRound.res#L96

The UI for selecting match results is here: https://github.com/johnridesabike/coronate/blob/af065a85741de975e45fac4087dc34b6018ee22d/src/PageTournament/PageRound.res#L178

Match results are turned into scores with these functions: https://github.com/johnridesabike/coronate/blob/15cb838f925e494428aeaaf6115bd3eebfa25470/src/Data/Data_Scoring.res#L52 (There's a function for each player color.)

There are a few other places that will probably need to be updated too, but the sections linked above are the most important.

StanleyGoldman commented 1 year ago

I wholeheartedly agree with what you said about Settings. My idea to hide this was going to be very cosmetic, I planned on just hiding these selections from the UI.

StanleyGoldman commented 1 year ago

@johnridesabike I'm testing this locally and everything seems to work out fine.

Otherwise thanks, this was fun. I know F#, I have never programmed in OCaml or ReScript for that matter.

johnridesabike commented 1 year ago

Can you run npm run test -- --updateSnapshot and commit the changes? I think that should fix the failing test.

johnridesabike commented 1 year ago

The changes look good to me so far. One question though is how, or if, we want these new match results to affect the pairing and tiebreaking rules. For example, the auto-pair will avoid pairing players who played each other previously. Should that include players if their previous match was aborted? Also, should the "most black" tiebreaker count players who were assigned black in aborted matches?

The answer to those may be "yes," and personally I'm fine with that. (The tiebreaking and pairing logic is already complex enough without adding new rules to it.) But either way it's worth considering.

johnridesabike commented 1 year ago

One more thing: please add a short entry to the changelog file. (You can just put it under the "latest" heading.)

Aside from that, I think it looks good!

StanleyGoldman commented 1 year ago

One question though is how, or if, we want these new match results to affect the pairing and tiebreaking rules.

Some that happens to us often is a player in California is paired with a player in India. The match aborted because the players couldn't find the time in their schedules (considering time zones) to meet and play. Having the software avoid pairing those players again for the tournament makes sense because they likely wouldn't be able to meet up anyway.

I don't yet have a strong opinion about the tie breaking rule. I'll probably have an opinion after I need the tie break.

johnridesabike commented 1 year ago

Everything looks good to me. We can always tweak things later if it turns out we need to.

StanleyGoldman commented 1 year ago

Merge when ready