leaguevine / leaguevine-ultistats

MIT License
18 stars 4 forks source link

Halftime #24

Closed cboulay closed 12 years ago

cboulay commented 12 years ago

Note: post-score but pre-pull the pulling team is considered to be in possession.

mliu7 commented 12 years ago

Just a heads up on this. I'd like ultistats to support more than just half time. Ultimate in some cases (such as the AUDL) is played in quarters, so instead of "Halftime" maybe we could use "end of period". The API Supports "End of 1st quarter", "Halftime", "End of 3rd quarter", and "Game Over", and I would like it if we could support all of those including game over.

Thoughts?

cboulay commented 12 years ago

How do the quarters affect who is pulling?

mliu7 commented 12 years ago

Just looked at the official rulebook for the AUDL and the pulling team alternates between quarters. If team 1 pulls to start the game, then team 2 will pull to start quarters 2 and 4.

cboulay commented 12 years ago

I was hoping to use a single button and a single variable for tracking the game period (1st, 2nd, over). To address some games having 2 periods and others having 4, we could either provide a "game over" button or we could set the number of periods to 2 by default and change that if the season's organization name is AUDL. The first is definitely more flexible, but requires more buttons.

mliu7 commented 12 years ago

Hmm, this issue is tougher than I originally thought. Here are the possible implementations I can think of (I'm writing this out largely to organize my own thoughts):

  1. Single button that says either "End of 1st", "Halftime", "End of 3rd", or "Game Over" depending on the game state. After clicking it, it creates the appropriate event.
    • Dealing with quarters: If the season's organization name is AUDL, we use 4 periods. Otherwise we just use "Halftime" and "Game Over"
    • Thoughts: I like that this is super simple. The biggest downside I see in this is if the person recording the stats forgets to hit the "Halftime" button at halftime. This will probably happen quite often, and at the end of the game the user will want to click "Game Over" but it will say "Halftime" so they can't click it.
  2. 2 buttons. One says "End of Period" and the other says "Game Over".
    • Thoughts: This is flexible, like you said and will work with any league. When implementing this, though, how will we know whether to submit Event #95, Event #96, or Event #97 (End of 1st quarter, halftime, end of 3rd quarter) when they submit the end of period button? We'd have to again make a special case for the AUDL. Thus, I don't think this has much advantage over option #1.
  3. 1 button that says "End of Period", but when clicked, replaces the action button list with 4 buttons that have the text "End of 1st", "Halftime", "End of 3rd", or "Game Over".
    • Thoughts: This allows for maximum flexibility and overcomes the problems with options #1 and #2. The downsides are that it now takes 2 button clicks to enter the event, and this is likely a bit more work to implement.
mliu7 commented 12 years ago

Hey Chad,

So some of the AUDL people are already practicing with the app, and the issue of this non-functional end of period button has come up. Any way you'd be able to push our a quick (possibly simplified) version of this button in the next couple days?

cboulay commented 12 years ago

Tomorrow's a busy day. I should have something by the time you wake up Saturday. What about having two buttons? End Period, and End Game? End Period will flip who's receiving the next pull. There can be an infinite number of Periods until End Game is pressed. How should I send those to the API?

On 4/13/12 2:10 AM, Mark Liu wrote:

Hey Chad,

So some of the AUDL people are already practicing with the app, and the issue of this non-functional end of period button has come up. Any way you'd be able to push our a quick (possibly simplified) version of this button in the next couple days?


Reply to this email directly or view it on GitHub: https://github.com/leaguevine/leaguevine-ultistats/issues/24#issuecomment-5095805

mliu7 commented 12 years ago

Awesome, you rock.

Yeah, implementing those 2 buttons works well for now. That would be option #2 in the list above. The season for the AUDL will be 20059.

For sending the events to the API, use event types 94 through 97:

https://www.leaguevine.com/docs/api/events/#94

cboulay commented 12 years ago

The issue with events 94 through 97 is that I need to keep track of some game state to know which period we're in. That means that regular (USAU) games will always finish in the 1st or second quarter. Can you instead implement a generic "end of period" event on the API end?

On 4/13/12 2:56 AM, Mark Liu wrote:

Awesome, you rock.

Yeah, implementing those 2 buttons works well for now. That would be option #2 in the list above. The season for the AUDL will be 20059.

For sending the events to the API, use event types 94 through 97:

https://www.leaguevine.com/docs/api/events/#94


Reply to this email directly or view it on GitHub: https://github.com/leaguevine/leaguevine-ultistats/issues/24#issuecomment-5096755

mliu7 commented 12 years ago

Ah, gotcha. Yeah, I can implement a generic "end of period" event type. I will keep the other event types around as well so once we implement a more advanced solution we can send more specific information to the API.

I'll post back here once I've implemented this.

mliu7 commented 12 years ago

This "end of period" event type is live and working now. It's event type #94.

I changed the event numbers for the different end of period event types to make more logical sense, and figured I could do this safely because no one has implemented anything that relies on these event types yet. I believe this will be the very time I will be able to change any of the event type numbers, but we can always add more in the future.

cboulay commented 12 years ago

My wife reminded me of some plans we have. I'll still be able to work on this tomorrow but I can't guarantee I'll have a solution.

cboulay commented 12 years ago

I'm working on it now. I put in but commented out a line of code that sets the correct event type for end of 1st, 2nd, third, etc. I wonder if this will ever be useful.

The problem, as I see it, is that we do not know ahead of time the desired final score nor the total number of pull-team-changing periods. Therefore it is impossible for us to know ahead of time when "half" is reached without having an explicit half-time button. Does this even matter? Is there anything special about "half-time" that is not common to the end of any period?

If not, then an end of a period is an end of a period is an end of a period. Knowing which period has ended might be useful to display stats delineated by period, but labeling periods in the stats display as "1" and "2" is as good as "1st half" and "2nd half".

If you agree, then you probably only need the single "End of Period" event, and not the others. We can pass the (ending) period number as Int_1, or you can simply bootstrap the period number from how many periods have ended.