Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 4

Expected Value for Strategic Decisions

Recommended resources

Hello! Welcome to your fourth lesson in the Statistical Foundations module.

In our last lesson, we explored how probability distributions, like the Binomial and Normal distributions, can model the full range of outcomes for game mechanics. You now know how to determine the probability of getting exactly 3 critical hits in 10 attacks, or the likelihood that a damage roll falls within a certain range.

But when a player is faced with a choice—use Ability A or Ability B, build Unit X or Unit Y—they need a way to quickly compare the long-term benefits. This lesson introduces the tool for that comparison: Expected Value (EV).

Our learning outcome is to use expected value calculations to evaluate and compare the long-term outcomes of different strategic choices. We'll see that EV is the bridge between the probability distributions we just learned about and the concrete, practical decisions you make as a designer. It condenses a complex cloud of probabilities into a single, powerful number that represents the average result of a random event over many repetitions.

What is Expected Value?

At its core, expected value is a weighted average. It's the average outcome you would get if you could repeat a random event (like opening a loot chest or making an attack) an infinite number of times. It's not the value you expect on any single try, but the long-term trend.

To start building an intuition for this, let's watch a short video that frames the concept.

Expected Value Explained Intuitively

The video 'Expected Value Explained Intuitively' by Galak Breaks It Down provides an excellent high-level introduction to why EV is such a useful concept for making decisions under uncertainty.

Please watch the following segments: 00:45 - 01:42: This introduces the idea of probabilistic events and gives a clear, concise definition of expected value. 07:25 - 08:44: This part summarizes the utility of EV as a tool for comparing uncertain outcomes to 'sure things,' which is central to strategic decision-making.


How to Calculate Expected Value

Now that we have the "why," let's focus on the "how." The calculation is straightforward: for every possible outcome, you multiply its value by its probability, and then you sum all those products.

The formula is:

Where:

  • is the Expected Value of the random variable .
  • is a specific outcome's value (e.g., damage dealt, gold received).
  • is the probability of that specific outcome occurring.
  • means you sum this product across all possible outcomes.

Let's watch a detailed, step-by-step example of this calculation.

Expected Values, Main Ideas!!!

This video, 'Expected Values, Main Ideas!!!' from StatQuest, is one of the clearest explanations you'll find. It walks through a simple betting scenario, showing not just the final formula but the logic behind it.

Watch from the beginning up to 10:39. Pay close attention to how Josh Starmer: Calculates the probabilities for each outcome. Assigns a numerical value to each outcome (e.g., +$1 for a win, -$1 for a loss). Multiplies the values by their probabilities and sums them up to get the final EV.

The key insight from the video is that even if the individual outcomes are, for example, -$1 or +$1, the expected value can be a decimal like $0.66. This number doesn't represent a possible result of a single bet, but the average gain per bet over the long run.


Application 1: Balancing Loot Tables and Reward Systems

This concept has immediate applications in game design, particularly for balancing any system with random rewards. As a designer, you can use EV to precisely control the average value a player receives from a system, ensuring your game economy remains stable.

The following article provides a clear, practical walkthrough of this process.

Practical Game Theory - EV, EV, EV!

This article from Game Developer, 'Practical Game Theory - EV, EV, EV!', is written by a designer for designers. It gets straight to the point of how EV is a critical tool for game balance.

Please read two sections of this article: Start from the header 'One of the most important game theory topics...' and read through the coin flip and card drawing examples, ending just before 'More Advanced Implementations'. This reinforces the calculation. Then, jump to the section 'Using EV to Balance Loot Collection in an RPG'. This contains a fantastic, worked-out example of calculating the EV of a treasure chest.

As the article demonstrates, once you calculate EVPerChest, you can then predict the total wealth a player will accumulate (Wealth = #Chests x EVPerChest) and price your upgrades and items accordingly. This is a foundational technique for economic balancing.

Test your understanding!

You are designing a basic enemy in an RTS that, when defeated, has the following drop chances:

  • 50% chance to drop 10 minerals.
  • 40% chance to drop 25 minerals.
  • 10% chance to drop 100 minerals (a rare bonus).

What is the expected value of the mineral drop for defeating one of these enemies?

Show answer

We apply the formula :

  • Outcome 1: (10 minerals) * (0.50 probability) = 5
  • Outcome 2: (25 minerals) * (0.40 probability) = 10
  • Outcome 3: (100 minerals) * (0.10 probability) = 10

Summing them up: .

On average, a player will gain 25 minerals each time they defeat this enemy. You can now use this number to balance the cost of the units required to defeat it.


Application 2: Evaluating Strategic Choices

This is the heart of today's lesson. Expected value is your primary tool for comparing the effectiveness of different player actions.

Imagine a simple choice:

  • Ability A (Aggressive): 40% chance to deal 30 damage, 60% chance to miss and deal 0 damage.
  • Ability B (Basic): 90% chance to deal 12 damage, 10% chance to miss and deal 0 damage.

Which one is better on average? We can calculate the EV for each.

  • EV(Ability A) = (30 damage * 0.40) + (0 damage * 0.60) = 12 damage
  • EV(Ability B) = (12 damage * 0.90) + (0 damage * 0.10) = 10.8 damage

On average, the aggressive Ability A will produce more damage over the long run, even though it's less reliable on any single use. This kind of analysis is fundamental to balancing weapons, abilities, and unit stats. A visual tool called a decision tree is often used to map out these comparisons.

Decision Tree for Expected Value Calculation
This decision tree shows a comparison between 'Aggressive' (EV=9.1), 'Basic' (EV=12.85), and 'Cautious' (EV=10.5) strategies. By calculating the EV for each branch, a designer or player can identify that the 'Basic' strategy provides the highest average return.

A Look Ahead: EV in Interactive Scenarios

So far, we've assumed probabilities are fixed. But in RTS and Grand Strategy games, the outcome often depends on what your opponent does. This is the domain of Game Theory, which we'll cover in the next module. Expected value is the mathematical engine that drives it.

In game theory, we represent player choices in a payoff matrix. Let's say Player 1 (row player) can choose strategy S and Player 2 (column player) can choose strategy T. If P is the payoff matrix, the expected value e of the game can be calculated with matrix multiplication:

Here, S is a row matrix representing the probabilities of Player 1 choosing each of their options, and T is a column matrix for Player 2. This formula calculates the weighted average payoff across all possible matchups of their chosen strategies.

Chapter G—Game Theory

The following text from a chapter on Game Theory introduces this more advanced application of expected value. Don't worry about mastering all of it now; the goal is to see how the EV concept extends to interactive scenarios.

Please read the section 'G.3 Mixing Strategies' up to and including the 'Quick Example' that ends just before the 'Technology' note. Focus on the core idea: how to calculate the expected value when two players are both choosing from a mix of strategies.

This e = SPT framework is incredibly powerful for analyzing situations where you have to predict and counter an opponent's tendencies, a core loop in competitive strategy games.


Application 3: Balancing Complex Systems from Scratch

One of your goals is to develop a more rigorous method for "from scratch" system design. The concept of EV, used as a weighted average, provides a powerful framework for this. You can create a composite "Effective Value" for a unit or an upgrade by assigning numerical values to its various stats and abilities, weighting them by importance, and summing them up.

This is exactly what the Game Developer article suggests for unit balancing.

Practical Game Theory - EV, EV, EV!

Let's return to the 'Practical Game Theory - EV, EV, EV!' article for a final, highly practical application.

Please read the final section of the article, starting from 'For example, unit balancing for strategy games:'. This section outlines a step-by-step process for using EV to price units based on their stats.

This method can also be applied to your interest in meta-progression systems.

In-Game Skill Tree Example
This skill tree is a perfect example of a system where EV is crucial for balance. To decide between a skill that gives +5% critical strike chance versus one that gives a flat +10 damage, you would calculate the expected damage increase from each. The +5% crit chance's value depends on your base damage and crit multiplier, while the +10 damage is constant. EV allows you to compare these seemingly different upgrades on a common scale.

Summary and Next Steps

Today we've added a crucial tool to your balancing toolkit. Expected value lets you take a mechanic's probabilities and outcomes and boil them down to a single number representing its long-term average performance.

Key Takeaways:

  • Expected Value (EV) is the weighted average of all possible outcomes of a random event.
  • The formula is .
  • EV is a comparative tool. Its primary power lies in evaluating different strategic choices to see which yields a better outcome on average.
  • You can use EV to balance reward systems (like loot tables) and price game elements (like units or upgrades) based on their "Effective Value."

In our next lesson, we'll explore correlation. While EV helps us understand the value of a single choice, correlation will help us measure the strength of the relationship between two different variables, such as the link between a player's resource income and their win rate.