Jump to content

Wisconsin takes the Winter Classic

Wisconsin beats Minnesota-Duluth 4-3 in the Winter Classic (demo game)

Read more

Charging Up

Chargers get ready for the upcoming training camps

Join Here

Need a team?

Firstly... welcome to the SimFBA! If you are new to the site, and need a team, make sure you head over to the new users section and view the available teams list. You will also be able to fill out your job application there! See you on the field, Coach!

Read more

Conference Tourney Time!

Tune in this wednesday for the first week of SimCBB Conference Tournaments!

Join Here

Recommended Posts

Posted

Welcome back to another simMLB dev diary. 

I ran into a problem in the initial construction of the sim engine in that I couldn't really answer the question "What would happen if a movable force met a static object?" or in other words, "What if the defense was 8 David Ortiz's and the baserunners were also David Ortiz?"

In the initial version of the 'ball in play' stage of the game simulation, there were opportunities for good and bad plays, but things like double plays and in the park home runs were not possible emergently. 

This bothered the heck out of me, both because I love chaos, but also because roster decisions need to matter, and truly abhorrent fielders (and really good ones) should make a true difference just as they do in irl baseball. I've got things working as I'd like and the 'ball in play' stage of the simulation is technically infinite given slow enough runners and bad enough fielders.  So this dev diary is to walk through that process.

Fielding

The process looks like this:

  1. Pitcher Batter interaction yields a ball that's in play.
  2. Ball location is determined.
  3. Barring no doubt homeruns (determined by bat contact type and location), defenders have the chance to make a play on a ball
    1. There are two types of balls, airballs (mostly 'flyballs', but not exclusively) and groundballs. The type and location of contact a batter makes with a pitch will dictate the velocity and whether it hits the ground before it gets to a fielder's zone of influence or not. 
    2. Each type of hit then weighs the defender's abilities (reaction time, ability to track the ball, catching ability, speed, etc.) differently to see whether they'd make a successful play on the ball to:
      1. Catch the ball and have the runner out
      2. Head off the ball that's already hit the ground
    3. Once they have the ball in hand, runners make a choice to continue running or head back to their initial base.
    4. The defender will have a chance to make a throw to get out a runner. Depending on the distance between the location of the ball being fielded and the player manning the base, power and accuracy play different roles in whether the throw or the catch are successful.
  4. Each time the defense makes a choice, the runners on the bases are evaluated for whether they're going to continue running. They will take into consideration the placement of the ball currently, the defensive abilities of the current ball-holder, and strategy inputs from the manager (you!). 
  5. Each time the runners make a decision, the defense makes their own decision to cut off the easiest (nearest, then highest base'd runner) runner and throw them out.
  6. This process continues until:
    1. There are no runners left on the bases.
    2. There is no more need for additional outs.
    3. All runners have decided to stay on base.


The way this will be communicated to the user is through the play by play export, which will include categories such as 'error list' and 'defensive actions' so you can track what kind of decisions your players are making  and whether they'll be successful.

The below play came from a grounder to short that was bobbled, the shortstop then threw it wide and then the firstbaseman tried to get the runner going to third out, but couldn't pick up the ball in time.

image.png.d7e24a35956ce6b3c3b94a3e417eecda.png

Stealing

Steal attempts can be initiated by the offense on a player to player likelihood basis, which can be adjusted by each manager. Here's the settings themselves. 

image.png.9271111645dda714ca64fca3ec35dda0.png

The ability to steal depends on the runner's ability as well as the defense's ability to play the steal and throw the runner out. You'll notice there's also a pickoff frequency setting there, and of course teams aren't powerless to counter an aggressive baserunning team. One of the ways they can stop the baserunners is to pick  them off before the pitch. These are also player by player settings you can adjust, and runs a chance of catching a baserunner not paying attention while gunning for that extra base.

Because it works in the system subsystem as regular fielding, a steal attempt is subject to the same potential chaos as defense in general, with pitcher and catcher potentially missing throws and fielders failing to snag the ball. 

The Shift

Hoping you keep the stealing at bay with pickoffs isn't the only strategy defense's have at their disposal either. Users can also implement shifts. Mechanically, what this does is essentially modify the defender/ball evaluation depending on the regular distance. 

So a shift forward on a contact hitter with no strength might hit a "flare, deep_if, far_left" (a pop up into the infield behind 3rd base) and instead of evaluating as a catchable ball for the 3rd baseman, they might evaluate it as a multiple 'tick' fielding effort, allowing the baserunner to collect a base before they even get to the ball (and vice versa for the other side of the shift)

As of right now, the shift is not an emergent property that you can adjust (the baseball diamond isn't rendered in the engine as a 2d plane or anything), so instead they're hand coded sets of adjustment modifiers for each position. 

As such, I've just added 2 shifts (one in each direction) for infield and outfield for a total of 9 defensive alignment combinations. There are probably other shifts that I've not thought of, and feel free to communicate those. As in real life, when there are runners on base

Oh, and as far as using the shift, players do push and/or pull as a natural aspect of their batting, so the trade-offs for running the shift are similar to real life - it works 60% of the time, every time.

Once the ball is in play, the defense functions just as it normally would with steal attempts and fieldable balls.

As far as setting the shift settings, it will depend on where the baseball sim will live and what's a reasonable degree of data to store about shift settings. It could be either a conditional setting (shift on any hitter with that profile) or discretely set by managers. I'm guessing for the first year it will be a general setting adjustable by managers, but we won't have the capacity to store shift data for every hitter / team matchup in the sim.

Wrapping Up

My intent with these systems is for the interplay between baserunning action and defensive capability (or lack thereof) to be varied and provide chances for users who want to to really dive into the ways these systems can change outcomes in games.

Next dev diary I'll walk through the (still evolving) game data export and how to parse them.

Thanks,
alexfall862

  • Basketball 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...