Baseball, but first... Monopoly.

It's been a good five years since I've done any serious algorithm design; most of the effort since I last taught it has been put into databases and querying. No more perfect an opportunity to blend the two than baseball, the thing that occupies around 75-80% of my brain's attention. But more on that next time.

Last time I did something of this calibre was create a 2-6 player Monopoly game back in 2014. That went well. Laid the foundation for a full Monopoly game, following the official rulebook rules. Then I decided to disable the user interface and automatically simulate thousands of turns in a game. 

Based on simulating seven games of two to six players, with varying maximums of 6,000 to 12,000 rolls per game (see table below for final tallies), I can confirm that which was already known, which is that the most occupied board location is Jail, with nearly three times as many end-of-turn occupants as its nearest competition: Trafalgar Square (red #3), Vine Street (orange #3) and Fenchurch Street Station (railroad #3). In most games, those four locations made up the top four (although there were two where one of those three purchasable locations were as low as 7th). Jail was always first, with the others varying in probability. 

Note that it is referring to being in jail, not Just Visiting which is considered a different location despite occupying the same board space. Being in jail triggered different logic to Just Visiting. Board ID #30 was the logical position in the array to hold players in jail. Each turn that ended with a player being in jail added one to its times occupied. From memory, there was no decision logic for early/late jail strategy, just rolling the dice to try and get doubles each time and on the third turn if no doubles manifested, it was pay up and move. This technically could create a bias however it does take the human element out of it which can only improve its reliability, right?

All three Chance squares consistently made the bottom three. Unexpectedly this included the Chance at location #22 (two after Free Parking). After further consideration, it was obvious that this is because despite being in a prime position on the board, two-thirds (10/15) of the game's Chance cards redirect the player to another location, therefore it is not occupied at the end of such a turn. This of course explains why 'Go To Jail' can never actually be occupied, and why it was an obvious choice to use its position #30 in the board array as the location for In Jail. 

Anyway, having not run the simulator, or tweaked or even looked at the code since 2014, I'm a bit rusty on how it works but I was satisfied at the time it was 100% a valid simulator.  Outcomes are below.


Where am I going with this? Nowhere. This started as a post that was going to document the first version of the baseball simulator I'm writing, but unsurprisingly I was sidetracked. Next time, Yahtzee. Next time, baseball simulator version 1.

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