- Bocce Labs
- Posts
- Computer Generated Bocce Stats
Computer Generated Bocce Stats
Telling the story of competitive bocce with numbers
Howdy 👋
Last week we uncovered the steps the current software takes to find and track bocce balls.
This week, we will build on that to talk about what you have all been waiting for — bocce stats.
Welcome to the 2 new subscribers this week!
Why Bocce Ball Stats
Sports stats lead big changes in a niche sporting community. Bocce ball would benefit from stats by:
Identifying talent for choosing teammates
Helping players improve their game
Comparing and ranking players
Understanding team or player profiles for gambling
Giving future broadcast commentators something to gab about the sidelines
A History of Stats at American Bocce Co
A few years before I joined American Bocce Co (ABC) in Chicago, they ran several leagues with a stat system known as The Class Rating System.
ABC referees administered this scoring system by hand. Each ball was "graded" on the scale [-1, 0, 1, 2]. The summation of these grades were the rating for the for the player in the game.
The shot grade symbols and corresponding points are:
➖ = -1 : Negatively affected the frame or was a really bad shot
🔘 = 0 : Had a neutral effect on the frame
✔️ = +1 : A good shot with a positive effect on the frame; ex: pointing within a 16in radius with no other traffic
✔️➕ = +2 : A phenomenal shot resulting in a significant positive impact on the frame
After the game, the player's calculated score was transferred to a Google spreadsheet. The spreadsheet came out before the next league night the following week. The mailing list service reported a high click rate, meaning players were very interested in their stats.
Players were arranged from in rank order regardless of the team they played on — the stats were individualized
This stat system was effective and engaging because:
It provided individualized stats
It had an easy-to-understand rating number
It led to bragging rights, disappointments, and embarrassments
Of course, there are drawbacks with this stating system:
It was time consuming and labor intensive
It required 100% focus by a referee to grade each throw
It could lead to referee burnout (we did a "bring back the stating" night once in 2021 and I personally found it exhausting as a ref)
These drawbacks led the class rating system to go by the wayside. However, that doesn't mean that there isn't a desire for stats in ABC leagues and beyond.
Bring on Computer Generated Stats!
Computer generated stats are objective as opposed to human generated subjective stats.
But that isn't to say that subjective stats are inherently "bad". Bocce is very situational; there are always multiple shot strategies you can take, each with their own risk/reward profile.
Quite simply, objective stats don't tell the whole story — but that's what broadcasters and game reporters are for. For a computer to tell the "whole story," intense artificially intelligent software would have to do more than simply find the bocce balls. It would have to understand the game and all of the different strategies available in any given frame.
Okay well...then what CAN we do with a computer?
Booce Coordinate System
There are a number of geometry-based, in/out, stats that we can compute using cameras and computer vision for bocce ball.
Consider the following court layout:
This is an 8ft x 30ft court that ABC league players are used to. The same coordinate system applies to a 13ft x 90ft competition court or any court size, really.
The center of the court is (0, 0). Left of that is negative x. Right of that is positive x. Beyond the center is positive y. Short of the center line is negative y.
The coordinates are based upon the perspective from the throwing side. In other words, the coordinate system flips when you switch ends or when the players on the other end are throwing.
Translating overhead multi-camera image pixel coordinates to court coordinates is a simple scaling multiplication. Currently, about 11 pixels represents 1 inch with the ethernet cameras/lenses I have mounted 12 feet above the target. Ideally the resolution would be higher than that, but this is what I have given current budget constraints. I'll be discussing camera tradeoffs in a future article.
Bocce Stats, Stats, Stats
Given the above geometry considerations, let's discuss a few stats.
(1) Average distance to the Pallino - How far is the Bocce to the Pallino on average across many throws?
This could be for a team, throwing pair, or individual player; for the game, a tournament, an entire league, or a specific venue.
Caveats: The problem with this stat, is that we aren't always aiming for a halo (Bocce touching Pallino...as close as the balls can possibly be). Oftentimes, we're just aiming to be a little closer than the opponent's ball or we're aiming for a low risk shot into some empty space. Or maybe we're shooting a raffa to break up the balls. Perhaps this is a great stat for the first ball of each frame for the team that is throwing the Pallino — how close can you point with no other traffic on the court?
(2) Zoned average distance to the Pallino - Break up the court into zones (say Deep, Mid, Short, Gutter Left, and Gutter Right. Maybe even Deep Corners) and compute the average distance to the Pallino when the Pallino is in that zone.
The zones could be redrawn at any time and stats could be calculated retroactively. And the zones will obviously be a bit different depending on the dimensions of the court.
Caveats: Same as for (1).
(3) Zoned win percentage - Using the same court zones, did the throw win the frame? Turn that into a win percentage for each zone.
Caveats: Sometimes the Pallino moves and will change zones in the middle of the frame. So consider only the Pallino's final resting place for this stat. The problem is that one team might be out of balls when the other team knocks the Pallino to the back wall.
(4) Point swing within a frame - This one is a bit hard to explain, so let's consider an example.
Red has 2 balls on the court that are IN and Blue has one ball on the court that is OUT. That means Red = +2 and Blue = -1. Now imagine that Blue throws and they still aren't in. Now, Red = +2, Blue = -2. Blue throws again and manages to knock roll the Pallino closer to the other Blues. Now all 3 Blues are closest to the Pallino. Red = -2 and Blue = +3. That is a swing of +5 for Blue and a swing of -2 for Red. Blue threw a damn good shot to go from two balls out to three balls in, a difference of +5.
Caveats: None. Technically this isn't a geometric stat, but it would be damn near impossible for a referee to keep track of this without going insane.
(5) Raffa contact percentage - When the ball is traveling faster than X feet per second (meaning, the Bocce is moving fast enough to be considered a Raffa), did it contact a ball?
Caveats: Sometimes you contact the wrong ball. But sometimes contacting any ball is good. It obviously depends upon the situation. If we had an entire back room of sports data analysists, they could tag it accordingly. But in this instance, we're simply going for "did the raffa make contact with a ball" percentage.
(6) Stick raffa average distance to the Pallino - For those that don't know what a "stick raffa" is, it is a Raffa thrown with backspin with the goal of it knocking out a Bocce and yet staying in play close to the Pallino. Basically did a Raffa (hard/fast shot) Bocce Ball land in the vicinity of the Pallino.
Caveats: Okay but what if you moved only the Pallino? Then this stat is void (not accounted for). This stat would be Bocce-to-Bocce contact only.
Feedback requested
📩 Reply to this email with your other stat ideas!
Lab Report
On Sunday evening, the dog (curled up on the end of the couch) and I worked on building out this Python/Qt app.
Hopefully by the end of the holiday week, I will have all data placeholders on the right side connected up to the bocce ball finding algorithm that was discussed last week.
Thanks for reading!
Have a great Thanksgiving if you are in the USA and I'll see you next week. Reply to this email if you wanna chat stats!
~ Digital Dave
Reply