К основному содержанию
скилл Claude Code CX Codex Cursor GitHub Copilot

physics-tuning — скилл для Claude Code: что делает и как установить

Настраивает игровую физику: устраняет дрожание, прохождение сквозь стены и нестабильность тел. Помогает подружить фиксированный шаг расчёта с рендером.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill physics-tuning -a claude-code
Открыть на GitHub

Что делает physics-tuning

Скилл даёт правила для настройки симуляции вне зависимости от игрового движка. Он объясняет, как распределить вычисления: все силы и скорости отправляются в фиксированный шаг вроде FixedUpdate или _physics_process, а сглаживание картинки передаётся интерполяции рендера. Для борьбы с прохождением объектов сквозь препятствия предлагается включать непрерывное определение столкновений (CCD) и ограничивать предельную скорость тел.

Здесь же собраны подходы к балансировке массы, сопротивления воздуха и отскока через физические материалы. Масса меняет поведение при ударах, но не ускоряет падение под действием гравитации. Для стабильности составных конструкций увеличивают число итераций солвера и включают засыпание покоящихся объектов.

Скилл описывает общие принципы и не содержит конкретных реализаций для узлов Godot или компонентов Unity — для специфичных вызовов движка его придётся дополнять скиллами godot-physics или unity-physics.

Какие задачи решает

  • устранить прохождение быстрых объектов сквозь тонкие стены через CCD
  • убрать дрожание графики с помощью интерполяции между тиками физики
  • настроить массу, гравитацию и сопротивление для предсказуемого движения
  • разделить расчёты между фиксированным тиком и кадром рендера

Примеры запросов агенту

  • Почему персонаж проходит сквозь стену на высокой скорости и как это исправить?
  • Настрой интерполяцию для сглаживания рывков между физическим тиком и кадрами рендера.
  • Помоги настроить слои коллизий и маски, чтобы подбираемые предметы реагировали только на игрока.

Как установить physics-tuning

1Через Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill physics-tuning -a claude-code

2Вручную: положить файлы

~/.claude/skills/physics-tuning/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/physics-tuning/

Из того же набора40

Весь набор →
game-feel gamedev-skills Скилл учит агента добавлять отклик к игровым действиям: тряску камеры, стоп-кадр, твины с easing, сквош и отброс. Для случаев, когда механика работает, но ощущается ватной. Claude Code CX Codex Cursor +1 9 400установок game-ui-ux gamedev-skills Архитектурный скилл для создания адаптивных игровых интерфейсов, стека экранов и навигации с геймпада без покадрового опроса состояния. Claude Code CX Codex Cursor +1 9 200установок level-design gamedev-skills Помогает спроектировать игровой уровень от блокута до плейтеста: маршруты, темп, препятствия и столкновения. Нужен при работе с whitebox, критическим путём и геймплейными комнатами. Claude Code CX Codex Cursor +1 7 500установок camera-systems gamedev-skills Рецепты для игровых камер в 2D и 3D: плавное следование, мёртвые зоны, опережение движения и обработка столкновений для Godot и Unity. Claude Code CX Codex Cursor +1 7 100установок audio-design gamedev-skills Скилл учит раскладывать игровой звук по шинам, глушить музыку под голос и собирать адаптивный саундтрек слоями. Примеры кода — на GDScript под Godot 4.7, с пометками для Unity. Claude Code CX Codex Cursor +1 7 100установок performance-optimization gamedev-skills Скилл учит искать узкое место в игре по профайлеру движка, а не по догадке, и даёт набор правок: пулы объектов, батчинг, отказ от лишних аллокаций. Claude Code CX Codex Cursor +1 7 100установок game-ai gamedev-skills Помогает проектировать логику врагов и NPC: конечные автоматы, деревья поведения, алгоритмы руления и поиск пути A*. Пригодится при сборке поведения ботов для любого движка. Claude Code CX Codex Cursor +1 7 100установок input-systems gamedev-skills Архитектура игровых управлений: отображение клавиш на действия, перекоординирование с проверкой конфликтов, поддержка клавиатуры, геймпада и сенсора, мёртвые зоны, буферизация и coyote time. Claude Code CX Codex Cursor +1 6 800установок

Похожие

unity-developer rmyndharis Скилл для разработки игр на Unity 6 LTS с оптимизацией производительности, настройкой конвейеров рендеринга и кроссплатформной сборкой. Помогает писать C# код, настраивать URP/HDRP и решать проблемы с физикой и ассетами. Claude Code CX Codex Cursor +1 3 000установок orbit-card heygen-com Скилл для встраивания готового 10-секундного 3D-блока HyperFrames: карточка фичи облетает сферу из точек по траектории камеры из Blender. Claude Code CX Codex Cursor +1 9 800установок sdf earthtojake Скилл создаёт и проверяет SDFormat-файлы для моделей и миров, а затем помогает подготовить их к передаче в симулятор. Claude Code CX Codex Cursor +1 10 500установок urdf earthtojake Скилл помогает создавать, проверять и отлаживать описания роботов в формате URDF. Пригодится для работы со звеньями, сочленениями и геометрией. Claude Code CX Codex Cursor +1 10 400установок hatch-pet официальный openai Создаёт и упаковывает анимированных питомцев и спрайт-листы для Codex. Пригодится, когда нужен персонаж по описанию, изображению или фирменным ориентирам. Claude Code CX Codex Cursor +1 3 300установок gcode earthtojake Нарезает модели STL, 3MF и OBJ в G-code через OrcaSlicer. Подходит, когда нужно подготовить файл для печати без подключения к принтеру. Claude Code CX Codex Cursor +1 9 500установок dxf earthtojake Скилл собирает и проверяет 2D DXF-чертежи из Python-скриптов на build123d: контуры, прокладки, панели, развёртки под лазер. Claude Code CX Codex Cursor +1 9 100установок

Вопросы о physics-tuning

Как установить physics-tuning в Claude Code?

Выполните команду npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill physics-tuning -a claude-code в терминале.

Что делает скилл physics-tuning?

Он задаёт методику настройки физики без привязки к конкретному движку. Скилл учит агента устранять туннелирование, дрожание графики, разлёты составных тел и правильно разделять кадры рендера с фиксированным шагом симуляции.

Когда этот скилл не подходит?

Его не используют для конкретных API движков, логики прыжков платформера или решений ИИ. Для вызовов узлов Godot или компонентов Unity нужны скиллы godot-physics или unity-physics.

Исходный текст

SKILL.md · Apache-2.0
---
name: 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

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's project setting
`physics/common/physics_interpolation` (off by default; it interpolates every
node, 2D and 3D) and Unity's `Rigidbody.interpolation = Interpolate`. Prefer the
built-in before hand-rolling, and never do both on the same node.

### 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 = CollisionDetectionMode.ContinuousSpeculative (cheap, covers
# dynamic bodies too) or ContinuousDynamic (fast vs fast); plain Continuous sweeps vs static only.
# 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 6: linearDamping, was drag)
body.gravity_scale = 1.5             # per-object gravity multiplier (Unity: Rigidbody2D.gravityScale)
# Bounce/slide come from the physics material, not code:
material.bounce = 0.2                # restitution 0..1 (Unity: PhysicsMaterial.bounciness)
material.friction = 0.8              # surface grip
body.physics_material_override = material
```

### 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.
- **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 `dt` spikes** (load hitches, breakpoints) blow up integration. Clamp the
  max physics step / substep count so a stall doesn't launch everything (Godot
  `physics/common/max_physics_steps_per_frame`, Unity *Maximum Allowed Timestep*).
- **Teleports smear across the screen** with interpolation on: the renderer
  blends from the old position. Godot: call `reset_physics_interpolation()`
  *after* moving the node. Unity: move interpolated bodies through the
  Rigidbody; a direct `transform` write is ignored unless followed by
  `Physics.SyncTransforms()`.
- **Feel changes after raising the physics rate**: Godot (GodotPhysics and Jolt
  alike) damps by multiplying velocity by `1 - damp / ticks_per_second` each
  tick, an approximation that drifts as `damp` approaches the tick rate (at
  `damp >= ticks_per_second` the body stops in one tick). Small damping values
  barely change; re-tune large ones after changing `physics_ticks_per_second`.

## 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.

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой