Summary

Economy simulation with queues uses queueing theory as a lightweight approximation for how goods enter and leave a merchant’s inventory over time. Instead of fully simulating every trader, route, and market force in the world, the game models arrival and departure rates and uses those to generate inventory changes that feel plausible to players. This is especially useful for off-screen economies in open worlds, where a fully explicit simulation would be expensive and often unnecessary. (Manslow, Game AI Pro 2, see source-game-ai-pro-2)

Key ideas

  • Inventory as a queueing problem: Goods arrive, wait, and leave at average rates.
  • Believability over realism: The aim is not a perfect economy model, but an inventory that changes in ways players accept as sensible.
  • Cheap off-screen simulation: This is well suited to merchants or settlements the player visits occasionally.
  • Parameter tuning matters: Arrival rate, sale rate, and restock delay shape whether a merchant feels generous, scarce, or unstable.

In practice

The chapter’s core idea is that many merchant inventories do not need a full world simulation behind them. They need:

  • some items that persist
  • some items that churn
  • broad consistency with the fiction and elapsed time

Simple production sketch:

public class MerchantInventoryModel
{
    public float arrivalRatePerDay = 2f;
    public float saleRatePerDay = 1.5f;
 
    public int SimulateStock(int currentStock, float daysElapsed)
    {
        int arrivals = Mathf.RoundToInt(arrivalRatePerDay * daysElapsed);
        int departures = Mathf.RoundToInt(saleRatePerDay * daysElapsed);
        return Mathf.Max(0, currentStock + arrivals - departures);
    }
}

This is not a full queueing implementation, but it captures the design use: plausible stock drift over time with very low computational cost.

Evidence

  • Manslow’s argument is that players mostly need inventory changes to align with common-sense expectations rather than with an economist’s model.
  • Queueing models are attractive because they preserve variation and temporal change without forcing the game to simulate every market interaction.
  • This makes them a useful middle ground between static shop inventories and fully simulated economies.

Implications

  • Queue-based simulation pairs naturally with internal-economy and games-as-a-service style live tuning.
  • It is especially helpful when an open world needs to suggest economic life without dedicating large CPU budgets to invisible systems.
  • It also gives designers tunable scarcity without hard-coding every merchant inventory by hand.

Open questions

  • When does burst traffic, quest demand, or player exploitation break the assumptions of a simple queue model?
  • How should rare items differ from commodity items in a queue-based model?
  • Is the simplest useful model just “expected arrivals minus expected departures”, or does a proper stochastic queue materially improve believability?

internal-economy · game-analytics · games-as-a-service · player-lifecycle · source-game-ai-pro-2