Baseball game dev diary: V1.1.1.202101011620 Adding a diamond

Having overcome the frustration of the last lot of changes, I shifted my focus to improving the interface somewhat.

  1. Game log and line score now visible by default.
  2. Fixed base buttons getting messed up when simming forward. Was progressing to next batter before checking which base buttons needed disabling, so batter, on deck and in hole were always enabled after simming forward.
  3. Line score buttons now clear when rewinding game.
  4. Replaced function to generate a rounded up inning number (called 29 times) with an integer variable and add to it when incrementing inning only if int(inning) is not equal to inning number (ie only when progressing to top of an inning). Probably more efficient.
  5. Made the start game, sim forward, rewind and sim game menu items not buttons, and the show game log and show line score menu items, not checkboxes. Will remove buttons once I’m satisfied menu items are working correctly. Game log and line score toggles work as required.
  6. Moved the call to ButtonsToggleStartGame inside (end of) ResetGame procedure. There were only three places it was called and all were immediately after calling ResetGame. Commented out those calls for later removal.
  7. Added code to detect a no-hitter when simming multiple games. Just for fun.
  8. Added a new form called Field which features a diamond image. Baserunner buttons duplicated on this form and fielder buttons added (not active yet). Once positioned, noted down all of the button locations on the form as they will have to be added as arrays of buttons: baserunner buttons(0-9 with 4-7 inactive?) and fielder buttons (1-9). The design-time property for the form’s size doesn’t seem to correspond with the runtime size (verified with a message box that outputs the width and height). So I’m ignoring the design time size properties and setting them when the form loads.

After simming over 150,000 games in an attempt to generate a no-hitter including a 100,000 game loop which took a long, long time(don’t know how long, I went out for an hour or so and left the start and finish times variables commented out), I gave up. With hits being a 30% chance in 27 plate appearances it’s a one in 15,000 chance that a game is a no-hitter with the current level of RNG, at least I think that’s what it is. So mathematically I should have had six or seven but it didn’t happen. Plus simming is starting to take quite a while with all of the updating to the line score and game log, even when not visible. Presently 100 games is about 4 seconds when not visible, and 20 seconds when visible. May improve times once all base buttons (incl on deck and in hole) are moved to field form. This will also significantly simplify the code for simming/not simming decisions.

  1. Duplicated all base button functionality on field form including showing runner ID and making it clickable to show player info. Seems to be working correctly. Changed button enabling to button visibility instead. That way baserunner buttons especially will not be shown unless there is a runner, making the form cleaner.
  2. Add menu option to show/hide all interface forms (game log, line score, field).
  3. Tidied up main form by removing all content that has moved to either menu or field form. Didn’t save a copy first, which was really, really stupid. Thankfully because I had basically done a parallel rollout of the new content (ie with old content still fully operational) there were no issues. Field form control objects are all arrays of controls.
  4. Red Ted thumbnail image added to main form 😊. This project is not affiliated with MLB The Show in any way.


Comments

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