physics-tuning
Engine-neutral physics tuning with Godot checks: fixed timestep and interpolation, CCD against tunnelling, damping, solver iterations and collision layer matrices
Install / Use
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill physics-tuningInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of physics-tuning
physics-tuning scores 95/100 on our quality scale, 286th of 4,700 Development & Engineering skills we index (top 7%).
Its SKILL.md is 7.4 KB long, well organised into 27 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
With 8,904 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 4 days ago, so physics-tuning is actively maintained.
- Our last check on 2026-11-15 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-04. Automated pattern scan on 2026-10-04. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
physics-tuning compared with similar skills
All 4 of these similar skills score higher than physics-tuning; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| physics-tuning (this skill)by gamedev-skills | 95 | 8.9k | 4d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.1k | today | CLAUDE.md |
Frequently asked questions
- How do I install physics-tuning?
- Run
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill physics-tuning. The install tabs above show the steps for each supported agent. - Which AI agents does physics-tuning work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is physics-tuning safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is physics-tuning still maintained?
- The repository was last updated 4 days ago, so physics-tuning is actively maintained.
Skill content
View source on GitHubname: physics-tuning description: > Tune game physics for stable, good-feeling motion — fixed vs variable timestep, render interpolation, mass/gravity/drag, continuous collision detection (CCD) to stop tunneling, fixing jitter, and collision layers/masks. Engine-neutral. Use when the user mentions physics feel, jitter, tunneling, fixed timestep, FixedUpdate, CCD, bouncing/unstable physics, or collision layers.
Physics tuning
Most "bad physics" is not a bug in the engine — it's a mismatch between the
fixed-timestep simulation and the variable-rate render loop, or untuned
mass/drag/CCD/layer settings. This skill covers the engine-neutral knobs that
make physics stable and responsive; pair it with godot-physics or
unity-physics for the concrete APIs.
When to use
- Use when motion jitters, objects pass through walls (tunneling), stacks explode, or movement feels floaty/sticky/laggy.
- Use to decide what goes in the fixed (physics) step vs the render frame, and how to interpolate between them.
- Use to tune gravity, mass, drag, restitution, solver iterations, sleeping, and collision layers/masks.
When not to use: for an engine's exact physics nodes/components and
collision callbacks, use godot-physics or unity-physics. For movement
decisions (when to jump, AI steering) use input-systems and game-ai. For
platformer jump-feel specifics like coyote time/jump buffering, that's input/
controller territory — see input-systems and the platformer genre.
Core workflow
- Run physics on a fixed timestep. Simulate at a constant rate (e.g. 50–60
Hz). A fixed
dtmakes the simulation deterministic-ish and stable; a variabledtmakes integration and collisions inconsistent. - Put physics work in the physics callback, not the render frame. Apply
forces/velocities and read collisions in the fixed step (
FixedUpdate/_physics_process), using that step'sdt. - Interpolate rendering between physics ticks. The render frame rate ≠ the physics rate, so smoothly interpolate transforms toward the latest physics state, or enable the engine's Rigidbody interpolation, to remove visible stutter.
- Tune the body, not the scene. Set mass for relative weight, drag for damping, gravity scale per object, and restitution/friction via materials.
- Stop tunneling with CCD on small/fast bodies; cap maximum velocity.
- Stabilize stacks/joints with more solver iterations, sane mass ratios, and sleeping for resting bodies.
- Verify by feel and stress test. Play at low and high frame rates; throw fast objects at thin walls; stack and shove bodies. Report what you observed.
Patterns
1. Fixed timestep for simulation, render interpolation for smoothness
# Physics callback: runs at the FIXED rate. Use its dt for all integration.
func _physics_process(dt): # Unity: void FixedUpdate()
velocity += gravity * dt # integrate with the FIXED dt
move_and_slide() # engine resolves collisions this step
_prev_pos = _curr_pos; _curr_pos = global_position # record for interpolation
# Render frame: runs as fast as the display. Interpolate between physics states.
func _process(_frame_dt): # Unity: void Update()
var alpha = Engine.get_physics_interpolation_fraction() # 0..1 within the tick
visual.global_position = _prev_pos.lerp(_curr_pos, alpha)
# RIGHT: integrate in the fixed step, render via interpolation.
# WRONG: applying forces in _process/Update with frame dt — speed and collisions
# then depend on frame rate and jitter under load.
Most engines offer this for you (Godot physics_interpolation/Rigidbody
interpolate; Unity Rigidbody.interpolation = Interpolate). Prefer the built-in
before hand-rolling.
2. Stop tunneling: CCD + a speed cap
# Fast, small bodies skip past thin colliders between ticks. Two fixes:
body.continuous_cd = true # RigidBody3D bool (RigidBody2D: CCD_MODE_* enum). Unity: rb.collisionDetectionMode = Continuous
# Cap velocity so a single step can't move more than ~one collider thickness.
const MAX_SPEED := 40.0
if velocity.length() > MAX_SPEED:
velocity = velocity.normalized() * MAX_SPEED
# Rule of thumb: max_distance_per_step (= speed / physics_hz) should be < the
# thinnest wall. Raise physics_hz or enable CCD when that fails.
3. Body tuning: mass, drag, gravity scale, material
# Mass is RELATIVE weight in collisions; it does NOT change fall speed (gravity
# accelerates all masses equally). Use drag and gravity_scale to shape feel.
body.mass = 2.0 # heavier pushes lighter in collisions
body.linear_damp = 0.5 # air drag: higher = stops sooner (Unity: drag)
body.gravity_scale = 1.5 # per-object gravity multiplier (snappier fall)
# Bounce/slide come from the physics material, not code:
material.bounce = 0.2 # restitution 0..1 (Unity: bounciness)
material.friction = 0.8 # surface grip
4. Collision layers and masks (who collides with whom)
# A body is ON its layer(s) and SCANS the layers in its mask. Both directions of a
# pair must be configured for them to interact.
player.collision_layer = LAYER_PLAYER
player.collision_mask = LAYER_WORLD | LAYER_ENEMY # player detects world+enemies
pickup.collision_layer = LAYER_PICKUP
pickup.collision_mask = LAYER_PLAYER # pickup only reacts to player
# Unity equivalent: assign GameObject layers and edit the Physics collision matrix
# (or Physics.IgnoreLayerCollision). Keep a named layer constant table, not magic numbers.
Pitfalls
- Applying forces/movement in the render frame (
Update/_process) makes behavior frame-rate dependent — faster PCs run faster, and collisions get flaky. Do simulation in the fixed step. - Visible jitter even with a fixed step usually means no render interpolation: the physics rate and display rate beat against each other. Enable interpolation.
- Tunneling through thin walls: discrete collision misses fast movers. Enable CCD, cap speed, thicken walls, or raise the physics rate.
- Expecting heavier objects to fall faster. Gravity is acceleration; mass
affects collision response, not fall speed. Use
gravity_scale/drag for feel. - Exploding stacks / jittery joints: mass ratios too extreme, or too few solver iterations. Keep mass ratios modest and raise iteration counts.
- Bodies that never rest burn CPU and twitch. Enable sleeping and a sensible sleep threshold for resting objects.
- One-directional layer setup: A's mask includes B but B's mask excludes A. Detection/collision can need both sides; verify the full matrix.
- Huge
dtspikes (load hitches, breakpoints) blow up integration. Clamp the max physics step / substep count so a stall doesn't launch everything.
References
references/timestep-and-ccd.md— the fixed-timestep accumulator loop, interpolation math, substepping, CCD modes, solver/iteration tuning, sleeping, and a stability checklist.
Related skills
godot-physics,unity-physics— concrete bodies, colliders, and callbacks.input-systems— responsive controls, jump buffering, coyote time.game-ai— agent movement that must agree with the physics step.platformer,fps-shooter— genres whose feel depends on this tuning.
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
72.1kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
