Перейти к содержанию
Skillpedia
Код в целом6.6k · #13799

input-systems

Что он делает

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

Когда использовать

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

Ссылка на скилл

https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/input-systems/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/input-systems/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Я хочу, чтобы игроки могли переназначать управление и пользоваться геймпадом, а прыжки были более снисходительными. Как настроить ввод?”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

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

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

Input systems

Never wire gameplay to raw keys. Map physical inputs (a key, a button, a touch) to named actions (jump, interact, move), and let gameplay read actions. That one indirection gives you rebinding, multi-device support, and accessibility almost for free. This skill is the engine-neutral architecture; bind it to unity-input-system, unreal-enhanced-input, or Godot's InputMap.

When to use

  • Use to design an input layer: actions, bindings, multiple devices, and a rebinding UI with conflict detection and saved bindings.
  • Use to add analog handling (deadzones, sensitivity) and game-feel features (input buffering, coyote time).
  • Use to make controls accessible (full remapping, hold-vs-toggle, sensitivity, no required simultaneous presses).

When not to use: for an engine's concrete input package/API, use unity-input-system, unreal-enhanced-input, or Godot's InputMap. For the movement/jump physics the buffer feeds, see physics-tuning and the engine movement skill. Persisting bindings to disk is save-systems.

Core workflow

  1. Define actions, not keys. Gameplay asks "is jump pressed?", never "is Space pressed?". Actions are the stable contract; bindings are data.
  2. Bind per device. Each action holds bindings for keyboard, gamepad, and touch. The active device is whichever last sent input; swap UI prompts to match.
  3. Read the right edge. Use pressed-this-frame (edge) for discrete actions (jump, interact) and held (level) for continuous ones (move, aim). Confusing the two causes double-fires or missed presses.
  4. Filter analog input. Apply a deadzone to sticks/triggers so resting drift reads as zero, and scale sensitivity/curve to taste.
  5. Buffer for feel. Remember a pressed action for a short window so a slightly early press still fires (input buffering); allow a jump shortly after leaving a ledge (coyote time).
  6. Make rebinding first-class. A UI that captures the next input, detects conflicts, and persists bindings — and a reset-to-default. Save via save-systems.
  7. Verify on every device and with rebinds: keyboard, gamepad, touch; rebind an action mid-game and confirm gameplay and prompts follow.

Patterns

1. Actions over raw keys; edge vs held

# Gameplay reads ACTIONS. The mapping from key/button to action lives in data.
# Discrete (edge): fire once on the press frame.
if Input.is_action_just_pressed("jump"):
    try_jump()
# Continuous (held): read every frame as an axis.
var move := Input.get_axis("move_left", "move_right")   # -1..1, one axis
player.velocity.x = move * RUN_SPEED
# Two axes (stick or WASD): get_vector applies a circular deadzone, rescales
# past it and caps the length at 1, so diagonals are not faster.
var dir := Input.get_vector("move_left", "move_right", "move_up", "move_down")
# RIGHT: name actions ("jump"); rebinding/devices just change the binding data.
# WRONG: `if Input.is_key_pressed(KEY_SPACE)` — unrebindable, keyboard-only,
# and `is_key_pressed` is a held check that would re-fire jump every frame.

Engine equivalents (Godot 4.7, Unity 6.3 LTS, Unreal 5.8): Godot InputMap + Input.is_action_just_pressed (valid in _process and _physics_process); Unity Input System InputAction / action maps; Unreal Enhanced Input Input Actions + Input Mapping Contexts.

2. Analog deadzone and sensitivity

# Raw sticks never rest at exactly zero. Apply a RADIAL deadzone (on the vector
# length), not per-axis, so diagonals aren't clipped into the axes.
func apply_deadzone(stick: Vector2, dead := 0.2, curve := 1.0) -> Vector2:
    var mag := stick.length()
    if mag < dead:
        return Vector2.ZERO                      # inside deadzone -> no movement
    # Rescale so motion ramps from 0 at the edge of the deadzone, not from `dead`.
    var scaled := minf((mag - dead) / (1.0 - dead), 1.0)  # some pads report > 1 on diagonals
    return stick / mag * pow(scaled, curve)      # curve > 1 = finer aim near center
# WRONG: clamping each axis separately — it carves a square hole and snaps to axes.

Keep the response curve (exponent) separate from sensitivity (a plain gain on the result, usually a camera turn rate) and expose both. Godot's get_vector already does the deadzone and rescale above, using the average of the four actions' deadzones (0.2 by default per action) unless you pass one.

3. Input buffering + coyote time (for

Частые вопросы

Почему не использовать клавиши прямо в коде игры?

Скилл говорит, что именованные действия позволяют переназначать управление и поддерживать новые устройства без изменения игрового кода.

Сохраняет ли он изменения переназначения?

Скилл ссылается на системы сохранений, которые записывают привязки на диск.

Покрывает ли он доступность?

Да. Он включает полное переназначение, опции удержания или переключения и настройки чувствительности.

Подробности

Оригинальное описание автора

Architect game input — action mapping (abstracting keys into named actions), rebinding with conflict detection and persistence, multi-device support (keyboard, gamepad, touch), analog deadzones, and feel features like input buffering and coyote time, plus accessibility. Engine-neutral. Use when the user mentions input mapping, rebind controls, gamepad support, deadzone, input buffering, coyote time, or accessible controls.

repo: gamedev-skills/awesome-gamedev-agent-skills

Популярность

Звёзды на GitHub
6.6k
Место в рейтинге
#13799
Лицензия
Apache-2.0
Обновлён
28.10.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы