Pressure Plate Puzzles
A pressure plate sinks while enough weight rests on it, and a door or bridge opens when every plate is down at once. The player, a crate or a creature can weigh a plate down. A plate lifts only after a short delay, and the door stays open a little longer.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Pressure Plate Puzzles" to my game.
What it should do: Plates turn the level itself into a puzzle: the player has to work out what to put where, and how many things it takes, before the way ahead opens.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> idle
idle: Waiting
partial: Some plates down
open: Open
grace: Closing soon
idle --> idle: no plate is down
idle --> partial: a plate goes down
idle --> open: all plates at once
partial --> partial: some plates stay down
partial --> idle: the last plate lifts
partial --> open: the last plate is down
open --> open: all plates held
open --> partial: a plate lifts, no wait
open --> idle: all lift, no wait
open --> grace: a plate lifts
grace --> grace: the wait runs
grace --> open: all plates down again
grace --> partial: wait ends, plate down
grace --> idle: the wait ends
```
Use these starting values:
- pressWeight: 1 units
- releaseDelay: 0.3 s
- holdTime: 1.5 s
Watch out for these common mistakes:
- The plate flutters on its edge: Tell your AI: when the weight leaves, keep the plate down for a short delay, and put it back to the full delay whenever weight returns.
- Two light things do nothing: Tell your AI: add up everything on a plate first, and compare only the total.
- No plates means open: Tell your AI: the target opens only if there is at least one plate and every plate is down.
- A saved game disagrees with the floor: Tell your AI: do not save which plates are down. Work it out again from what lies on each plate in the first step after loading.
- The door shuts before the player gets there: Tell your AI: keep the target open for a hold time after the plates stop all being down, and restart that time whenever they are all down again.
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
Plates turn the level itself into a puzzle: the player has to work out what to put where, and how many things it takes, before the way ahead opens.
How it runs, as a diagram
Everything it can be in, and what moves it on. Your AI builds from exactly this.
How it runs, as a diagram
- Waiting → Waiting: no plate is down
- Waiting → Some plates down: a plate goes down
- Waiting → Open: all plates at once
- Some plates down → Some plates down: some plates stay down
- Some plates down → Waiting: the last plate lifts
- Some plates down → Open: the last plate is down
- Open → Open: all plates held
- Open → Some plates down: a plate lifts, no wait
- Open → Waiting: all lift, no wait
- Open → Closing soon: a plate lifts
- Closing soon → Closing soon: the wait runs
- Closing soon → Open: all plates down again
- Closing soon → Some plates down: wait ends, plate down
- Closing soon → Waiting: the wait ends
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| pressWeight | 1 units | The weight a plate needs to go down. With the player at 1, a plate of 1 takes anyone, 2 takes a crate or two creatures, and a small light thing alone does nothing. |
| releaseDelay | 0.3 s | How long a plate stays down after the weight leaves. It keeps the plate from fluttering when something moves across its edge. |
| holdTime | 1.5 s | How long the target stays open after the plates stopped all being down. About the time to walk from the last plate to the door. Zero makes the door follow the plates exactly. |
What usually goes wrong
The plate flutters on its edge
A crate or a player slides across the edge of a plate. The weight counts, then does not, then counts again, and the plate and the door click on and off.
Fix: Tell your AI: when the weight leaves, keep the plate down for a short delay, and put it back to the full delay whenever weight returns.
Two light things do nothing
A plate needs weight 1, and two small creatures of 0.5 stand on it. The code looks at them one by one, so neither is heavy enough and the plate stays up.
Fix: Tell your AI: add up everything on a plate first, and compare only the total.
No plates means open
A puzzle with no plates yet, or one whose plates were all removed, counts as solved because nothing is missing. The door stands open from the first moment.
Fix: Tell your AI: the target opens only if there is at least one plate and every plate is down.
A saved game disagrees with the floor
The save remembers that a plate was down, but the crate that held it was not saved where it was. The plate stays down with nothing on it, or the door opens with no one to hold it.
Fix: Tell your AI: do not save which plates are down. Work it out again from what lies on each plate in the first step after loading.
The door shuts before the player gets there
The player steps on the last plate, steps off to run to the door, and the door closes the moment the plate lifts.
Fix: Tell your AI: keep the target open for a hold time after the plates stop all being down, and restart that time whenever they are all down again.
How to check it works
- A plate that needs a weight of 1. you put a weight of 0.99 on it, then 1, then 5: it stays up for 0.99 and goes down for 1 and for 5.
- A plate that needs a weight of 1. two things of 0.5 each stand on it: the plate goes down, and things with no weight add nothing.
- A puzzle with three plates. all three have enough weight on them: the target opens.
- A puzzle with three plates. only two have weight on them, for any length of time: the target stays shut.
- A plate with a weight on it. the weight leaves for less than the delay, and comes back, again and again: the plate stays down the whole time.
- A plate with a weight on it. the weight leaves and stays away past the delay: the plate comes up.
- A puzzle that was solved and then broken. the plates stay up: the target stays open for the hold time and then shuts.
- A solved puzzle that was broken and fixed again. it is broken a second time: the target gets its full hold time again.
- A puzzle with no plates. you wait, with any weights around: the target never opens.
- A delay and a hold time of zero. a plate lifts: the target shuts in the same moment.
Works well with
- Doors, Keys and Switches: The plates' open signal can drive the same lever input as any other switch. Let the plates decide when the door is wanted open, and let the door handle the swing and the doorway.
- Moving Platforms: A plate on a moving platform needs the load worked out again at every step, or it keeps pressing after the platform has gone. Let the platform report its weight to the plate and keep the plate out of the platform's movement.
- World State Flags: Otherwise the player has to hold the plates down again after every reload. Save a solved puzzle as one flag and stop reading the plates once it is set.
Common questions
how do pressure plate puzzles work in games
A plate on the floor sinks while enough weight rests on it. A door or bridge opens when every plate is down at once, so the player has to find enough things to stand on them, or a way to hold one down.
how long should a door stay open after a pressure plate is released
Start with about a second and a half. That is the time to walk from the last plate to the door. Use zero for puzzles where the player has to keep standing on the plate.
why does my pressure plate flicker
Something sits on its edge and the weight counts one moment and not the next. Keep the plate down for about 0.3 seconds after the weight leaves, and restart that wait whenever weight returns.
what do i tell my ai to add pressure plates
Paste this: Add pressure plates. A plate goes down when the weights on it add up to 1, and comes up 0.3 seconds after the weight is gone. The door opens only when there is at least one plate and every plate is down, and stays open 1.5 seconds longer.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 13 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
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