I’ve had a very productive day on my RetroChallenge project. The following items were coded from the to do list:
1. Defensive team team ratings
a. calculate for roster
b. update ratings for change of roster, or player change of position
2. Stealing of 3rd base and home, based on steal charts (copied from steal of first base and modified)
3. Pitcher card outcomes
a. regular outcomes, ground out, strike out, walk etc.
b. Team Defense automatic Outs
c. X-chart – special plays: wild pitch, Hit by ptich, Balk, Passed Ball
4. Logic for walks, Balks, Hit by Pitch, Passed Ball – to advance runners, score runners
5. Corrected some bugs:
a. Not removing >> when not confirming swap of players
b. not correctly allow change of position for outfield due to user defined characters
6. Added team name to roster screen (Home or Visitor)
Much of the coding is for play logic and not very visual, however here’s details on a couple of the items from above:
In the picture above highlighted is the defensive rating for Honus Wagner for SS, each player has rating for each position that he can play. The team total is the sum for the 8 position players. in the picture below you can see the team name and team total defensive rating is displayed. Logic was also added to adjust the defensive rating when players or positions are changed.
The way these rating is used is when a roll of 10 to 15 occurs when the pitching stats are accessed during an at bat. The chart below shows which rolls are automatic, as you can seen the larger the team defensive rating the more rolls that result in automatic outs.
And here is the logic to determine if there is an auto out or batter gets to swing: