leaguevine / leaguevine-ultistats

MIT License
18 stars 4 forks source link

Conflict between play-by-play score and end score #92

Open zmpster opened 12 years ago

zmpster commented 12 years ago

If I am taking stats by watching a VoD after a game has finished, but the score has already been put up, the mobile stats taker is incorrect/confusing, because it shows the final score of the game. If I record a score, then the score is updated. For example, I am taking stats for the Madison Club vs. NexGen game, and the end score has already been reported as 15-8. When I go on my iPhone to take stats starting from THE BEGINNING of the game, it still displays 15-8 in the score. Furthermore, when I record a score for Nexgen it would update to like 16-8, which is clearly wrong. This has the unfortunate side effect of people taking stats on their phones not knowing exactly where in the game they are taking stats from. This resulted in a particularly annoying case of someone else taking the same 5 points of stats of me, which then I had to go back and delete. As an easy fix, I would imagine you just have one set of numbers tracking the score, and another set tracking the score of the current play-by-play. That way, when someone goes to take stats, it will show them how much has already been recorded.

cboulay commented 12 years ago

This issue is slightly more complicated than that. What happens if you're tracking a game and then your battery dies, then you switch from your iPhone to your friend's Android device. What do you want the score to be when you resume tracking on the next device?

I haven't pushed Mark or Roger about it yet, but I hope that the Leaguevine API will be able to return game events created by the logged-in user only. Let's call them LIU (logged-in user). Then, when the game is tracked, these events will be downloaded and merged with the local LIU-specific events and the game state will be bootstrapped according to LIU's events only. That way, LIU's game will travel across devices without impacting another user's tracking of that game. This will require some changes on the back end, and it will take me a while to get the bootstrapping right.

I can implement your suggested simple fix, but that will break moving to another device during a live game. It would also require the Leaguevine backend to make an assumption that all events submitted by a given user are independent of the events submitted by another user, so it doesn't simply aggregate events across users as it does now.

zmpster commented 12 years ago

Sorry, I didn't state myself clearly. I'm not suggesting that you have the the score updated completely independently from the play-by-play, I'm suggesting having two different sets of scores. One set of scores that are set by pure SCORE UPDATES. There are a lot of people who just update scores without recording any of the play-by-play info. Then, we have another set of scores that represent the score as told by the current state of play-by-play info that the backend has (I didn't realize you guys did a lot of cool stuff with aggregation, but that shouldn't change anything in this case. The backend still has a current state of it's play-by-play, and that should be a different score.) Does that make sense? Am I still missing something?

zmpster commented 12 years ago

Oh, I sort of see the issue. I guess in that case, a user can't start taking stats from the middle of the game if no stats had been taken up until that point? Maybe you could add an option when beginning stats recording to "start from beginning of game" or "start from current score".