gamedev-physics-tuning
Imported awesome-gamedev-agent-skills guidance for physics-tuning workflows in game development projects.
Skill by bgrenat
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/bgrenat-gamedev-physics-tuning
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/gamedev-physics-tuning
What's inside
- Skill name
gamedev-physics-tuning- Description
- Imported awesome-gamedev-agent-skills guidance for physics-tuning workflows in game development projects. Use when fixing jitter, tunneling, or floaty physics by tuning fixed timestep, interpolation, mass, drag, CCD, and layers.
- License
- LGPL-3.0
- Instructions
- 140 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- timestep-and-ccd.md · references/
SKILL.md (first lines)
# 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
1. **Run physics on a fixed timestep.** Simulate at a constant rate (e.g. 50–60
Hz). A fixed `dt` makes the simulation deterministic-ish and stable; a
variable `dt` makes integration and collisions inconsistent.
2. **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's `dt`.
3. **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.
4. **Tune the body, not the scene.** Set mass for relative weight, drag for
damping, gravity scale per object, and restitution/friction via materials.
5. **Stop tunneling with CCD** on small/fast bodies; cap maximum velocity.
6. **Stabilize stacks/joints** with more solver iterations, sane mass ratios, and
sleeping for resting bodies.
7. **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
```gdscript
# 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
```gdscript
# 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
```gdscript
# 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)
```gdscript
# 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.From bgrenat/godot-game-dev-studio, LGPL-3.0.
More from bgrenat/godot-game-dev-studio
- 0.652score
gamedev-level-design
bgrenat
Imported awesome-gamedev-agent-skills guidance for level-design workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-input-systems
bgrenat
Imported awesome-gamedev-agent-skills guidance for input-systems workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-audio-design
bgrenat
Imported awesome-gamedev-agent-skills guidance for audio-design workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-itch-publish
bgrenat
Imported awesome-gamedev-agent-skills guidance for itch-publish workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-card-game
bgrenat
Imported awesome-gamedev-agent-skills guidance for card-game workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-dialogue-systems
bgrenat
Imported awesome-gamedev-agent-skills guidance for dialogue-systems workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-fps-shooter
bgrenat
Imported awesome-gamedev-agent-skills guidance for fps-shooter workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-game-ai
bgrenat
Imported awesome-gamedev-agent-skills guidance for game-ai workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-game-feel
bgrenat
Imported awesome-gamedev-agent-skills guidance for game-feel workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-camera-systems
bgrenat
Imported awesome-gamedev-agent-skills guidance for camera-systems workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-game-ui-ux
bgrenat
Imported awesome-gamedev-agent-skills guidance for game-ui-ux workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-performance-optimization
bgrenat
Imported awesome-gamedev-agent-skills guidance for performance-optimization workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9
Signals
- Stars
- 24
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- Oct 12, 2026 (16 days ago)
- Last release
- Oct 12, 2026 (16 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- LGPL-3.0
- Repository
- github.com/bgrenat/godot-game-dev-studio
- Website
- powehi.eu
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from bgrenat
- 0.652score
gamedev-fps-shooter
bgrenat
Imported awesome-gamedev-agent-skills guidance for fps-shooter workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-dialogue-systems
bgrenat
Imported awesome-gamedev-agent-skills guidance for dialogue-systems workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-audio-design
bgrenat
Imported awesome-gamedev-agent-skills guidance for audio-design workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-camera-systems
bgrenat
Imported awesome-gamedev-agent-skills guidance for camera-systems workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-card-game
bgrenat
Imported awesome-gamedev-agent-skills guidance for card-game workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9 - 0.652score
gamedev-game-ai
bgrenat
Imported awesome-gamedev-agent-skills guidance for game-ai workflows in game development projects.
SkillAFreshness: A★ 24Claude Code +9
Cite this page
gamedev-physics-tuning skill. Agent Mart. https://agentmart.dev/skills/bgrenat-gamedev-physics-tuning (last updated 2026-10-24)