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

This was a pretty huge four days!
  • Player creator: This idea came to me when I started wondering how I could fulfil my plan of creating 10,000 players at random, at the same time giving them realistic attributes.
    1. Added a separate form to generate players which can eventually be saved to database. Presently just generates attributes for contact and power vs L/R based on an entered minimum number of points to allocate, and entered maximum value for bonus points.
    2. Bonus points are calculated at random and added to total points to allocate across all attributes. If an attribute is already on 100, that bonus point is wasted. Works pretty well and will be expanded upon.
  • Line score tidy up: This was something that was mostly a quick fix so I thought I may as well get it out of the way now.
    1. Now the button for the bottom of the current inning is disabled if playing the top of the inning.
    2. Now puts an X in the bottom of the 9th if not played at game end and disables that button.
  • Additional play results: After completing the line score tidy up I suddenly decided to put the errors variable to use. I then decided that the best way to do that would be to add in a couple more play results.
    1. There was part of the code in there for groundouts and flyouts (the pitchoutcome number was generated but the result diverted to the ‘single’ code. So I just had to create two new procedures that processed the outs, as well as adding additional logic to process these pitchoutcomes and output the correct text as the playresult.
    2. On groundouts, baserunners move forward a base, and 1st is left empty.
    3. On flyouts, baserunners presently don’t move forward, and 1st is left empty. But code is left in there for later modification.
    4. This meant I could put in the error logic. Now strikeouts, groundouts and flyouts can each result in an error, due to each procedure passing a value that affects the error chance to a new ‘play error checking’ procedure. That value is the maximum in a random number generator. Then if the random number is under 10, it’s an error. Error on strikeout is presently a 10 in 200 chance, error on GO or FO presently 10 in 100 chance. Obviously this will all change to incorporate fielder attributes etc.
    5. Realised after finishing up that groundouts would still have runners advancing on 3rd out so had to fire it up again to add in more code to prevent this. Also decided to add code for sac fly on flyout with less than two outs. Not advancing runners on 2nd or 1st. Not yet. All these are circumstantial results of course and can be redone later. All up an extra 15 mins work.
    6. Realised after finishing up again and doing a short test that a strikeout with an error (ie dropped third strike) results in the baserunner on 1st disappearing as they are replaced by batter, and don’t advance. Fixed that. Also had to implement all dropped third strike logic. Another 15 mins. I really need to stop testing straight away. This logic may or may not work as intended. To be continued.

In the meantime, here's a game log output. Feel free to go over it with a fine-tooth comb to find any errors (the numbers before each play are the internal id of the pitch result). For testing purposes I increased the error chance to 1/4 for a strikeout and 1/2 for groundouts and flyouts. I think.


Inning 1, PEN batting

(1) 0 strikes out. 1 out.

(1) 326 strikes out. 2 out.

(1) 312 strikes out. 3 out.

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

Inning 1, BRS batting

(1) 417 strikes out. 1 out.

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

(1) 401 strikes out. 2 out. Error made; batter reached 1st safely.

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

(1) 419 strikes out. 3 out.

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

Inning 2, PEN batting

(1) 323 strikes out. 1 out.

(1) 304 strikes out. 1 out. Error made; batter reached 1st safely.

(1) 321 strikes out. 2 out. Error made; batter reached 1st safely.

(14) 315 homers on a 1-0 count. 304 scores. 

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

(1) 317 strikes out. 3 out.

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

Inning 2, BRS batting

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

(1) 413 strikes out. 1 out.

(1) 423 strikes out. 2 out.

(30) 424 flies out on a 2-2 count.  Error made; batter reached 1st safely.

(14) 417 homers on a 0-1 count. 424 scores. 

(0) 418 walks. 

(1) 401 strikes out. 3 out.

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

Inning 3, PEN batting

(1) 305 strikes out. 1 out.

(30) 326 flies out on a 3-1 count.  Error made; batter reached 1st safely.

(1) 312 strikes out. 2 out.

(1) 323 strikes out. 2 out. Error made; batter reached 1st safely.

(1) 304 strikes out. 3 out.

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

Inning 3, BRS batting

(1) 406 strikes out. 1 out.

(1) 419 strikes out. 2 out.

(1) 416 strikes out. 2 out. Error made; batter reached 1st safely.

(1) 413 strikes out. 3 out.

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

Inning 4, PEN batting

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

(1) 315 strikes out. 1 out.

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

(30) 317 flies out on a 1-1 count.  Error made; batter reached 1st safely.

(1) 305 strikes out. 2 out.

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

(1) 312 strikes out. 3 out.

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

Inning 4, BRS batting

(30) 423 flies out on a 0-2 count.  Error made; batter reached 1st safely.

(1) 424 strikes out. 1 out.

(1) 417 strikes out. 2 out.

(1) 418 strikes out. 2 out. Error made; batter reached 1st safely.

(1) 401 strikes out. 3 out.

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

Inning 5, PEN batting

(1) 323 strikes out. 1 out.

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

(20) 321 grounds out on a 0-0 count. 304 scores. 

(1) 315 strikes out. 2 out. Error made; batter reached 1st safely.

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

(1) 317 strikes out. 3 out.

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

Inning 5, BRS batting

(1) 406 strikes out. 1 out.

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

(14) 416 homers on a 0-2 count. 419 scores. 

(1) 413 strikes out. 2 out.

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

(1) 424 strikes out. 3 out.

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

Inning 6, PEN batting

(30) 305 flies out on a 1-2 count.  Error made; batter reached 1st safely.

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

(1) 312 strikes out. 1 out.

(1) 323 strikes out. 2 out.

(1) 304 strikes out. 3 out.

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

Inning 6, BRS batting

(1) 417 strikes out. 0 out. Error made; batter reached 1st safely.

(1) 418 strikes out. 1 out.

(1) 401 strikes out. 2 out. Error made; batter reached 1st safely.

(30) 406 flies out on a 1-0 count.  Error made; batter reached 1st safely.

(1) 419 strikes out. 3 out.

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

Inning 7, PEN batting

(1) 321 strikes out. 1 out.

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

(1) 303 strikes out. 2 out. Error made; batter reached 1st safely.

(1) 317 strikes out. 2 out. Error made; batter reached 1st safely.

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

(1) 326 strikes out. 3 out.

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

Inning 7, BRS batting

(1) 416 strikes out. 0 out. Error made; batter reached 1st safely.

(1) 413 strikes out. 1 out. Error made; batter reached 1st safely.

(1) 423 strikes out. 2 out. Error made; batter reached 1st safely.

(1) 424 strikes out. 3 out.

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

Inning 8, PEN batting

(30) 312 flies out on a 0-0 count. 

(1) 323 strikes out. 2 out.

(1) 304 strikes out. 3 out.

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

Inning 8, BRS batting

(1) 417 strikes out. 1 out.

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

(1) 401 strikes out. 2 out.

(12) 406 doubles on a 1-0 count. 418 scores. 

(12) 419 doubles on a 0-1 count. 406 scores. 

(1) 416 strikes out. 3 out.

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

Inning 9, PEN batting

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

(1) 315 strikes out. 0 out. Error made; batter reached 1st safely.

(1) 303 strikes out. 1 out. Error made; batter reached 1st safely.

(1) 317 strikes out. 2 out.

(0) 305 walks. 

(12) 326 doubles on a 0-2 count. 321 scores. 315 scores. 

(1) 312 strikes out. 3 out.

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

Inning 9, BRS batting

(1) 413 strikes out. 0 out. Error made; batter reached 1st safely.

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

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

(12) 417 doubles on a 0-1 count. 413 scores. 423 scores. 

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

Final: 

Penrith Panthers (away): 7

Brisbane Broncos (home): 8

Winner: Brisbane Broncos


Comments

  1. Dropped third strike is not an error and should not be scored as such. I don’t think.

    ReplyDelete
  2. Very first plate appearance has ‘0 strikes out’. Looks like this happens before the first player is loaded. How the heck did that happen???

    ReplyDelete
    Replies
    1. Looks like it only happens when simming. Weird.

      Delete
  3. 2nd batter in bottom of 1st grounds out but doesn’t show how many out.

    ReplyDelete
  4. When strikeout with runner on 1st and less than two outs, it still says error made and batter reached 1st safely, even though batter is out and number of outs increases. So just a problem with the way playresult text is built.

    ReplyDelete
  5. Bottom of the second batter 416 disappeared; should have scored a run on the homer

    ReplyDelete
    Replies
    1. Probably no longer an issue; the problem there would have been the next baserunner taking their place without 416 advancing correctly.

      Delete
  6. Top of 4th, bases are loaded and single does not score a run

    ReplyDelete
    Replies
    1. Probably no longer an issue, would have been caused by fly out not being done correctly.

      Delete
  7. Bottom of the 6th left on base should be 3

    ReplyDelete
    Replies
    1. Should actually have been 2. Would have been caused by not advancing the runner on 1st on the fly ball error. Probably no longer an issue.

      Delete

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