/game:godot-perffrom Game Design and Build
Measure and fix frame cost in a Godot game with numbers you can trust on a shared, noisy dev machine. Covers interleaved A/B pairs against a base build, per-part milliseconds instead of FPS, hitch maps and cost maps, stress scenarios and leak hunts, per-feature cost budget tests, shader warm-up lists with a guard test, MultiMesh batching, physics interpolation, pixel-art camera judder, view-edge fill and seeded chunk streaming. Use it whenever someone wants to know why a Godot game lags, stutters, hitches or gets slow over time, asks if a change makes frames faster or slower, wants a draw-call or frame budget, wants to batch many sprites, sees a stall the first time an effect draws, turns on physics interpolation, or wants to rank speedups from a public write-up, even if nobody says "profiling" or "A/B".
Ships in Game Design and Build. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A frame-time number from one run on a busy machine is noise, not evidence. Vsync, the display cap, cold shader caches, other processes and a background window all move frame time more than most code changes do. The method measures milliseconds per part in a real window, against a base build at the same merge base, in short interleaved A/B pairs with the machine load recorded. It works because pairs taken back to back see the same machine state, so the gap between A and B survives the noise even when the absolute numbers do not.
Rules: game:game-performance-auditor holds the rules for frame budgets and optimisation; this skill is the Godot method to measure against them.
bot-balance-loop.safe-refactor-and-review.visual-verification.headless-godot-runs.The main procedure is an A/B measure. Every other section feeds it or ends in it.
Measure milliseconds per part, not FPS. Record process time, physics time, render CPU and GPU time, draw calls, primitives and static memory. FPS hides where the time goes and caps at the display rate. Check: your log has one column per part.
Sum every viewport. Turn on render-time measurement for the root viewport and for each SubViewport, and add them. A root-only number can miss most of the 3D cost. Check: the summed render time is larger than or equal to the root number.
Uncap the frame. Turn vsync off and run with --max-fps 0 for timing runs. Write these into a scratch settings file for each run, because saved user settings can force vsync back on.
Check: frame time is not stuck at the display period (for example 8.33 ms at 120 Hz).
Use a driver with GPU timers. Some drivers return 0 for every GPU timer (for example Metal on macOS). Switch the driver (for example --rendering-driver vulkan through MoltenVK). On a renderer with no GPU timer, compare wall time and render CPU time. Check: the GPU column is not all zeros, or you state why it is.
Run in a real window, in the foreground. Headless has no draw, uses a dummy renderer, and shows false memory and object growth. Some desktops throttle a background window. Check: the run log names the renderer and window mode.
Keep a base build at the same merge base. Use one of these:
Move the base to the new merge base after each merge. Check: base and branch share the merge base commit.
Take the machine. On a shared machine, hold a perf lock (and a window lock if other agents run windowed captures). Keep each hold under about 3 minutes. Run no other batch job at the same time. Check: the lock owner file names you for the whole take.
Warm up, then interleave. Run one untimed warm-up run first, because the first run carries cold caches. Then run A and B in back-to-back pairs, 3 to 5 pairs, and alternate which goes first. When noise stays high, switch the variant window by window inside one process. Check: you have at least 3 valid pairs.
Record the load with every take. Log the load average and the count of engine processes. Mark a take invalid above a load limit you set before the run. Check: every row has a load value and a valid flag.
Report the gap, not the absolute. Report the median gap and its share of the frame. Under load, report the best median too, because load inflates the best value least. Mark a result weak when the per-pair gaps straddle 0 or the A time drifts across the take. Repeat a run with one big spike before you report it. Check: scripts/ab_report.py prints the gap, the share and the weak flag.
Measure through the real setting. For a graphics setting, switch it through the settings API the player uses, not through a direct engine call. Only then does the measure prove the setting. Check: the probe sets the setting key.
Prove behaviour and gain for a speedup. Write value tests that pass on the old code and a speed test that fails on it. Then:
visual-verification method (fixed state, 1x, noise floor);State the proxy. A low-end renderer and a render scale stand in for weak hardware. Label those numbers "estimate". Check: the report says which numbers are proxies.
Use this when a new effect, cue or system must stay under a budget per frame (for example 0.1 ms).
For a draw-call budget on new models, record the draw-call and CPU delta per model against the base scene. Merge static meshes into one batch when a model goes over, then take a second measure. Write a before-and-after table.
Use this when players report lag or a hitch at one event, or a scene has a high steady cost. Get numbers before you change code.
Use this when you need a repeatable worst case and a baseline per scene and renderer, or a memory leak across many runs.
Use this when a team must find frame-rate wins before any change to shipping code, or someone gives you a public write-up of perf techniques and asks which ones apply.
visual-verification. Keep prototype-only commits (for example step timers) off the main branch.Use this when you must learn a technique or an exact engine behaviour from an outside source (engine source, a public demo, a repository, a post, a video) before you change your own code.
--doctool if you need API detail.visual-verification: it owns the fixed-state before-and-after captures and the pixel-diff noise floor.Use this when the game stalls the first time a material draws, or the first frames of a run hitch. The warm-up must stay complete as the game grows, so it needs a guard test.
.gdshader, every script that builds a material in code, and every MultiMesh or instanced draw (each is a separate shader variant). List the materials of each scene: meshes, ground, lights, masks, post-process, transitions.Newer engine versions (for example Godot 4.4 and later) reduce compile stalls with ubershaders. Measure before you build a warm-up on those versions.
Use this when many similar billboards or sprites cost too many draw calls, or a spatial shader works on single meshes but fails on MultiMesh instances.
INSTANCE_CUSTOM. In a MultiMesh, MODEL_MATRIX gives the node transform, not the instance transform. Read the value behind a shader flag, so single meshes keep the old path. Check which built-ins exist in each shader stage in the engine docs.visual-verification. It gives the captures and the pixel counts. Check the visible pixels per instance against the plan, and write the numbers into the notes. Acceptance needs numbers, not only images.Use this when a project turns on physics interpolation and the scene tree holds SubViewports and a moving player node.
add_child. Do not trust the root setting to reach SubViewports.reset_physics_interpolation() on the moved node after each teleport. Prove the reset test: remove the line and check that the test fails.get_global_transform_interpolated()), not from the physics position.Use this when a 3D game renders pixel art at a low internal resolution and the camera scroll judders, or the camera can show past the edge of a finite play field.
Use this when an endless or procedural world places content or solid obstacles per chunk from a seed, the same every run, without blocked paths or load hitches.
| Symptom | Cause | Fix |
|---|---|---|
| Frame time sits at 8.33 ms (or 16.67 ms) with vsync "off". | Saved user settings force vsync on, or the fps cap is on. | Vsync off and --max-fps 0 in a scratch settings file for each run. |
| Every GPU timer reads 0. | The driver gives no GPU timestamps (for example Metal). | Use another driver, or compare wall time and render CPU time. |
| Render time is tiny next to the frame (for example 0.15 ms against 1.65 ms). | The measure reads only the root viewport. | Sum every SubViewport. |
| Numbers jump when you switch apps. | The OS throttles a background window. | Run in the foreground. |
| Memory and object counts grow in headless runs only. | Headless uses a dummy renderer. | Measure memory and render cost in a window. |
| Frame times fall by half between two runs of the same code. | Machine load changed. | Interleaved pairs, load per take, invalid flag above a limit. |
| A cost test fails at 0.1 ms under load and passes at 0.025 ms when idle. | One noisy run. | Best of 3 to 5 runs inside the test. |
| The first take is slow. | Cold caches. | One untimed warm-up run. |
| A and B differ by more than the change. | Another window run used the GPU, or a variant did less work. | Hold the window locks; give every variant equal work. |
| A probe slows its own early frames. | The probe does debug work (for example a hash) at run start. | Discard those frames; put the debug work behind a flag. |
| A player's spikes do not show in your tool. | Different settings, renderer, build type or machine load. | Match settings and renderer, add background CPU load, run the release export. |
| A long run does not fit in one tool call or session limit. | The command times out. | Single-run sessions; a sped-up run (for example --time-scale 2) for memory, a normal-speed run for timing. |
| Both batches ran on one renderer. | The shell did not split a flag string. | Use sh or a shell array for flag lists. |
| A script run breaks halfway. | You edited the shell script while it ran; sh reads it as it goes. | Do not edit a script during a run. |
| Headless frame counts do not match time. | Headless frames run faster than real time. | Wait on timers, not frame counts. |
| A hitch map logs no frames headless. | Headless does not draw. | Take frame logs in a window. |
| Draw calls grow over time. | One draw per item is created and never freed. | Batch and free. |
| Node count grows over a long run (for example 500 to 1,400). | Far objects never despawn. | Despawn far objects; check each pool has a cap. |
| A load stalls 16 to 24 ms per new view. | A synchronous resource load on the main thread. | Load on a worker thread ahead of the view. |
| A chunk restore costs hundreds of microseconds. | Array concatenation per chunk. | Write into a preallocated slot (for example put_data). |
| An effect reads data every frame. | A constant is recomputed per frame. | Compute it once, or on change. |
| A vertex shader runs twice on one renderer. | A depth prepass on that renderer. | Read the engine source to confirm the rule. |
| A 60 to 110 ms spike on the first use of an effect. | A shader compiles on first draw. | Add the material to the warm-up; prove with cold runs. |
| Warmed shaders compile again later. | The engine freed unheld shaders. | Keep a reference to each warmed material. |
| A new feature file stalls on first draw. | It builds a material and is not in the warm-up. | The guard test; one row per file. |
A filter on autostart finds no timers. | The engine clears autostart after the first start. | Filter by type. |
| A first render frame still costs hundreds of ms after warm-up. | Not all of it is shader compile. | Measure it on its own before you decide. |
| A probe trail is corrupt around an event. | The player emits the same signal each tick. | Disconnect it in the probe. |
| A summary blames the wrong frame. | An off-by-one in the frame index around the event. | Test the index logic on a known trail. |
has_method returns false for a real method. | The call checked the Script object, not the node. | Call node.has_method. |
| A high-refresh comparison covers too little play. | The frame count was fixed, not the play time. | Set the frame count from the play time you need. |
| Threads give no gain. | The dispatch costs as much as the loop. | Measure dispatch cost first. |
| Two people fix the same hitch. | No owner per fix. | One owner per fix, announced. |
| The split timer itself makes orphans. | The instrumentation leaks. | Take clean numbers without the split timer. |
| Single worst frames do not repeat. | Heavy machine load. | Use medians, not worst frames, under load. |
| A late event never fires in a stress run. | The bot circles a waypoint it cannot reach. | Scale the route to the bot speed. |
| A MultiMesh effect shows every instance at the node origin. | MODEL_MATRIX gives the node transform. | Pass instance values in INSTANCE_CUSTOM. |
| A shader fails to compile after a batching change. | A built-in that the stage does not have. | Check the stage in the engine docs. |
| A packed data layout breaks when a peer adds a state. | No spare channels. | Reserve channels for known future states. |
| A reviewer cannot accept a visual change. | Images with no numbers. | Record pixel counts and ratios. |
| Interpolation is on in a SubViewport you set off at the root. | The root setting does not reach the SubViewport. | Set the mode on each SubViewport before add_child. |
| A marker drifts from the drawn player. | It uses the physics position. | Use the interpolated transform. |
| Camera judder is hard to see. | Impact shake hides the follow cadence. | Clear shake in the drive tool. |
| A deferred camera update errors. | It runs after the node left the tree. | Guard with is_inside_tree(). |
| The view edge shows the clear colour after a camera change. | The change added a margin the test did not know. | Add it to the test and to the fill margin. |
| Seams at chunk borders. | Noise keyed on the chunk seed. | Key it on world position. |
| A placement test passes but the rule fails in play. | The test checked one chosen chunk. | Assert the rule over all loaded sites. |
| A tool script fails to compile on a global class. | Some tool runs do not load global class names. | Load classes at run time with load(). |
| A sketch from research does not parse. | A non-constant expression in a const, or a wrong API. | Parse-check every sketch in a scratch project. |
| Rounding differs between GPUs. | round(-0.5) is not portable; low-precision custom data. | Avoid the tie case; encode values in 0 to 1. |
| A blocked web page gives no text. | A login wall. | Try the RSS feed; else ask a human for a saved file. |
| A hung timing script blocks the machine. | No bounded wait. | Use a bounded poll; kill only your own process. |
In-place sed fails on macOS. | BSD sed needs a suffix argument. | Use perl -pi or a Python edit, then grep the value. |
| GDScript cannot infer a type. | An untyped dictionary value. | Declare the type. |
| A prototype commit lands by accident. | Prototype-only code shares a branch. | Keep prototype branches separate and unmerged. |
| An untracked file blocks the base worktree checkout. | A generated file (for example a .uid) exists in the folder. | Delete the untracked copy, then check out. |
scripts/ab_report.py in this skill. It reads frame CSVs and prints per-take stats, medians, the gap, its frame share and a weak flag.bot-balance-loop: plays the game with bots for balance numbers; this skill reuses its drives for perf scenarios only.safe-refactor-and-review: proves that a change keeps behaviour; this skill adds the speed proof.visual-verification: owns the visual proof. It gives fixed-state window captures, 1x comparison, before-and-after pairs and the pixel-diff noise floor that prove "same pixels". This skill gives only the paired timing evidence.headless-godot-runs: tool-script hygiene, flags and process cleanup for the headless probes here.godot-testing: the test loop, proof that a test can fail, and the exit leak hunt at suite end.feature-seams-and-saves: data seams and flags that let a probe switch a variant in one binary.upgrade-tree-design: design research for questions that are about fun, not frame time.fleet-game-dev: the mkdir perf and window locks, the owner check, and wave plans from the ranked perf ideas.What SKILL.md sets; muted values are Claude Code's defaults
30 skills in this plugin
/art-directionUse when a game concept needs its visual direction set: a style sheet (palette, shape language, lighting, texture), a shot list tied to the target fun, and image-generation prompts for a key art, hero and gameplay-mock placeholder. Trigger on: "art direction", "style sheet", "what should this look like", "shot list", or when `game-brief` needs its art section. Every image prompt carries fixed content-boundary negatives and never names a living artist./balance-model-dataKeep a game's numbers in a scripted balance model (for example Python modules) that checks design targets and exports the JSON the Godot game loads, and change that data without drift. It covers the edit-export-diff loop, FAIL-key baselines, deterministic exports, parity fixtures between the model and GDScript, what-if and lever searches inside the model, and design docs whose tables must match the model. Use it whenever someone wants to change a price, a yield, a pacing curve, a content table or an upgrade row that a script exports; asks why the model and the game disagree, why a parity test fails, or why a chapter runs too long; wants to tune or fit levers before touching game data; or writes a design doc full of numbers, even if nobody says "balance model" or "source of truth".npx claudepluginhub mattmakes/skill-marketplace --plugin game