Sunday, March 25, 2012

Win Expectancy (Baseball Mogul)

Another new feature for Baseball Mogul 2013 is that all the game logs now show Win Expectancy after each play.

Win Expectancy is the chance that a team has of winning the game, based on the inning, score, outs and runners on base. In the case of the Baseball Mogul game recaps, the Win Expectancy for the home team is shown after each play.

Here's an example from the 9th inning of a game I just played in Play-By-Play mode:


At the top of this screen shot, the home team (Washington) is leading the game 4-3, at the start of the 9th inning. In this situation in the current run-scoring environment, this gives the home team an 87.2% chance to win the game.

Then the Washington pitcher walks the leadoff man (Sanchez), dropping their win chance by 9.6% (to 77.6%).

When John Buck doubles down the right field line, the game is tied and the Marlins have the go-ahead run on second base. The biggest play of the inning is when Jose Reyes singles with two outs to knocks in the (eventual) winning run. By the end of the inning, the Marlins are ahead 5-4 and the Nationals chance of winning the game has dropped to 17.4%.

In the bottom of the 9th, Washington's chances just get worse. The leadoff hitter (Marrero) strikes out, dropping their win chance below 10%.

At the end of the game, their chance to win has dropped to 0.0%. (This is self-evident, but it shows that the math adds up).

Thursday, March 22, 2012

Strike Zone Heat Maps (Baseball Mogul)

As I mentioned here, this is the year that Baseball Mogul went from being a random number generator (like Strat-O-Matic or previous computer sports games) to becoming a true physics-based simulation of each pitch. However, it's difficult to determine if our model is realistic without having a way to visualize the results. So, I added heat maps to Baseball Mogul 2013, plus the functionality to record data for every single pitch.

Ideally, we should see the same patterns in our data that we see in Major League Baseball. For example, we know from actual pitch data that BABIP (Batting Average on Balls In Play) varies by pitch location:
Heat map by Dave Allen
This heat map is for right-handed batters only, with a view from behind the catcher. Imagine the batter standing to the left of the strike zone.

As you can see, BABIP is slightly higher in the lower part of the strike zone, because low pitches lead to more ground balls, and ground balls turn into hits a bit more often than fly balls.

And, the "hot zone" for BABIP tilts. That is, on low pitches, the highest BABIP occurs just inside the middle of the plate. On higher pitches, this region is a bit farther away from the batter.

This prime hitting zone tilts at this angle because the sweet spot of the bat passes through the strike zone roughly along this line. With the bat (and arms) pivoting on the batter's shoulder, it's easier to reach the high outside corner with the heart of the bat than it is to reach the high inside corner. So, with Baseball Mogul, I modeled the bat moving through the strike zone, by assigning different coeffecients of restitution to each point on the bat. The coefficient of restitution (COR) reflects how quickly the ball comes off the bat at each spot. It can be represented as a parabolic function along the length of the hitting surface, with the COR peaking at the bat's sweet spot.

I hope I didn't lose you with the technical jargon. Simply put, once this COR model is added to the simulation, we should see results that look somewhat like real life. So here's the same heat map from one season of Baseball Mogul:

Heat map by Baseball Mogul 2013
Wow.

I honestly didn't expect it would look that good. As with the first heat map, BABIP is highest from the middle of the plate down to the bottom edge. And, we see the same tilt: on low pitches, the batter is more likely to hit the ball solidly if it's over the inner half of the plate. As the pitch moves up in the strike zone, BABIP improves as the pitch moves toward the outer half.

Very cool. I'm really looking forward to using these heat maps to continue to dig into the new simulation engine.

Tuesday, March 20, 2012

Pitch Tracking and the "Charts" Tab (Baseball Mogul)

Baseball Mogul 2013 now tracks and records every single pitch of your simulation. Pitch type, speed, location, result. etc.

In conjunction with this, we have now added a 'Charts' tab to every player's Scouting Report:


The above chart was created by simulating from the 2012 season through 2025. It shows BABIP (Batting Average On Balls In Play) for all lefties that Strasborg faced.

You can also limit the search to certain pitch types (fastballs, sliders, etc.) and situations (2 outs, RISP, "close and late"). For example, here's Jason Heyward's Slugging Percentage on just fastballs:


Finally, you can limit the search to at-bats against one team or one specific player, such as Dustin Pedroia versus the Yankees from 2012 through 2020:


Saturday, March 10, 2012

Baseball Mogul 2013: Under The Hood, Part 2

For years, people have been asking for direct access to the Baseball Mogul database. Many of them want to be able to build mods that read and parse the data.

For example, Mizerak created a very cool app called the Box Score Parser that sifted through multiple seasons of box scores in order to derive data that can be easily viewed inside Baseball Mogul. Unfortunately, he had to use box scores because they were one of the only things saved in a human-readable form.

Thursday, March 1, 2012

Baseball Mogul 2013: Under The Hood, Part 1

When I first wrote Baseball Mogul, it simulated each game by simulating the result of each plate appearance. This isn't unusual. This is how Strat-O-Matic works. This is how other computer games work. This is even the method I used when writing my very first baseball simulation, using paper and dice, back in 1976.

But the thing is, baseball isn't played with paper and dice. It's played inside televisions. And the game on television isn't determined by comparing player stats and generating a random number. It's determined pitch-by-pitch. Each pitch has a velocity, a spin direction (and magnitude), and the location where it crosses the plate.


Photo by Wall Street Journal

So, for Baseball Mogul 2013, I rewrote the entire simulation engine to calculate:
  1. The velocity and path of each pitch (similar to that recorded by PITCHf/x).
  2. The timing and velocity of the bat swing.
  3. The plane of the bat swing (and the location of its sweet spot).
  4. The angle and velocity of the hit that results from the above.

Sunday, February 26, 2012

When Zombies Attack ... Morons


The Walking Dead is dumb. The premise is dumb. The writing is dumb. And the characters are especially dumb.

Sunday, February 5, 2012

Worst Call In Super Bowl History

Photo by Ed Yourdon
I realize that it's hyberbolic to call today's safety call the worst in 46 Super Bowls. But somebody needs to do it. Right now, there are thousands of people out there Googling "worst super bowl call ever", and they need to be able to find something.

Thursday, January 26, 2012

Super Bowl MVP Predictions

Photo by Keith Allison
As mentioned on Sunday, we used Football Mogul to predicts the results of Super Bowl XLVI by simulating the game 100,000 times. We also recorded the MVP of each game.

Odds are that it will go to a quarterback. But there's a 48.7% chance of someone else taking home the MVP trophy.

Sunday, January 22, 2012

Football Mogul Predicts Super Bowl XLVI


It's that time of year again. Another Super Bowl between the Giants and Pats. To predict the result, we used Football Mogul to simulate the game 100,000 times.
Note: this year's version of Football Mogul is 100% free. No time limits. No strings attached. Please download it. :)
Bottom line: Pats have a 60.78% chance of winning. The most likely score is 31-27.

Here are the average results for each team:

Sunday, January 15, 2012

The NFL's "Worst" Pass Defenses

In tonight's 45-7 drubbing of the Broncos by the Patriots, I have to admit that the 2nd half was pretty boring.

Here's what I did see that was interesting:

CBS put up a graphic showing that the best teams in the NFL this year also had the worst pass defenses. This wasn't the first time I had seen this stat trotted out as "proof" that the Packers, Saints and Pats have horrible pass defenses.

Team
WonLostPass Yards
Allowed Per Game
NFL Rank
Green Bay Packers
151301.2 32nd 
New England Patriots
13 3 283.0 31st
New Orleans Saints
11 5 266.7 30th

Well ... duh.

Saturday, January 7, 2012

Changing Team Names (Miami Marlins)

Some people have been asking how to change the 'Florida Marlins' to the 'Miami Marlins' for the 2012 season in Baseball Mogul.
  1. On the League Menu, choose 'League Editor'.

Saturday, July 23, 2011

2011 Offensive Line Rankings

Based on career stats for all active linemen (adjusted for age, and weighted for recent performance and injuries) here are ratings for the current offensive lines for all 32 NFL teams. For individual ratings for each offensive lineman, you can download this year's version of Football Mogul, which is 100% free (no time limits or registration required).

Sunday, January 16, 2011

Go For Two!

Photo by Keith Allison
While most New England fans are still recoiling from today's loss to the Jets, I thought I would take a moment to draw your attention to a huge error by coach Belichick that significantly reduced our chance to win the game.

Wednesday, August 25, 2010

2010 Offensive Line Rankings

Based on stats from the last 12 seasons (yes, Matt Birk has been in the league since 1998), here are ratings for the current offensive lines for all 32 NFL teams.

Sunday, January 24, 2010

Fixing Overtime In The NFL (Revisited)

We already have a great solution to the problem of the coin flip in overtime games. Nevertheless, it has been almost four years, and we're still stuck with the old system.

After the Vikings-Saints NFC Championship game (and the Colts' failed attempt to go 16-0) the argument for this change to the rules is even more compelling. If this rule had been implemented, both the Saints and the Colts would have still had something to play for in the last month of the season.

To summarize, we have two major problems:

1) The coin-flip winner has an unfair advantage in overtime.

2) Teams like the 13-0 Saints and 14-0 Colts have no incentive to win after they have clinched the top playoff spot (making any of these late-season games utterly unwatchable).

The solution is elegantly simple: automatically award the "coin flip" to the home team.

In addition to eliminating the coin flip, there are a number of other positive effects:
1) This increases the importance of home field advantage in the playoffs.
If a team like the Colts go 14-2, they get an edge if a playoff game goes to overtime (just as the home team in baseball has a strategic advantage).
2) We now know who the "home team" is in the Super Bowl. And it matters. 
This would have been pivotal this season: the Colts and Saints would continue to play hard, knowing that if they met in the Super Bowl, home-field advantage would be determined by their regular-season record. Instead, we got five unwatchable games by two teams that had nothing to play for.
3) It adds drama to the final minutes of a game, and clarifies strategy for coaches.
If you're the away team, and you're up against a good offense, you want to play for the win, not the tie, in any last-minute play calls. You go for two if you have the chance. And you go for the touchdown instead of the field goal on 4th down. More excitement, and less overtime (which tends to run into the next game, which doesn't make most football fans happy).
4) It increases attendance.
As the NFL becomes more fun to watch on TV, ticket sales are suffering. Giving the home team a bigger advantage increases the likelihood that a home-team fan will have a great experience at the stadium (by getting to see his or her team win).

Monday, January 11, 2010

Wes Welker For MVP

Photo by Mike Gil 
Peyton Manning was announced two days ago as the MVP for the 2009 NFL season. But yesterday, without even leaving Bob Kraft's luxury box, Wes Welker proved that he was the one who should have received the award.

Monday, November 16, 2009

Belichick Made The Right Call

Photo by Keith Allison

Last night, near the end of an important game against the Indianapolis Colts in Week 10, the New England Patriots faced 4th-and-2 on their own 28-yard-line. The Patriots were ahead by 6 points, with 2 minutes and 8 seconds left on the clock. Conventional wisdom said the Patriots should punt the ball, to force Manning to try to drive the length of the field for a game-winning score. Instead, the Patriots went for it and failed to convert. The Colts went on to win.

Commentators are already arguing about whether Coach Belichick showed too little faith in his defense, or too much faith in his offense. It has nothing do with faith. It's all about giving your team the best chance of winning. And the numbers say that Belichick made the right call.

Tuesday, November 25, 2008

The End Of The 50-Yard Field Goal

Stephen Gostkowski, the kicker for the New England Patriots, has one of the strongest legs in the NFL. Most of his kickoffs go into the opponent's end zone -- many of them for touchbacks.

But he doesn't have any 50-yard field goals this year. That's because Coach Belichick hasn't asked him to try any. Gostkowski has a 93% success rate on kicks less than 50 yards. But no attempts beyond that distance.

This stat is part of a larger trend in the NFL.

Saturday, July 26, 2008

Cliff Lee For MVP?

Photo by aturkus on flickr
Cliff Lee is now 14-2 for an Indians team that has won only 45 games. Lee has over 31% of his team's wins.

The last pitcher to finish the season with more than 30% of his team's wins was Fergie Jenkins, winning 25 games for the 1974 Texas Rangers. And Jenkins pitched in a 4-man rotation, allowing him to get 41 starts.

In other words, no pitcher has ever done what Cliff Lee is doing: winning 30% of his team's games while pitching in a 5-man rotation.

Wednesday, July 16, 2008

Over-Active Game Design


Photo by Bari D
It's not surprising that everybody wants to be a game designer. What's bad is that everyone thinks they can be a good game designer.

Probably the most telling aspect of bad game design is "over-active" game design: the desire to "improve" games by adding complexity.

The media response to tonight's All Star Game is a perfect example of over-active game design. Some suggestions I've heard on T.V. and radio: