Spielerando

Stamina System

A stamina system is a bar that actions use up and rest fills back. Sprinting drains it steadily, a dodge costs a set amount or does not happen, and refilling starts after a short wait. Empty the bar and the character cannot sprint or dodge until it refills to a set level.

Also called: Stamina bar, Stamina meter, Fatigue system, Endurance meter.

An exhausted walrus in a blue coat rows a red skiff through a storm with his eyes shut, under a small floating bar that is almost empty.
The Long Oar, an invented storm-rowing survival game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Stamina System" to my game.

What it should do: Stamina makes every action cost something right now, so the player paces themselves and each sprint or dodge becomes a real choice.

Build it exactly as this state machine. First check that it fits my game, then build it like this:

```mermaid
stateDiagram-v2
  [*] --> full
  full: Bar full
  spend: Spending
  wait: Short wait
  refill: Refilling
  worn: Worn out
  full --> spend: sprint or big move
  spend --> spend: keeps spending
  spend --> wait: stops spending
  spend --> worn: bar is empty
  wait --> spend: spends again
  wait --> refill: wait is over
  refill --> spend: spends again
  refill --> full: bar is full
  worn --> worn: spending refused
  worn --> refill: recovery level reached
```

Use these starting values:
- maxStamina: 100 units
- regenRate: 30 units/s
- regenDelay: 0.7 s
- sprintCost: 18 units/s
- recoverAt: 25 units

Watch out for these common mistakes:
- The bar looks right but the move still happens: Tell your AI: check the cost before spending, and refuse the move if the bar cannot pay for it. Then the bar cannot go too low in the first place.
- A bonus overfills the bar: Tell your AI: only spend stamina when the cost is above zero.
- The bar flickers at empty: Tell your AI: block all stamina use at zero until the bar reaches the recovery level.
- The bar refills between actions: Tell your AI: after each use, hold the refill for the short wait.
- Worn out for good: Tell your AI: a full bar always ends the worn-out period, and the refill speed is never zero.

Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

What it does

Stamina makes every action cost something right now, so the player paces themselves and each sprint or dodge becomes a real choice.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

sprint or big movekeeps spendingstops spendingbar is emptyspends againwait is overspends againbar is fullspending refusedrecovery level reachedBar fullSpendingShort waitRefillingWorn out
How it runs, as a diagram
  • Bar full → Spending: sprint or big move
  • Spending → Spending: keeps spending
  • Spending → Short wait: stops spending
  • Spending → Worn out: bar is empty
  • Short wait → Spending: spends again
  • Short wait → Refilling: wait is over
  • Refilling → Spending: spends again
  • Refilling → Bar full: bar is full
  • Worn out → Worn out: spending refused
  • Worn out → Refilling: recovery level reached

Good starting values

ValueStart withWhat it changes
maxStamina100 unitsHow big the full bar is. A bigger bar lets the player keep going for longer.
regenRate30 units/sHow fast the bar fills back up, so how long the player has to pause. It is never zero, because a bar that cannot refill would leave the character worn out for good.
regenDelay0.7 sHow long the player must wait after using stamina before the bar starts to fill. Without this wait, the bar fills up between small actions.
sprintCost18 units/sHow fast sprinting drains the bar.
recoverAt25 unitsHow full the bar must get before the character can use stamina again. A higher level makes running out hurt more. A full bar always counts as recovered, even if this is set higher.

What usually goes wrong

The bar looks right but the move still happens

The bar looks fine, yet a dodge the player could not afford still happened. The bar was only cut back into range afterwards.

Fix: Tell your AI: check the cost before spending, and refuse the move if the bar cannot pay for it. Then the bar cannot go too low in the first place.

A bonus overfills the bar

A bonus or a mistake gives an action a cost below zero, and the bar fills past its maximum.

Fix: Tell your AI: only spend stamina when the cost is above zero.

The bar flickers at empty

With no worn-out period, the player can keep tapping sprint at empty. The bar gains and loses a sliver again and again, and it flickers.

Fix: Tell your AI: block all stamina use at zero until the bar reaches the recovery level.

The bar refills between actions

If the bar refills in every moment the player is not spending, fast repeated actions cost almost nothing.

Fix: Tell your AI: after each use, hold the refill for the short wait.

Worn out for good

The recovery level is set higher than the full bar, or the bar never refills. The character stays worn out for good, and the game seems to hang.

Fix: Tell your AI: a full bar always ends the worn-out period, and the refill speed is never zero.

How to check it works

Common questions

how do stamina systems work in games

Actions use up a bar and rest fills it back. Most games add a short wait before it refills, and a lockout when it runs empty, so running out really costs you.

how fast should stamina regenerate

Start with a full refill in three to four seconds of rest, after a wait of about 0.7 seconds. Slower makes every action feel heavier, faster makes the bar a formality.

what do i tell my ai to add a stamina bar

Paste this: Add a stamina bar. Sprinting can drain whatever is left, a dodge costs a set amount or does not happen, the bar starts refilling after a wait of about 0.7 seconds, and at empty the character cannot spend stamina until the bar has partly refilled.

why add a delay before stamina regenerates

Without it, the bar refills between quick actions, so a player who taps pays less than one who holds. The wait makes both pay the same.

Where it comes from

Earliest example we could find: Chainmail, 2nd edition (Gary Gygax and Jeff Perren, Guidon Games) (1972). Miniatures rules in which sustained marching, charging or melee makes troops fatigued, so that they attack and defend at a lower value until a pause restores them. This is exertion tracked for a unit as a rule state, not a meter on a character. The 2nd edition text was read directly; the 1971 first edition was not seen.

  1. 1972 Chainmail, 2nd edition (Gary Gygax and Jeff Perren, Guidon Games): Miniatures rules in which sustained marching, charging or melee makes troops fatigued, so that they attack and defend at a lower value until a pause restores them. This is exertion tracked for a unit as a rule state, not a meter on a character. The 2nd edition text was read directly; the 1971 first edition was not seen. [Chainmail: rules for medieval miniatures, 2nd edition (1972), Internet Archive full text][Chainmail (game), Wikipedia]
  2. 1984 Punch-Out!! (Nintendo, arcade): Boxing game with on-screen power meters that represent each fighter's stamina. The player's meter refills on successful strikes, and an empty meter means a knockout. This is the earliest visible stamina meter documented here. Sourced from Wikipedia only, which cites Computer and Video Games, August 1984; that review was not opened. [Punch-Out!! (1984 video game), Wikipedia][Health (game terminology), Wikipedia]
  3. 1987 Dungeon Master (FTL Games): Real-time CRPG in which fighting and running drain a character's stamina, and carrying a heavy load drains it faster. Low stamina reduces combat effectiveness and slows the character. Here stamina is a resource separate from health and tied to weight, which later games keep. [Dungeon Master, Part 2: The Playing of (Jimmy Maher, The Digital Antiquarian, 2015)][Dungeon Master, Part 1: The Making of (Jimmy Maher, The Digital Antiquarian, 2015)]
  4. 2000 Diablo II (Blizzard North): A stamina bar limits running. Its director David Brevik said in 2025 that he dislikes it: per PC Gamer, its purpose was to stop players fleeing or sprinting past combat. It is a useful case of a designer judging his own stamina system a mistake. The WebFetch tool saw only the article's headline, so the evidence quote is that headline; the body was read through a plain HTTP request. ['It makes me cringe every time': 25 years after Diablo 2 reshaped the RPG landscape, Diablo creator David Brevik still thinks its stamina bar sucks (Lincoln Carpenter, PC Gamer, 2025)][Branching out: How limiting skill choices made Diablo 2 more fun (GamesBeat, 2018; excerpt from Stay Awhile and Listen: Book II)]
  5. 2009 Demon's Souls (FromSoftware): Most actions spend from a stamina meter, so managing it is central to combat and not a limit on running alone. Sourced from Wikipedia only; no developer statement on this design was found. [Demon's Souls, Wikipedia]
  6. 2017 The Legend of Zelda: Breath of the Wild (Nintendo): Stamina is used as the limit on open-world movement in place of walls: Link can climb nearly anything, for as long as stamina lasts. Game Developer's coverage of the GDC talk presents this as a replacement for artificial barriers. [Key lessons developers can take away from Breath of the Wild (Bryant Francis, Game Developer, 2017)][The Legend of Zelda: Breath of the Wild, Wikipedia]

Strength of the sources: Chainmail is primary and Maher's account of Dungeon Master is strong. Punch-Out!! and Demon's Souls rest on Wikipedia only. The 1972 event is unit fatigue in a miniatures game, not a personal meter, so the earliest documented stamina meter on screen is Punch-Out!! in 1984. Chainmail's 2nd edition prints a 1971 first-edition copyright line, and Wikipedia dates the first edition to 1971, but whether that edition already had the fatigue rule was not checked. A search for fatigue rules in earlier wargames (Kriegsspiel, Featherstone) found nothing usable, so an older example may exist. Punch-Out!!'s year: Wikipedia says developed in 1983 and released in February 1984; a search snippet gave a 1983 Japanese release, which was not confirmed. Other early candidates: Wikipedia describes Data East's Flash Boy (1981) as having an energy bar that drains over time, which is closer to a timer or health bar than stamina. Knights of Legend (1989) is left out of the timeline only to keep it short: The CRPG Addict lists fatigue as a strong trait of that game, and Wikipedia describes fatigue reducing effectiveness until a character passes out. Disputed: Giant Bomb says action RPG stamina use was 'largely pioneered by Secret of Mana', a claim on a user-edited page that no stronger source confirmed. Could not document: FromSoftware's reasoning for the Souls stamina meter, or any link to Monster Hunter. A search snippet attributed a remark on Monster Hunter's stamina to Miyazaki, but neither Game Informer's 'The Soul of Soulslike' nor the Notebookcheck report contains it, and Wikipedia's Monster Hunter page does not mention stamina. Naming trap: some games label health as stamina, and Giant Bomb notes this. A separate meaning, an energy timer in free-to-play games that limits actions per session, is covered by Tadhg Kelly's 2010 Game Developer post on Mafia Wars-style energy; it is a monetization pacing device, not an exertion mechanic, and is left out of the timeline. The Chainmail text read here is an Internet Archive scan with spelling errors from OCR. Exact rule values are left out on purpose.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

Your AI gets the code

Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it