Closed cboulay closed 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?
How do the quarters affect who is pulling?
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.
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.
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):
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?
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
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:
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
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.
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.
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.
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.
Note: post-score but pre-pull the pulling team is considered to be in possession.