Knob

Randomness

You might say: nondeterminism, weighted choice, stochastic selection

A controlled chance of choosing among several reasonable options instead of always taking the same top choice.

What it does
Adds variety and makes behaviour harder to exploit without granting the AI permission to choose nonsense.
Ask
Where may chance enter, and what stops a low-scoring or unsafe action from winning?
Typical
Deterministic top choice, weighted choice among the best few options, or stochastic search with a bounded random seed.
Trouble
The opponent repeats a solved script, or randomness selects an action that the player can see is wrong.

What to look for

  1. Two good options chosen in different runs
  2. A weighted-choice trace showing the candidate set
  3. The same situation producing varied but plausible actions

Connections

Sources

  1. David Rez Graham, An Introduction to Utility Theory, Section 9.6You can get the best of both worlds by taking a subset of the highest scoring actions and choosing one of those with a weighted random.
  2. Kevin Dill, What Is Game AI?, p. 4we need to ensure that our random choices are all still reasonable.
  3. Steven Rabin, Game AI Pro: Collected Wisdom of Game AI Professionals, ch. 3, §3.1 IntroductionWe depend on it for variation in our games, using it to keep our gameplay fresh and our NPCs from becoming predictable
  4. Steven Rabin, Game AI Pro: Collected Wisdom of Game AI Professionals, ch. 3, §3.3.2 Randomness Doesn’t Look Random: The FixWhen generating a random sequence of numbers, if the next number will hurt the appearance of randomness, pretend that you never saw it and generate a new number
  5. Steven Rabin, Game AI Pro: Collected Wisdom of Game AI Professionals, ch. 3, §3.4 Perlin Noise for Game AIThis “smooth” nature of randomness means that we don’t get wild jumps from one random number to another, which can be a very desirable trait.

Use it on your project

teardown-apply: hold "Randomness" (randomness) from the teardown at https://teardownatlas.com/game-ai/ against my project

Paste it into a coding agent that has the teardown skills.

An AI agent wrote this map with the teardown skill. It can contain errors: check the sources before you rely on a part. About and legal