Tuesday, July 18, 2017

Baseball Mogul: Overall Ratings

As mentioned before, Baseball Mogul used to have the problem that player ratings weren’t well-defined. For example, an 85 Contact rating might put a batter among the top 25 players in the league in this category, while an 85 Power rating might not be enough to break the top 100.

There was also a problem of rating drift. When you start a new game in 2011, the MLB average for Contact is 78; ten years later, it has risen to 82.

These problems were fixed in Baseball Mogul 2016 and further improved in Baseball Mogul 2017. Player ratings are now well-defined in terms of what each number means relative to the league. And ratings are constantly adjusted every to ensure that these definitions remain meaningful over multiple seasons.

However, I’ve gotten some questions about how the ratings are actually defined. So, I pulled a couple tables from my design documents to help clear this up. This one shows how Overall ratings are groups into 10 separate categories, each with its own general definition:


This table shows a typical distribution of players in a 30-team league:


Players in Database:  The number of players that should fall within this range in a modern database with 30 teams.

Roster Spot(s): The roster spots that players of this caliber generally fill on a major league roster. For example, players rated 77-78 will occupy roster spots #16 to #20 on an average team; they aren’t good for the starting lineup or pitching rotation (a total of 13-14 players) but they have value off the bench and out of the bullpen.






Friday, April 7, 2017

Improvements to Baseball Mogul 2017


Baseball Mogul 2017 includes more than 130 improvements and bug fixes. As you would expect, we have included hundreds of new major and minor league players, and all MLB player and team statistics through 2016 (including the playoffs, off-season awards, and updated contracts and salaries).

But Baseball Mogul 2017 also includes proprietary data that you can't find anywhere else:
  • Hand-edited pitch repertoires and fastball velocities for more than 6,000 pitchers from 1881 through 2017.
  • More than 600,000 lines of PITCHf/x pitch data, including velocity and usage patterns for every season from 2002 and 2016.
  • More than 1.9 million lines of minor league stats from 1880 through 2016, at every level from AAA down to the 'D' leagues.
I've also made some major improvements to the simulation engine:

The first is a new model for improvement and decline at different defensive positions. The sim continues to adjust ratings based on age and playing time, but I've added a lot more data to the model. This means that each specific ability (such as an outfielder's range or a catcher's ability to hold runners) is calculated from all available data major and minor league data (including some data from foreign leagues). Additionally, each ability at each position has its own "maturation curve" -- and these curves change over time from 1890 through 2017 according to my analysis of the historical data.

The second is a new system for normalizing historical stats, leading to much more accurate player ratings and simulation results in historical years. The game now calculates individual averages and standard deviation for each statistic by season, defensive position and stadium. (Previous code used all-time averages for standard deviation, and normalized player statistics over their entire career.)

Finally, I planned a longer beta-test cycle this year, ensuring that the initial release was much more stable and bug-free. Baseball Mogul 2017 went on sale three days ago and the most serious bug that's been reported so far is that the home and away teams are flipped in the 2017 MLB schedule (this bug has already been fixed in the version currently for sale in our store).

Anyway, here's a longer change list. I'm sorry I haven't been able to describe these improvements in more detail, but it's easier for me to code and test changes and new features than it is for me to write about them.

2017 Database

  • Updated major and minor league statistics from 1880 through 2016.
  • Added biographical data for all 2016 MLB debuts and hundreds of new minor league players.
  • Updated 40-man rosters for opening day.
  • Imported more than 600,000 additional lines of PITCHf/x pitch data.
    • Added filters to fix data errors on-the-fly

Historical Simulations (1901 – 2016)

  • Rewrote code for deriving player ratings and statistical projections from historical data.
    • Improved historical accuracy for fielding error rates.
    • Improved historical accuracy for determining pitcher "Endurance" ratings.
  • More accurate defensive ratings, especially for designated hitters and pinch hitters.
  • Incorporated more data in player aging model.
    • Created more accurate career paths in both historical and modern leagues.

Simulation Engine

  • New model for player improvement at defensive positions.
  • More realistic adjustments for playing time at all levels.
    • Improved player health model and injury rates.
    • Improved realism for platoon advantage by player type.
  • Reworked code for simulating minor league games.
  • Updated Win Expectancy data.
  • Improved logic for intentional walks.
  • New system for generating fictional players to improve long-term stability of talent pool.
  • Bug fixes (e.g. small errors in Payroll Budget related to a bug estimated concessions revenue).

Artificial Intelligence

  • Improved selection of defensive starters and starting lineup
    • More realistic use of defensive substitutes
    • Improved logic for 25-man and 40-man rosters
  • Improved long-term (multi-year) roster management
  • Improved management of pitching rotation
    • Includes better logic for picking "alternate starters" from active roster
  • Bug fixes (such as the computer over-riding changes to a player’s position)

Interface / Options

  • Improved Player Rating Editor
    • (e.g. dynamic updating of Predicted stats when ratings are changed)
  • Improvements to Sortable Stats Dialog
    • "40-Man Rosters" added as selectable category when viewing/sorting.
    • "Pitches Thrown", "Strikes Thrown", "Strike Percentage" and "Pitches/Game" added.
    • "Steal Tendency" and "Steal Success" player ratings added to Sortable Stats.
  • Improved heat maps (in Charts Tab of Scouting Report).
  • Improved interface and readability in Play-By-Play screen.
  • Optimized League Builder to increase speed by about 400%.
  • Schedule importer now supports 3-letter team abbreviations.
  • Bug fixes
    • Errors converting between rating scales (“50-100”, “20-80”, “1-20” etc.)
    • etc.

Thursday, April 6, 2017

Baseball Mogul Predicts the 2017 Season

I'm a couple days late, but I put Baseball Mogul 2017 through it's paces today by simulating the current season a thousand times.

The following tables show the average number of wins and losses for each team, plus the chance of each result for each team (such as winning the World Series or finishing last in 3rd place in their division).

AL EASTWonLostWins
World Series
Wins
ALCS
Reaches
ALCS
1st2nd3rd4th5th
Boston89.8872.1510220740676316261113
Toronto85.5976.49387114811231132021443
Tampa Bay83.0379.0221448763304259260114
New York82.7279.3415316355212243292158
Baltimore76.6385.374716711112192678


AL CENTRALWonLostWins
World Series
Wins
ALCS
Reaches
ALCS
1st2nd3rd4th5th
Cleveland91.8570.2612124648571520369103
Detroit84.1977.91305711823234028713110
Kansas City76.6685.40381455251294293107
Chicago74.6487.4135129185254427125
Minnesota69.7992.2224941779135765


AL WESTWonLostWins
World Series
Wins
ALCS
Reaches
ALCS
1st2nd3rd4th5th
Houston86.3675.778115931942223521311614
Seattle85.3276.755410621427036226111819
Texas81.9480.1515275721328231515634
Los Angeles78.3983.6511194180146154425185
Oakland74.3489.6681634264670247611


NL EASTWonLostWins
World Series
Wins
NLCS
Reaches
NLCS
1st2nd3rd4th5th
Washington92.4568.59891873636313075273
New York90.4871.61681382743505429794
Miami80.6481.371120441288401372117
Atlanta74.5987.43237536389338232
Philadelphia68.2793.7311322061279640


NL CENTRALWonLostWins
World Series
Wins
NLCS
Reaches
NLCS
1st2nd3rd4th5th
Chicago94.6567.381292455057322105152
St. Louis84.4577.601736701624602291418
Pittsburgh81.2680.801325529025247716814
Milwaukee71.5090.5038171179234565111
Cincinnati69.6692.3413751120127827


NL WESTWonLostWins
World Series
Wins
NLCS
Reaches
NLCS
1st2nd3rd4th5th
Los Angeles93.5068.601032104064912582053917
San Francisco88.8273.2541861672953632525129
Arizona80.1381.928173610324830229255
Colorado78.7583.27511217113023549674
San Diego67.2392.77135193248120781

These tables were created using the new HTML output feature of the Simulation Tool in Baseball Mogul 2017.


Wednesday, April 5, 2017

Baseball Mogul 2017: Schedule File Formats

Baseball Mogul 2017 now includes support for team abbreviations in schedule files, making it much easier to create or import your own schedule files (for historical and/or fictional seasons).

This is a copy of the document included in the Baseball Mogul "schedules" folder.

Schedule Filenames

The league format is converted to numbers and letters that are used to create the file name. If the schedule is from a specific year, the year is appended to the filename.

This is an example of the name of a schedule file: 162-U-555-555-I-2017.txt.

  • ‘162’ is the number of games in the season.
  • ‘U’ means the schedule is “unbalanced”. This means that teams play more games within their division, that vs. league opponents. (A ‘B’ would be used to indicate a “balanced” schedule, where all league teams play every other league team roughly the same number of times).
  • The first ‘555’ refers to the number of teams in each division of league #1 — the American League has 5 teams in each of 3 divisions. The second ‘555’ refers to the number of teams in each division of the league #2 — the National League also has 5 teams in each division.

Because this schedule is for an unbalanced league, Baseball Mogul needs to ensure that league format has the correct number of teams in each division. Thus, the schedule file includes a number for each division.

For balanced schedules, the game only cares about whether the number of teams in each league match the schedule format. This only requires one number for each league. If the above file were for a balanced schedule, it would use the following filename: 162-B-15-15-I-2017.txt.

  • The ‘I’ indicates that the schedule includes interleague games. If the schedule only features league play, this is replaced with an ‘L’.
  • By default, all schedules have a 3-day all-star break. If this schedule didn’t have an All-Star Break, '-N' would be appended to the filename (for ‘No all-star game’).
  • Finally, the specific year can be added as an optional parameter. If a year is listed, this schedule will only be loaded for that season.
The Baseball Mogul "schedules" folder

Examples

162-B-14-16-I = 162 games, balanced, 14-team AL, 16-team NL, with interleague play.
162-U-554-565-I = 162 games, unbalanced, 5-5-4 AL, 5-6-5 NL, with interleague play.
154-U-77-66-L = 154 games, unbalanced, 7-7 AL, 6-6 NL, no interleague play.
154-U-77-66-L-N = 154 games, unbalanced, 7-7 AL, 6-6 NL, no interleague play, no All-Star Break.

Schedule Formats

All schedule files use one line per scheduled game. Each group of games is preceded by a single
specifying the date on which those games occur.

This date must always be in the format “XXX M/D/Y”. For example, “Wed 4/5/2017” refers to
Wednesday April 5th, 2017. The month and day are the only data used; the year and day of week are
ignored.

Individual games on each day can be represented in one of two formats:

1. Numerical Team Indexes

Teams are represented by numbers, starting at 0, such as the following lines:

Sun 4/3/2017
0 @ 6
1 @ 3

Each number specifies a team in the database, with the teams grouped by division.1 For example, in a
template for the 1977 season:

- Teams 0-6 are the AL East
- Teams 7-13 are the AL West
- Teams 14-19 are the NL East
- Teams 20-25 are the NL West

Teams are ranked alphabetically within each division. Using 1977 again as an example:

- Team 0 is the Baltimore Orioles
- Team 1 is the Boston Red Sox
- Team 2 is the Cleveland Indians
- etc.

Note: Baseball Mogul assumes that leagues are sorted alphabetically, and divisions are sorted from East to West. The “American League” will be listed before the “National League”; the “AL East” will be listed before the “AL Central” and the “AL West”; etc.

2. Team Abbreviations

New for Baseball Mogul 2017, schedule files now support 3-letter abbreviations. For example:

Sun 4/3/2017
SFG @ ARI
NYY @ TBR

Team abbreviations can be viewed (or edited) in the League Editor inside Baseball Mogul.

Schedule Files as Templates

If the specific year is omitted, Baseball Mogul will use the schedule file as a template. Instead of
scheduling the games exactly as specified in the file, it will load the schedule file and then randomize
team schedules within each division. This allows the game to create unique schedules for future years, or for historical years for which we do not yet have specific data.

Schedules are shuffled WITHIN each division. So, in the 1977 example above, if Team 0 is scheduled to play the first game of the season, then the schedule created from that template will feature ANY ONE of the first seven teams to play the first game of the season.

Double-Headers

Baseball Mogul doesn’t currently support teams with more than one game schedules on the same day.
If you are creating a schedule file for a historical year with scheduled double-headers, you will need to move the 2nd game to a day where those teams have a day off (such as by moving the 2nd game of a Sunday double-header to the following Monday).

Missing Schedule Files

If there is no matching schedule file, Baseball Mogul fabricates a schedule using an algorithm than can produce some unrealistic schedules (with large gaps between games played). I am trying to expand the number of schedule files available inside Baseball Mogul. If you have created a file for a missing year or format, please forward it to cjd@sportsmogul.com and/or post it to our mod forums.

Thank you!

Appendix A: Numbers Used in Schedule Files for 2014-2016 Seasons

Note that teams are ordered:

  1. Alphaterically by League (AL then NL).
  2. Then by division from east to west.
  3. Then alphabetically within each division.


AL East
BAL 0
BOS 1
NYA 2
TBR 3
TOR 4

AL Central

CHA 5
CLE 6
DET 7
KCR 8
MIN 9

AL West

HOU 10
LAA 11
OAK 12
SEA 13
TEX 14

NL East

ATL 15
MIA 16
NYN 17
PHI 18
WAS 19

NL Central

CHN 20
CIN 21
MIL 22
PIT 23
STL 24

NL West

ARZ 25
COL 26
LAD 27
SDP 28
SFG 29

Sunday, March 26, 2017

Game Company Redesigns Chess

Last week, "Hasbro Gaming" redesigned Monopoly in order to get some free publicity. They added a T-Rex, a penguin, and a rubber ducky.

This caused us at Sports Mogul to think: "Hey, we
could use some free publicityare good at redesigning games!"

So, as a public service to the world, we've decided to bring the game of chess into the 21st century. With the help of the internet.

Step 1. We asked the internet to name their least favorite chess piece. The results:

Rank Least Favorite Piece Votes Percent
11 The Knight 652,510 3.16%
10 The "Horsie" 998,602 4.50%
9 The Rook 1,257,993 6.65%
8 The Unicorn 1,400,590 7.98%
7 The Pawn 2,042,532 9.66%
6 Ringo 2,272,338 10.91%
5 Charmander 2,654,760 12.10%
4 The Queen 2,996,974 14.10%
3 The King 3,110,278 17.09%
2 Fluttershy 4,110,707 22.56%
1 The Bishop 4,169,452 22.70%

Saturday, March 25, 2017

Adding Stadium Art to Baseball Mogul

I got an email this morning with the following question:
  1. I am trying to use this photo of Jarry Park in Baseball Mogul, but all the numbers are skewed. The batter is nowhere near home plate, the first baseman is almost on the pitchers mound... what can I do to fix this?
They attached a file called PBP-Stadium-Montreal.jpg:




To verify the problem, I copied this file to my 'Stadiums' folder and started a new game as the 1974 Expos. When I went into Play-By-Play mode for their first home game, the field looked like this:


As reported, the ratings for all the fielders are in the wrong place on the field (as are the outfield fence distances). This is because every stadium photo requires a matching text file that specifies the coordinates that Baseball Mogul needs to use when drawing these labels.

To get these coordinates, open the photo in a graphical editing program. I use the "Paint" program included with Windows. Baseball Mogul assumes a photo size of 640 x 480 pixels, so you should resize your photo before proceeding.

Microsoft Paint displays the coordinates of your cursor in the lower left corner of the window. Start by placing your cursor over home plate and record the coordinates to a text file. Continue this process for each of the following locations on the field, typing each set of coordinates on it's own line. (If the foul poles are outside the picture, estimate their coordinates.)

Home Plate
First Base
Second Base
Third Base
Left Field Corner
Center Field Wall
Right Field Corner

After each pair of coordinates, you can add a comment by typing '//' and the following it with a useful label. When done with PBP-Stadium-Montreal.jpg, my text file looks like this:

318,351 // HOME_PLATE_COORDINATES Bottom corner
515,290 // FIRST_BASE_COORDINATES Outside corner
321,250 // SECOND_BASE_COORDINATES Top corner
128,285 // THIRD_BASE_COORDINATES Outside corner
-47,221 // LEFT_FIELD_COORDINATES Base of foul pole
324,194 // CENTER_FIELD_COORDINATES Base of CF wall
700,229 // RIGHT_FIELD_COORDINATES Base of foul pole

Save this file with the same filename as the stadium photo, but add the ".ini" file extension (e.g. PBP-Stadium-Montreal.ini).

When I go back into Baseball Mogul 2016 and resumed the game with the 1974 Expos, the stadium view now looks like this:


Much better!

Sunday, March 19, 2017

"Baseball Mogul is Horse Shit"

We got the following tweet a couple months ago:


... and then this (by someone else) ...


... and this (by yet another person):


I should be pissed off, but these made me smile. I love that people get emotionally invested into their Mogul teams. And it's nice to see people so angry about something other than politics.

These tweets also illustrate what people mean when they say that a game "cheats" or is "rigged". It's not just that the game is difficult — it's that the sim engine has "catch up" code — it waits until you get ahead (in a game or in a season) and then turns on the afterburners to kick your ass.

I briefly worked on the PC version of Madden in the 1990s, and know that it had strong catch-up code (and probably still does). On MLB Slugfest, we created different difficulty levels, but the game didn't cheat — the results were the same regardless of whether you were winning big or losing badly.

I assure you that Baseball Mogul isn't "rigged". There isn't a single line of code in the game that looks at the score (or the standings) and then adjusts the results accordingly. If your team goes 16-8 in April and then 9-18 in May, I guarantee that it's just bad luck. The cheating described in these tweets is purely in the minds of the players. And Baseball Mogul has never contained any catch-up code, so there isn't anything hiding deep in the simulation code that I somehow forgot to remove.

Although the simulation doesn't cheat, the diffculty level does affect the computer GMs' desire to do a deal with you. For example, GMs on "Fan" level will actually make trades with you that they would normally turn down (if offered by another computer-controlled team). Difficulty level also affects the revenue earned by any human-controlled teams.

Difficulty Level Artificial Intelligence
(Computer GMs)
Revenue Adjustment
(Human-Controlled Teams)
Fan Biased in favor of trades offered by human-controlled teams. +5%
Coach No
adjustment.
None.
Manager No
adjustment.
-5%
Mogul Biased against trades offered by human-controlled teams. -10%

As you can see, Baseball Mogul cheats in your favor on "Fan" level, and cheats against you on "Mogul" level. But this adjustment only affect your revenue stream — it doesn't pump up the losing team in order to keep things interesting, and it doesn't penalize your team just because you are on pace to win 100 games.