# Playtesting and verification

> How OofChef proves its work - static checks, scans, screenshots, playtests and playing your game like a real player - and how to turn runtime playtests off.

OofChef does not stop at writing code. It checks that the code actually works in your place, and fixes what it finds broken.

## What OofChef checks

From cheapest to most thorough:

| Check | What it does |
|---|---|
| **Validate** | Fast static checks of scripts and targets in edit mode, such as syntax errors and API names that do not exist. |
| **Geometry Scan** | Finds hidden parts, z-fighting, duplicates and parts that intersect. |
| **UI Layout Scan** | Finds GUI elements cut off by the screen, overlapping each other, or sized so they will not scale on other devices. |
| **Screenshots** | Captures the Studio viewport so OofChef can see what it built. Screenshots appear in the work log. |
| **Playtest verification** | Runs your game in a Studio playtest for runtime and physics proof, and reads the output. |
| **Play as player** | Plays your game like a real player in a real Play session, with a live player, client and input, and reports what happened. |
| **Runtime Eval** | Reads or changes state inside the running game during a play session, for example a player's health or coins. |
| **Profiler** | Measures live FPS, frame time and memory. |

UI built on image art gets more checks, two pictures and a ready playtest for its menus. See [Checks after a build](https://oofchef.com/docs/ui-art#checks-after-a-build).

## Playing your game like a real player

For gameplay, OofChef can play the game itself: it moves the character, presses buttons, triggers prompts and touches parts, then checks the game state after every action. If something is wrong, for example an NPC's health did not change when it was hit, it repairs the code and can play the game again to check the fix. Turn on [Perfection mode](https://oofchef.com/docs/agent-settings#perfection-mode) to make it work harder to finish and check each step.

Tell OofChef what "working" means in your order to get the most out of this: "players should keep their coins after rejoining", "the door should only open for players with the key".

## Saved tests

A play test that passed can be kept, so OofChef can replay it later and catch a change that breaks it. Saved tests replay with no model call, so running them uses **no tokens** from your [quota](https://oofchef.com/docs/usage-and-quota).

> **Note**
> Saved tests are being switched on in stages. If you don't see **Saved tests** in the Studio menu yet, they are not on for your account yet.

### Keep a test

- When a **Play as Player** test passes in a chat, its row in the work log shows **Keep as test**. Choose it and give the test a name.
- OofChef can also suggest one: after a passing test that proves a finished mechanic, a card asks **Keep this play test?** Nothing is saved unless you keep it.
- A test checks two things: the test's own code ran without an error, and every true or false value it reported (for example `door_opens = true`) is the same as in the run you kept. Numbers and text it reported are shown, not checked.

### Run your tests

- Open the Studio menu in the app and choose **Run tests**, or **Open** to see the list first. Tests run one at a time in your own Studio, while the place is open.
- A failed test gets one more try. One that passes on the second try is marked **Flaky**: it passed, but look at it.
- If a test that passed before fails now, the results say so in red, so you know a change since then broke it.
- In a project, the **Tests** tab lists the project's tests with your own history of each.
- You can run tests 20 times an hour. Each test can take up to 2 minutes, and a whole run up to 15 minutes. Tests do not run while OofChef is working in one of your chats.
- If OofChef restarts for an update during a run, the run stops and the Saved tests window says so. Run the tests again.

### Where tests are kept, and who can change them

Saved tests live in your place, in `ServerStorage.OofChef.Tests`. They are saved with the place, survive closing Studio, and never reach players. A place holds up to 50 tests (200 KB).

Anyone who can edit the place can edit that module, including Team Create collaborators. So OofChef remembers each test exactly as you kept or approved it. A test that changed outside OofChef, or one someone else added, shows **Changed outside OofChef** or **Not approved by you**, and it does not run until you choose **Review change**, read what changed and approve it. Before a test runs, OofChef also gives it the same safety checks as any other play test.

Collaborators see the same tests in their own OofChef, and each person approves tests for themselves. Your test runs are private: nobody else sees them, even in a shared project.

### Change or remove a test

- **Update test** renames a test, changes what it covers, or, after a failed run, takes that run's results as the new expected ones (use this when the game changed on purpose).
- **Delete test** removes it from the place for everyone working on it.

## Turn playtesting on or off
Playtests are the most thorough check, and the most expensive in tokens. **Playtesting** is one control with a switch and a dropdown:

- **The Playtesting switch** turns both options off, or back on.
- **The dropdown** has **Playtest verification** and **Play as player**, each with its own switch.
- **Play as player needs Playtest verification.** While Playtest verification is off, Play as player is off too and its switch says why. Turning Playtesting back on brings Play as player back to what you last chose for it.

You find the same control in three places, and changing it in one changes it everywhere: at the top of [Tool access](https://oofchef.com/docs/tool-access) (and again in its *Verification* section), in [Settings › Agent](https://oofchef.com/docs/agent-settings#playtest-verification), and in the model picker's **Sub-agent options**. It is saved to your account, so it stays as you set it in new chats and new tabs.

With Playtesting off, OofChef does not run your game at all, and neither do its sub-agents. **Runtime Eval** goes off with it (it only works inside a running game), so Tool access shows it as *Needs Playtesting* until you turn Playtesting back on. OofChef checks its work statically (validation, scans, screenshots) and says in its answer what it did not test. If you ask it to playtest anyway, it tells you Playtesting is off and where to turn it back on. With only Play as player off, OofChef still runs playtests, but never plays the game as a player.

You can also switch individual checks off for a session in [Tool access](https://oofchef.com/docs/tool-access), in the *Verification* group.

## Imported games and reference folders

If your place contains scripts you imported only as reference, they can run during playtests and confuse the results. OofChef's **Reference Quarantine** tool can disable the scripts under a reference folder, reversibly, so they stop polluting playtests.

## Tips

- Keep Studio open on the place while OofChef playtests, and avoid clicking around in Studio until the playtest finishes.
- If a playtest seems stuck, press **Stop** in the app, then stop the play session in Studio if it is still running.
- Playtests make model calls like any other step, so they use your [quota](https://oofchef.com/docs/usage-and-quota).
- A screenshot OofChef takes is real evidence: look at the ones in the work log to see what it saw.
