PassTrackr

PassTrackr is a program I created to manually track passes during an NHL game. There's a lot of data out there on different aspects of the game of hockey, however I found that there was a lack of data on one of the most important aspects of the game... passing. That is why I decided to start this project in early 2022 to put my programming, data manipulation and data visualization skills to the test. The entirety of the project was programmed with the Python programming language.

Manually tracking passes is quite a tedious task since the average pass count in any given game ranges from 350 to 450 per team. For the purpose of this project and to start building its dataset, I decided to focus my pass tracking on one single team being the Montreal Canadiens. By focusing on one team, I will be able to analyze different passing tendencies as well as individual development throughout the Canadiens' players.

The project has two parts to itself, the first one is the program that allows me to enter the passing data during a live game and the second is dashboard that visualizes the collected data that can be filtered with many different conditions in order to effectively analyze the content. The second part of the project is still in the making, but I already have a solid foundation to build off of. This page will cover the aspects of the first part of PassTrackr which is the manual entry program.

Overview

Based on different variables, the goal of PassTrackr's program is to assign a numerical score to each pass to determine its quality. It is important to know that the initial location of a pass drastically changes the way in which its quality score. In the defensive zone, players try to get the puck away from their goal with most zone exit plays occurring near the boards. However, in the offensive zone, the best scoring chance that can be created by a pass tends to be a pass towards the center of the ice. Although these two passes are very different in nature, they both can score high points as they were effective in their respective situations. PassTrackr automatically categorizes every pass based on its initial location, direction and end location. These categories are: Defensive passes, Setup passes, Transition passes, and Offensive passes.

The program's pass tracking process incorporates a mix of manual entries, data pulled from the game's play-by-play API, and data automatically entered through process of elimination. Here's a list of all of the relevant data that is collected for each pass:

Entered Manually

Pass release & reception locations

Passer & receiver's number

Time of pass

Manpower situation changes on rush plays

Receiver shot location

Automatically Entered

Manpower situation (PP, PK, etc.)

Players on ice

Zone exit/entry passes

Giveaway (If the failed pass was a giveaway)

Pass type

With this information, the program is able to calculate different fields such as the effectiveness of the pass with respect to the zone it occurred in, the passer's ability to read the play and transform it into an odd-man rush, and their ability to change the pace of the game.

How PassTrackr Works

The first thing the program does when a pass is entered is determine what kind of pass it was and then runs the data through different processes based on its type.

Defensive Zone Passes

Passes that are initiated in the DZ can be one of three different types: Defensive, Setup or Transition. Defensive passes are when the opposing team are orchestrating an attack and our player gets possession of the puck and tries to limit their chances by moving towards a player further away from the net, brining the opposing team's attack to an end. Setup passes (Also known as D2D) happen when the player with the puck isn't engaging in a transition play but is rather moving the puck in their own defensive zone either to wait for his forwards to get into position, or to simply deescalate and slow down the play by either moving the puck behind them or to the other side of the ice. Transition passes are defensive zone exit passes that initiate an offensive and/or a rush play by moving the puck forward with the goal of entering the opposing team's zone.

When a pass is entered in the DZ, the program does calculates the following areas on the ice:

Let's say that the pass was released at the gray circle. Once the release coordinate is entered, the program automatically creates the three coloured zones as seen on the image delimited by the gray borders.

GREEN - Forward pass

YELLOW - Backwards pass

RED - Dangerous pass

RED & WHITE - Forward pass with pass behind net

Based on the manpower situation retrieved from the API and the location of the reception, the pass quality score will be calculated differently.

In the Green - Forward pass zone, the passer is moving the puck forward to exit the defensive zone and potentially transforming the play into a rush that results his team to enter the offensive zone.

The Yellow - Backwards pass zone is a reception location solely for setup and defensive passes where the passer is trying to slow down the game by either ending the opposing team's attack or setting up a play.

The RED - Dangerous pass zone is present depending on the game's manpower situation. In an even-strength scenario, moving the puck across the ice in front of the net is a dangerous strategy that can lead to a costly giveaway. Passes made in the DZ during a power-play are typically setup passes and transform this zone into a forward pass (green) area when there's a lack of opposing players in the zone.

The RED & White - Forward pass with pass behind net zone is intertwined with the RED zone since their areas overlap. A pass can only end up in this area if the puck travels behind the net to cross the ice. Without a direct route that passes in front of the net, this type of pass eliminates many risks of giving the puck away to the opposition. A pass that is received in this zone can be any of the defensive zone pass types.

Each of these different zones have a different way of calculating the quality score of the pass since the goal of each of them varies greatly. Some take into consideration whether or not the pass created a zone exit play, manpower power change, reception distance from net, and other variables.

Neutral Zone Passes

Passes that occur in the neutral zone are usually transition passes to enter the offensive zone, but can also be setup passes depending on the situation. Variables that the program takes into consideration when calculating the score for passes from this zone are transition manpower changes, whether or not the pass allowed the play to enter the offensive zone, the distance travelled toward the opposing team's goal, and the open area the receiver was able to get to due to the passer's ability to read the play.

Passes in the neutral zone can be very eventful, many odd-man rushes are initiated from this zone but there are also many giveaways that result in an opposing rush that occur in this zone.

Offensive Zone Passes

Passes from the offensive zone are the most complicated to calculate. The program assumes that every pass reception can be converted into a shot on the net and therefor calculates the goal probability depending on the location and angle of the reception in regards to the opposing team's goal. The reason why the program does this is because the pass quality is associated to the passer's ability to find an open player and putting them in a favourable position to score a goal. Whether or not the receiver decides to take a shot is completely up to them and has little to no effect on the passer's score.

From public shooting data since 2013, I was able to create 11 different areas within the OZ, each with different goal probabilities that directly influence the pass quality score. I wrote an entire article about these areas which can be found here. Without going into too much detail, each area was calculated based on the results of shots taken from each zone. The areas were delimited through the findings of my research and go into greater precision than the simple homeplate & slot areas that most shooting analysis models use. The different zones are illustrated below:

Another variable that is used in the calculation as mentioned above is the angle of the reception relative to the opposing team's goal. Using the same shooting since 2013, I was able to calculate the average goal probability by angle. It's important to consider the angle of the shot since it takes into account the surface area of the net that is covered by the opposing team's goaltender.

Since the goal of the project is to assign a numerical score to determine the pass quality, the main idea of offensive zone passes is comparing the situation at the time of the release to the situation at reception. Analyzing passes is a good way to see a player's play-making abilities; How this player can transform the current situation into a better one with a pass.

Just like every other zone, the OZ can also have setup passes, not solely offensive passes. In reality, if the play isn't on a rush, most passes in the OZ are passes that aim to set up a play or a player that is in a better position to take a shot.

How to Use PassTrackr

Here's how PassTrackr's interface looks like:

1: Coordinate Rink - Whenever a coordinate needs to be selected, this is where the user clicks at the right location to record the entry (Pass, reception, bounces, shot).

2: Entry Log - The entries appear in the log. This is only for manual entries such as Passer, Time Left, Pass Result, Receiver, Manpower at Release, Manpower at Reception, and whether or not the receiver shot and if he scored.

3: Settings - Before every period, the appropriate settings need to be selected to ensure that the program will run correctly. Selecting the period and the side the is shooting on will allow the program to determine which side is their DZ and OZ.

4: Entry Box - By process of elimination, the program will require the user to input specific entries in order. This is where the data needs to be entered.

Demo

Here's a video that show how to track a few different kind of passes:

Conclusion

Once passes from a game are finished being recorded, the program transforms the data and generates a CSV file to be analyzed. I plan on creating another program that will allow me to easily parse through different datasets generated by PassTrackr to discover trends in the data. Until then, I plan on creating different Tableau visualizations of my findings.

The goal of this project was to push myself further than I've gone before and create a tool that would help me collect pertinent information. This project is far from being done, but I'm very proud of what I've accomplished so far.

If you'd like to learn more about PassTrackr or get in touch with me, please don't hesitate! Ways to reach me as well as my socials can be found here!