Posts tagged as:

statistics

New baseball database

July 9, 2009

In April, I wrote about building a baseball database of statistics for every player including those playing in the current 2009 season.  After several weeks working on it I have finally completed the database.   I had no idea it would be so complicated to build such a database but I learned a lot.

My first hurdle was learning about .htaccess .  I’ve forgotten exactly what .htaccess is for but I used it to redirect query results of players so each player will have their own unique URL page.

I then had to determine a way to separate the batting and pitching queries so when a pitcher is being searched you will get his pitching stats rather than batting stats.   Later, I’ll be able to have all of these stats on each player page

I thought it was important to be able to access Babe Ruth’s batting and pitching stats.  So, I added pitching stats to position players who also had pitched in their career.  Check out Jose Canseco and Steve Finley’s pitching stats.

If you are familiar with databases you know that every record must have a unique ID.  When dealing with the current 2009 season, one of the challenges was trying to find a way to generate a unique ID for all rookie players.  First, I needed to find a way to determine if a player is indeed a rookie.  Then, I had to find an automated way to generate a unique ID.  I spent a few days working on a stored procedure.  This stored procedure will scan the entire master database for duplicates and if duplicates are found, the number at the end of the ID will be incremented.

The method I was using for determining rookies had a flaw because I was searching for players who were playing in the 2009 season but hadn’t played in 2008.  The drawback to this was that some players, like Kris Benson, had been out of baseball for a few years so they weren’t actually rookies.  I had to go back and find the IDs for these players and ensure they weren’t considered new rookie players.

Each day I work on the database I always seem to find a mistake somewhere.  The other day, I noticed Scott Rolen’s 2009 AB totals were a little off.  For some reason, I missed the stats from one day in June so I had to go back and fix that.

Another thing I noticed was Miguel Tejada’s batting average in my database didn’t match the batting average from other sites.  After some research, I found that if a game was suspended due to rain I wasn’t updating the database.

Another glitch is I don’t have any 2009 stats for HBP, BK, and WP categories for pitchers.  I still need to find a way to gather this data.

I’m sure I’ve overlooked some other things.  If anyone notices any errors please let me know.

http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/digg_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/delicious_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/blinklist_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/blogmarks_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/technorati_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/google_32.png

{ 1 comment }

Now that MLB 09 The Show offers video replays and pictures, gamers can now build dynamic team pages with screen shots and videos…and maybe now even statistics.

I learned that not only can you take pictures of your favorite plays in MLB 09 but you can also use this feature to take pictures of any of the menus, statistics, or box scores in MLB 09 The Show.

In MLB 07 and MLB 08, I manually copied my RTTS stats by hand and then entered them into HTML format.  There may have been a less tedious way to do this but I was not aware of it.

With MLB 09′s new features, I may have found a better way to compile and display stats online by using an Optical Character Recognition service:

1. To take a picture in MLB 09, just hit the PS button and then go over to the picture sub-menu. There will be an option to capture the screen. Choose this and then then, hit the “X” button. You have now saved a screen capture.

2. Copy the image to your PC and use Microsoft Paint or any other image editor to invert the colors.  Also, crop the area you want to capture.

Batting .167? Good thing I have a 3 year contract with the Giants.

3. Go to http://www.onlineocr.net, upload the image and then convert it to another format such as HTML or text format.

Now you have data to work with to publish to your team pages:

YEAR G AB AVG h r 2b 3b hr rbi
2010 12 34 .206 7 0 0 0 0 0
2009 115 406 .167 68 26 5 0 0 32

Final Output:

YEAR G AB AVG H R 2B 3B HR RBI
2010 12 34 .206 7 0 0 0 0 0
2009 115 406 .167 68 26 5 0 0 32

http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/digg_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/delicious_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/blinklist_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/blogmarks_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/technorati_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/google_32.png

{ 0 comments }

Stratomatic Online

February 21, 2009

Welcome to BaseballSimulator.com! My initial intent was to have a website about building a baseball simulation game similar to Stratomatic baseball. I’ve always been intrigued with baseball simulation and its statistics. My first baseball board game was Statis-Pro Baseball which I used as a basis for designing the game. Over the years I have worked on the game from time to time but it’s still far from being finished.

In the Spring of 2002 I was visiting SportingNews.com and came across their fantasy games section and found Stratomatic Online. Looking back, I don’t recall visiting SportingNews all that frequently so it was sort of a coincidence that I discovered Stratomatic Online just about the same time it was released. Since then, I have played in leagues 12 months out of the year every year since 2002.

I intend to write a blog about my experiences with Stratomatic Online. I’m by no means an expert but I have some knowledge and tips to share.

http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/digg_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/delicious_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/blinklist_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/blogmarks_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/technorati_32.png http://baseballsimulator.com/blog/wp-content/plugins/sociofluid/images/google_32.png

{ 0 comments }