Monthly Archives: May 2019

Video Game Probability #1: How to Grow 5 Golden Crops in Stardew Valley

Welcome to the first installment of Video Game Probability! You can read the introduction and motivation for this series here along with a list of all posts. This post contains mild spoilers for probability distributions in Stardew Valley. Without further ado, I’m going to jump in!

Stardew Valley is a farming/lifestyle RPG where you grow crops, fish, find love, fight monsters, go on quests, and so much more. I have so much to say about this game and I’m trying so hard to hold in my enthusiasm – I hope you appreciate the sacrifices I make in the name of succinct writing. (But no really I love this game, it’s on Steam, it’s on Switch, it’s even on iOS and Android, so you have no excuse not to play it, please give it a try, it has something for everyone.)

One of your major tasks in Stardew Valley is to fix the Community Center. If you have no soul, you can go corporate and pay a ton of money, but most people go for the Bundle route because they’re not dead inside. A bundle is a set of items (crops, foraged goods, etc) that you donate to the spirits of the forest in exchange for rewards. Once you complete every bundle, you fix the Community Center!

Today, we’re going to talk about the Quality Crops bundle: you must gather 5 golden parsnips, melons, pumpkins, and corn to complete the bundle. The pesky thing about these crops is that parsnips are only grown in spring, melons are only grown in summer, pumpkins are only grown in fall, and corn can be grown in summer or fall. So if you reach the end of spring or summer and didn’t manage to collect the 5 crops for that season, you have to wait a whole year for another chance!

When you harvest a crop, it has a chance of being regular, silver, or gold quality. The game calculates your chances based on your farming level and what fertilizer, if any, was used. (Note: While “luck” is a mechanic in the game that I’d love to explore further, I don’t think your daily luck affects your harvests – correct me if I’m wrong!)

Here’s our big question for this post: How many crops should we plant with what fertilizer in order to guarantee a certain probability of getting at least 5 golden crops?

Continue reading

Video Game Probability: Introduction

A big theme of my computer-science-related content is that I have a hard time understanding concepts unless they’re connected to a real-world use case. I was required to take introduction to probability to complete my degree, and I really struggled because of the abstractness of terms like “geometric distribution” and “expected value.” I didn’t do enough work to understand how probability could connect back to real problems I’d want to solve, so I didn’t manage to internalize its value or develop an intuition for it.

(It took me weeks to understand that “expected value” really meant something like “weighted average” because I didn’t make the connection and no one pointed it out to me… those weeks were tough.)

Probability still doesn’t really come up at work a lot now (phew!), but I still wish I’d paid more attention because it keeps coming up in video games that I’m playing. And while I have enough vocabulary saved up to know what to look up to solve a problem, I haven’t practiced enough to be able to work out the math quickly. So I’m going to start sharing a couple of problems that interest me in hopes of helping out anyone who’s in my shoes.

I make no promises on how frequently I’ll add to this series, but I’m hoping to cover situations in Hearthstone (calculating lethal, chances of drawing a certain outcome) and Stardew Valley (growing certain crops, lightning). I’m open to requests for well-defined and motivated problems in your favorite video games too!

Here’s the index of posts in this series: