V1.1.5.202103211320 Fixing game log after dropped third strikes and errors

After analysing a whole simmed game, I identified several issues created by the inclusion of dropped third strikes and errors. It seemed that outs and baserunners were not being handled correctly. So as predicted, the logic didn’t work as intended. Also I realised that dropped third strikes were not actually errors so I had to stop them being recorded as such.

  1. Fixed dropped third strikes being recorded as errors and the text output to game log because of such.
  2. Moved the advanced to 3rd from 2nd (or 1st) and advanced to 2nd from 1st code that was in single, double, groundouts, flyouts, strikeouts (and would have been in many plays added later) to their own procedures (CheckAdvanceTo3rd and CheckAdvanceTo2nd). Will probably do the same with all runner movement to avoid duplication of code.
  3. Added text ‘advances to 3rd’ and ‘advances to 2nd’ to game log when such activity happens. This will help with debugging but also improve the user experience. Did this with two new Boolean variables advancedTo3rd and advancedTo2nd being toggled on (similar to errorMade) so that the procedure that builds the playResult string would know.
  4. Fixed number of outs not appearing for groundouts and flyouts. Did this by adding a Boolean variable called outMade (similar to errorMade) and moving the reporting of outMade out of strikeout section of playresult procedure.

The following game log is from a wholly simmed game. Note that chance of dropped third strike is extremely high (50%) so I could test the logic. Hence the massive number of runs. The (number) before a play is the playresult value assigned to that play within the code. 

Inning 1, PEN batting

(14) 0 homers on a 0-0 count. 

(1) 327 strikes out but reaches 1st on a dropped third strike. 

(0) 325 walks. 327 advances to 2nd. 

(0) 302 walks. 327 advances to 3rd. 325 advances to 2nd. 

(11) 303 singles on a 1-1 count. 327 scores. 325 advances to 3rd. 302 advances to 2nd. 

(12) 322 doubles on a 0-2 count. 325 scores. 302 scores. 303 advances to 3rd. 

(14) 328 homers on a 2-1 count. 303 scores. 322 scores. 

(11) 311 singles on a 0-2 count. 

(1) 308 strikes out. 1 out. 

(12) 316 doubles on a 0-2 count. 311 advances to 3rd. 

(14) 327 homers on a 2-2 count. 311 scores. 316 scores. 

(12) 325 doubles on a 0-2 count. 

(1) 302 strikes out but reaches 1st on a dropped third strike. 

(1) 303 strikes out. 2 out. 

(12) 322 doubles on a 0-0 count. 325 scores. 302 advances to 3rd. 

(1) 328 strikes out. 3 out. 

End of inning. Runs: 10, Hits: 9, Errors: 0, Walks: 2, Left on base: 2, Pitches: TBA

Inning 1, BRS batting

(11) 421 singles on a 0-1 count. 

(1) 423 strikes out. 1 out. 

(14) 401 homers on a 1-2 count. 421 scores. 

(11) 403 singles on a 0-1 count. 

(1) 410 strikes out. 2 out. 

(1) 417 strikes out. 3 out. 

End of inning. Runs: 2, Hits: 3, Errors: 0, Walks: 0, Left on base: 1, Pitches: TBA

Inning 2, PEN batting

(1) 311 strikes out but reaches 1st on a dropped third strike. 

(1) 308 strikes out. 1 out. 

(20) 316 grounds out on a 2-2 count. 311 advances to 2nd. 2 out. 

(1) 327 strikes out. 3 out. 

End of inning. Runs: 0, Hits: 0, Errors: 0, Walks: 0, Left on base: 1, Pitches: TBA

Inning 2, BRS batting

(12) 402 doubles on a 0-1 count. 

(1) 415 strikes out but reaches 1st on a dropped third strike. 

(1) 405 strikes out. 1 out. 

(12) 421 doubles on a 0-0 count. 402 scores. 415 advances to 3rd. 

(12) 423 doubles on a 1-2 count. 415 scores. 421 scores. 

(14) 401 homers on a 0-0 count. 423 scores. 

(12) 403 doubles on a 0-1 count. 

(20) 410 grounds out on a 1-2 count. 403 advances to 3rd. 2 out. 

(20) 417 grounds out on a 2-1 count. 3 out. 

End of inning. Runs: 5, Hits: 5, Errors: 0, Walks: 0, Left on base: 1, Pitches: TBA

Inning 3, PEN batting

(1) 325 strikes out but reaches 1st on a dropped third strike. 

(1) 302 strikes out. 1 out. 

(20) 303 grounds out on a 0-2 count.  Error made; 303 reached 1st safely. 325 advances to 2nd. 

(20) 322 grounds out on a 0-1 count. 325 advances to 3rd. 303 advances to 2nd. 2 out. 

(12) 328 doubles on a 1-2 count. 325 scores. 303 scores. 

(12) 311 doubles on a 1-0 count. 328 scores. 

(1) 308 strikes out. 3 out. 

End of inning. Runs: 3, Hits: 2, Errors: 1, Walks: 0, Left on base: 1, Pitches: TBA

Inning 3, BRS batting

(1) 402 strikes out. 1 out. 

(20) 415 grounds out on a 0-0 count.  Error made; 415 reached 1st safely. 

(1) 405 strikes out. 2 out. 

(1) 421 strikes out but reaches 1st on a dropped third strike. 415 advances to 2nd. 

(1) 423 strikes out. 3 out. 

End of inning. Runs: 0, Hits: 0, Errors: 1, Walks: 0, Left on base: 2, Pitches: TBA

Inning 4, PEN batting

(1) 316 strikes out but reaches 1st on a dropped third strike. 

(1) 327 strikes out. 1 out. 

(11) 325 singles on a 2-2 count. 316 advances to 2nd. 

(1) 302 strikes out. 2 out. 

(14) 303 homers on a 1-0 count. 316 scores. 325 scores. 

(1) 322 strikes out. 3 out. 

End of inning. Runs: 3, Hits: 2, Errors: 0, Walks: 0, Left on base: 0, Pitches: TBA

Inning 4, BRS batting

(1) 401 strikes out. 1 out. 

(1) 403 strikes out. 2 out. 

(1) 410 strikes out. 3 out. 

End of inning. Runs: 0, Hits: 0, Errors: 0, Walks: 0, Left on base: 0, Pitches: TBA

Inning 5, PEN batting

(1) 328 strikes out. 1 out. 

(1) 311 strikes out. 2 out. 

(1) 308 strikes out but reaches 1st on a dropped third strike. 

(1) 316 strikes out. 3 out. 

End of inning. Runs: 0, Hits: 0, Errors: 0, Walks: 0, Left on base: 1, Pitches: TBA

Inning 5, BRS batting

(12) 417 doubles on a 0-0 count. 

(1) 402 strikes out but reaches 1st on a dropped third strike. 

(1) 415 strikes out. 1 out. 

(1) 405 strikes out. 2 out. 

(14) 421 homers on a 1-2 count. 417 scores. 402 scores. 

(12) 423 doubles on a 1-1 count. 

(11) 401 singles on a 0-2 count. 423 advances to 3rd. 

(12) 403 doubles on a 1-1 count. 423 scores. 401 advances to 3rd. 

(1) 410 strikes out but reaches 1st on a dropped third strike. 

(1) 417 strikes out. 3 out. 

End of inning. Runs: 4, Hits: 5, Errors: 0, Walks: 0, Left on base: 3, Pitches: TBA

Inning 6, PEN batting

(11) 327 singles on a 3-1 count. 

(14) 325 homers on a 0-2 count. 327 scores. 

(13) 302 triples on a 0-1 count. 

(1) 303 strikes out. 1 out. 

(30) 322 flies out on a 1-1 count.  Error made; 322 reached 1st safely. 302 scores. 

(1) 328 strikes out. 2 out. 

(1) 311 strikes out but reaches 1st on a dropped third strike. 322 advances to 2nd. 

(1) 308 strikes out but reaches 1st on a dropped third strike. 322 advances to 3rd. 311 advances to 2nd. 

(1) 316 strikes out. 3 out. 

End of inning. Runs: 3, Hits: 3, Errors: 1, Walks: 0, Left on base: 3, Pitches: TBA

Inning 6, BRS batting

(30) 402 flies out on a 0-1 count. 1 out. 

(11) 415 singles on a 1-2 count. 

(20) 405 grounds out on a 2-2 count. 415 advances to 2nd. 2 out. 

(11) 421 singles on a 2-2 count. 415 advances to 3rd. 

(1) 423 strikes out but reaches 1st on a dropped third strike. 415 scores. 421 advances to 2nd. 

(1) 401 strikes out but reaches 1st on a dropped third strike. 421 advances to 3rd. 423 advances to 2nd. 

(1) 403 strikes out. 3 out. 

End of inning. Runs: 1, Hits: 2, Errors: 0, Walks: 0, Left on base: 3, Pitches: TBA

Inning 7, PEN batting

(12) 327 doubles on a 0-1 count. 

(11) 325 singles on a 1-1 count. 327 advances to 3rd. 

(1) 302 strikes out. 1 out. 

(1) 303 strikes out. 2 out. 

(1) 322 strikes out but reaches 1st on a dropped third strike. 327 scores. 325 advances to 2nd. 

(12) 328 doubles on a 1-2 count. 325 scores. 322 advances to 3rd. 

(1) 311 strikes out but reaches 1st on a dropped third strike. 

(20) 308 grounds out on a 0-0 count.  Error made; 308 reached 1st safely. 322 scores. 328 advances to 3rd. 311 advances to 2nd. 

(1) 316 strikes out but reaches 1st on a dropped third strike. 328 scores. 311 advances to 3rd. 308 advances to 2nd. 

(1) 327 strikes out but reaches 1st on a dropped third strike. 311 scores. 308 advances to 3rd. 316 advances to 2nd. 

(1) 325 strikes out but reaches 1st on a dropped third strike. 308 scores. 316 advances to 3rd. 327 advances to 2nd. 

(30) 302 flies out on a 0-1 count.  Error made; 302 reached 1st safely. 316 scores. 327 advances to 3rd. 325 advances to 2nd. 

(1) 303 strikes out but reaches 1st on a dropped third strike. 327 scores. 325 advances to 3rd. 302 advances to 2nd. 

(12) 322 doubles on a 1-1 count. 325 scores. 302 scores. 303 advances to 3rd. 

(30) 328 flies out on a 0-0 count. 3 out. 

End of inning. Runs: 10, Hits: 4, Errors: 2, Walks: 0, Left on base: 2, Pitches: TBA

Inning 7, BRS batting

(1) 410 strikes out but reaches 1st on a dropped third strike. 

(1) 417 strikes out. 1 out. 

(11) 402 singles on a 1-1 count. 410 advances to 2nd. 

(11) 415 singles on a 0-2 count. 410 advances to 3rd. 402 advances to 2nd. 

(1) 405 strikes out. 2 out. 

(12) 421 doubles on a 1-2 count. 410 scores. 402 scores. 415 advances to 3rd. 

(20) 423 grounds out on a 0-2 count. 3 out. 

End of inning. Runs: 2, Hits: 3, Errors: 0, Walks: 0, Left on base: 2, Pitches: TBA

Inning 8, PEN batting

(14) 311 homers on a 1-2 count. 

(1) 308 strikes out. 1 out. 

(11) 316 singles on a 0-0 count. 

(30) 327 flies out on a 2-2 count.  Error made; 327 reached 1st safely. 316 advances to 2nd. 

(1) 325 strikes out. 2 out. 

(13) 302 triples on a 0-0 count. 316 scores. 327 scores. 

(12) 303 doubles on a 0-0 count. 302 scores. 

(1) 322 strikes out but reaches 1st on a dropped third strike. 

(12) 328 doubles on a 1-0 count. 303 scores. 322 advances to 3rd. 

(30) 311 flies out on a 0-0 count.  Error made; 311 reached 1st safely. 322 scores. 328 advances to 3rd. 

(11) 308 singles on a 0-0 count. 328 scores. 311 advances to 2nd. 

(11) 316 singles on a 0-0 count. 311 advances to 3rd. 308 advances to 2nd. 

(30) 327 flies out on a 0-2 count. 3 out. 

End of inning. Runs: 7, Hits: 7, Errors: 2, Walks: 0, Left on base: 3, Pitches: TBA

Inning 8, BRS batting

(1) 401 strikes out but reaches 1st on a dropped third strike. 

(1) 403 strikes out. 1 out. 

(30) 410 flies out on a 1-1 count.  Error made; 410 reached 1st safely. 401 advances to 2nd. 

(0) 417 walks. 401 advances to 3rd. 410 advances to 2nd. 

(12) 402 doubles on a 0-0 count. 401 scores. 410 scores. 417 advances to 3rd. 

(1) 415 strikes out but reaches 1st on a dropped third strike. 

(1) 405 strikes out. 2 out. 

(20) 421 grounds out on a 0-1 count. 3 out. 

End of inning. Runs: 2, Hits: 1, Errors: 1, Walks: 1, Left on base: 3, Pitches: TBA

Inning 9, PEN batting

(1) 325 strikes out but reaches 1st on a dropped third strike. 

(12) 302 doubles on a 0-1 count. 325 advances to 3rd. 

(11) 303 singles on a 0-0 count. 325 scores. 302 advances to 3rd. 

(11) 322 singles on a 2-1 count. 302 scores. 303 advances to 2nd. 

(12) 328 doubles on a 1-0 count. 303 scores. 322 advances to 3rd. 

(11) 311 singles on a 1-1 count. 322 scores. 328 advances to 3rd. 

(11) 308 singles on a 1-2 count. 328 scores. 311 advances to 2nd. 

(1) 316 strikes out. 1 out. 

(11) 327 singles on a 0-0 count. 311 advances to 3rd. 308 advances to 2nd. 

(14) 325 homers on a 1-2 count. 311 scores. 308 scores. 327 scores. 

(1) 302 strikes out. 2 out. 

(1) 303 strikes out but reaches 1st on a dropped third strike. 

(14) 322 homers on a 0-0 count. 303 scores. 

(1) 328 strikes out. 3 out. 

End of inning. Runs: 11, Hits: 9, Errors: 0, Walks: 0, Left on base: 0, Pitches: TBA

Inning 9, BRS batting

(1) 423 strikes out. 1 out. 

(14) 401 homers on a 0-2 count. 

(11) 403 singles on a 1-2 count. 

(1) 410 strikes out. 2 out. 

(1) 417 strikes out. 3 out. 

End of inning. Runs: 1, Hits: 2, Errors: 0, Walks: 0, Left on base: 1, Pitches: TBA

Final: 

Penrith Panthers (away): 47

Brisbane Broncos (home): 17

Winner: Penrith Panthers


Comments

  1. Need to make note of dropped third strikes where batter can’t advance due to runner and batter thrown out at first, just to check it’s working correctly.

    ReplyDelete
  2. All looks good for this, except the first batter up in top of 1st has 0 instead of ID. This seems to be an issue only when simming whole game. Could possibly be happening in sim to top of last as well.

    ReplyDelete

Post a Comment

Popular posts from this blog

MLB (Road to) The Show attribute progression

MLB The Show 21: create a stadium prediction & using created stadiums in online games

V1.1.4.202103032300 Basic player creator, line score tidy up and additional play results, including errors