Spielerando

Weight Limit

A weight limit gives everything the player carries a weight and lets the total slow them down. Up to a comfortable load there is no cost. Past it, speed falls steadily down to a floor, and at the hard limit nothing more can be picked up. A pickup that only partly fits takes what fits.

Also called: Carry weight, Encumbrance, Load limit, Burden.

A stocky badger porter bends under a huge tower of baskets and sacks as a sparrow places one last bundle on top, her long paw prints behind her turning into short deep steps past a white stone.
Pennywhistle Pass, an invented watercolour trading-trail 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 "Weight Limit" to my game.

What it should do: Weight makes carrying a choice without a fixed number of slots. The player can take one more thing and move slower, or leave something behind, and the cost is easy to feel and easy to read.

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

```mermaid
stateDiagram-v2
  [*] --> light
  light: Light load
  burdened: Burdened
  full: At the limit
  light --> burdened: picks up past comfort
  light --> full: picks up to the limit
  burdened --> light: drops below comfort
  burdened --> full: reaches the limit
  full --> burdened: drops a little
  full --> light: drops a lot
```

Use these starting values:
- capacity: 100 weight units
- hardLimitPercent: 150 % of capacity
- minSpeedPercent: 30 % of full speed

Watch out for these common mistakes:
- Something that weighs nothing: Tell your AI: if the weight is zero, take them all. Only divide when the weight is above zero.
- Decimals add up wrong: Tell your AI: keep weights as whole numbers, for example in tenths, so the total is exact.
- The limit drops while carrying: Tell your AI: the room left is never below zero, the speed never goes below the floor, and dropping always works.
- Only part of a pickup fits: Tell your AI: take as many as fit, round down, and report how many were left behind.
- Slowing down in steps: Tell your AI: fall in a straight line between the comfortable load and the hard limit, so each extra item costs a little.
- Exactly on the line: Tell your AI: up to and including the comfortable load is light, and use the same test everywhere.

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

Weight makes carrying a choice without a fixed number of slots. The player can take one more thing and move slower, or leave something behind, and the cost is easy to feel and easy to read.

How it runs, as a diagram

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

picks up past comfortpicks up to the limitdrops below comfortreaches the limitdrops a littledrops a lotLight loadBurdenedAt the limit
How it runs, as a diagram
  • Light load → Burdened: picks up past comfort
  • Light load → At the limit: picks up to the limit
  • Burdened → Light load: drops below comfort
  • Burdened → At the limit: reaches the limit
  • At the limit → Burdened: drops a little
  • At the limit → Light load: drops a lot

Good starting values

ValueStart withWhat it changes
capacity100 weight unitsThe comfortable load. Up to here the player moves at full speed. A round hundred makes percentages easy to read, and small items of weight 1 to 10 then show up on the load.
hardLimitPercent150 % of capacityHow far past the comfortable load the player can go, as a share of it. Half again lets a player grab one more thing and feel it. At 100 there is no slow band, so the player is either free or stuck.
minSpeedPercent30 % of full speedHow fast the player still moves at the hard limit. It is never zero: a player who cannot move cannot walk to a chest to put things down, and the game seems to hang. At 100, weight has no effect on speed.

What usually goes wrong

Something that weighs nothing

A note or a key weighs zero. A pickup that works out how many fit by dividing the free room by the weight divides by zero, and the game either takes none or takes an endless number.

Fix: Tell your AI: if the weight is zero, take them all. Only divide when the weight is above zero.

Decimals add up wrong

The player picks up thirty feathers that each weigh 0.1. Added one at a time, the total comes out a hair above or below three, and the game decides they are over the limit.

Fix: Tell your AI: keep weights as whole numbers, for example in tenths, so the total is exact.

The limit drops while carrying

A strength bonus ends while the player carries 140 with a new capacity of 40. The room left is a negative number, and the speed formula gives zero or less, so the player cannot move at all.

Fix: Tell your AI: the room left is never below zero, the speed never goes below the floor, and dropping always works.

Only part of a pickup fits

The player stands on twenty gems and has room for four. A game that refuses all twenty makes the player pick them up one by one. One that takes all twenty ignores the limit.

Fix: Tell your AI: take as many as fit, round down, and report how many were left behind.

Slowing down in steps

Speed drops from full to half the moment the load passes the comfortable line. The player feels a cliff and picking up one more herb suddenly costs half their speed.

Fix: Tell your AI: fall in a straight line between the comfortable load and the hard limit, so each extra item costs a little.

Exactly on the line

A load that equals the comfortable load exactly is treated as over it in one place and under it in another, so the speed and the state disagree.

Fix: Tell your AI: up to and including the comfortable load is light, and use the same test everywhere.

How to check it works

Works well with

Variations: Inventory System.

Common questions

what do i tell my ai to add a weight limit

Paste this: Give every item a whole-number weight. Full speed up to 100, then speed falls in a straight line to 30 percent at a limit of 150, and nothing more can be picked up there. A pickup takes as many as fit and reports the rest. Dropping always works.

how heavy should things be in a game

Pick weights that make the player think about the biggest items first. If a sword is 10 and a potion is 1, the sword costs ten potions. Start with a comfortable load of about a hundred and adjust until the player has to leave something behind.

should too much weight stop the player completely

Slow is better than stuck. A floor on the speed keeps the game playable, and the player can always walk to a place to put things down. A hard stop is fine for the pickup, but not for movement.

why use whole numbers for weight

Small decimals add up with tiny errors, so a total that should be exactly the limit comes out a hair over or under. Counting in whole units, such as tenths, keeps every comparison exact.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

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