Skip to content

77 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic launched as Claude Skills), with a router that loads the right skill for your engine and task. Runs in Claude Code, Cursor, Kiro, Codex, Copilot, Gemini CLI and more.

fix: address game development skills issues 27-31 and 33

InfiniteMindData26def41f9b40
diff --git a/docs/SKILL-FORMAT.md b/docs/SKILL-FORMAT.md
index e039311..bcd3ee0 100644
--- a/docs/SKILL-FORMAT.md
+++ b/docs/SKILL-FORMAT.md
@@ -109,6 +109,9 @@ they behave the same in every skill:
`files_checked`, `error_count`, `warning_count`, `errors`, `warnings` and `truncated`;
- an `ERROR` only for something that really breaks the project; anything that might be fine is a
`WARNING`;
+- purely informational, untyped matches may be `NOTE`s that never affect exit status;
+ checkers that emit them add `note_count` and `notes` to JSON. `--max-issues` limits the
+ combined report, warnings/errors before notes, without changing totals;
- end-to-end tests in `tests/test_<script>.py` that build their fixtures in a temporary folder.
The SKILL.md step that runs the script says when to run it and what to do with the result, and
diff --git a/router/SKILL.md b/router/SKILL.md
index 8254380..83fdfc4 100644
--- a/router/SKILL.md
+++ b/router/SKILL.md
@@ -38,13 +38,16 @@ new engine or concern (router step 6).
3. **Resolve** — the minimal set: engine skill(s) + discipline(s) + genre + workflow(s). §3.
4. **Read (disclosure)** — open only the chosen `SKILL.md` bodies; `references/` only on demand. §4.
5. **Compose** — order: engine fundamentals → discipline concept → genre glue → workflow. §5.
-6. **Fallback** — engine unknown or no skill fits → ask or default to Godot; state any gap. §6.
+6. **Fallback** — preserve existing engines, including custom/proprietary ones; bind missing APIs
+ from project evidence and state any gap. For a new project with no engine preference, see §6.
---
## 1. Engine detection (project fingerprint)
-Scan for the highest-confidence signal; **choose exactly one** engine. Stop at the first match.
+Scan for the highest-confidence signal; **choose exactly one** engine for the target project.
+An explicitly identified custom/proprietary engine is a valid result even without a catalog skill.
+Check the target's build and runtime entry point before treating a bundled library/tool as its engine.
| # | Engine | Primary signal | Skill set root |
|:-:|--------|----------------|----------------|
@@ -194,7 +197,8 @@ skill's `feel-tuning.md` reference if you want coyote-time/buffering."*
## 5. Composition rules
-- **One engine set, additive concepts.** Exactly one engine skill set; add the disciplines the
+- **One engine, additive concepts.** Use its engine skill set when available; for an unsupported
+ engine, use project evidence as the API binding instead. Add the disciplines the
task needs and usually **at most one** genre. Workflows attach independently.
- **Order:** engine fundamentals → discipline concept → genre orchestration → workflow. For asset
production, approve the visual target before generating a family, then finish with the engine
@@ -213,12 +217,17 @@ skill's `feel-tuning.md` reference if you want coyote-time/buffering."*
1. Check the request for a plain-text engine name ("in Unity", "using Phaser"). If found, adopt it.
2. If the task is a pure concept/genre/workflow question, route straight to the engine-agnostic
discipline/genre/workflow skill — no engine needed ("what's a good save format?" → `save-systems`).
-3. Only if engine choice actually blocks the answer, ask **one** targeted question ("Which engine —
- Godot, Unity, Unreal, or a web/other engine?"). If the user has no preference and one is needed,
- **default to Godot** (the most fully covered engine here) and say so.
+3. Only if engine choice actually blocks the answer, ask **one** targeted question about the
+ engine or project entry point. For a **new project** with no existing engine and no user
+ preference, **default to Godot** (the most fully covered engine here) and say so.
4. Never invent an engine or load an engine skill on a guess.
-**Engine known but no skill covers the subtask:** load the closest engine skill plus the relevant
+**Custom, proprietary, in-house, or unsupported engine:** keep that engine and its toolchain.
+Read `references/custom-engines.md` to map the relevant discipline/genre concepts onto verified
+project APIs, using local documentation, headers/source, examples, and build/test commands.
+No catalog engine skill is required. Do not switch engines or invent a compatible API.
+
+**Catalog engine known but no skill covers the subtask:** load the closest skill for that same engine plus the relevant
discipline and **state the gap** plainly (e.g. "no dedicated Unity 2D-movement skill; using
`unity-csharp-scripting` + `unity-physics`"). Never fabricate a skill name.
@@ -231,6 +240,7 @@ and offer to load it if the user confirms.
|---------|-----------------|--------------------------|
| "add a double jump to my Godot player" | Godot (`project.godot`) | `godot-2d-movement` → `platformer` |
| "make an inventory for my Unity RPG" | Unity (`Assets/`+`ProjectSettings/`) | `unity-scriptableobjects` → `rpg` → `save-systems` |
+| "add an inventory to my proprietary C++ RPG" | existing custom engine | custom-engine reference → `rpg` + `save-systems`; bind data/UI to verified project APIs |
| "build a 2D puzzle in Go with Ebitengine" | Ebitengine (named; later `go.mod`) | `ebitengine-game` → `puzzle` |
| "fix a stale HUD in my Go game" | Ebitengine (`go.mod` + game imports) | `ebitengine-game` → `game-ui-ux`; read text/UI, no new scaffold |
| "add player movement to my Defold game" | Defold (`game.project`) | `defold-core` → `input-systems` |
@@ -248,3 +258,4 @@ and offer to load it if the user confirms.
- Full engine fingerprints, secondary signals, and disambiguation: `references/engine-detection.md`.
- Exhaustive per-skill trigger words, engine bindings, and binding gaps: `references/routing-table.md`.
+- Custom/proprietary or unsupported engine integration: `references/custom-engines.md`.
diff --git a/router/references/custom-engines.md b/router/references/custom-engines.md
new file mode 100644
index 0000000..8218599
--- /dev/null
+++ b/router/references/custom-engines.md
@@ -0,0 +1,58 @@
+# Working with custom and proprietary engines
+
+Use this path for an in-house engine, engine maker, unfamiliar framework, or a known engine
+without a catalog skill. The project remains on its existing engine. Genre and discipline
+skills describe portable systems; their named Godot/Unity/etc. bindings are examples, not
+requirements to install or migrate to those engines.
+
+## Establish the engine contract
+
+Before engine-specific implementation, inspect the project's instructions, README, build
+configuration, version/revision, and one working feature closest to the request. Local engine
+documentation, public headers, implementation, and tests are the primary sources. Record a
+small integration map in the project's normal design notes:
+
+| Contract | Evidence to record |
+|----------|--------------------|
+| Build and run | Exact existing commands, target/platform, engine revision, test entry point |
+| Lifecycle | Creation/destruction hooks, ownership, scene or entity changes, reload behavior |
+| Time and input | Tick/render order, time units, action mapping, press/release edges |
+| State and assets | Content definitions vs runtime state, stable IDs, asset loading/unloading |
+| Relevant subsystem | Existing physics, UI, events, audio, or persistence API needed by this task |
+
+For each row needed by the task, name the actual symbol/file and a working call site. Mark
+unverified behavior as unknown. A similar engine's API is not evidence. Read only the subsystems
+the feature needs; do not reverse engineer the entire engine to add an inventory.
+
+If source is unavailable, use the supplied SDK/manual and shipped examples. If those do not
+establish a required API, ask for the smallest missing declaration or working example. Continue
+with data models and labeled pseudocode that do not depend on that API; do not claim it compiles.
+Use only material the user can share; proprietary source need not be published to use this path.
+
+## Bind concepts to the project
+
+1. Load the relevant genre and disciplines, such as `rpg` + `save-systems` for inventory.
+2. Separate engine-neutral rules from integration: quantities, stacking, equipment modifiers,
+ and stable item IDs can be tested independently from rendering and input.
+3. Map those rules onto the project's existing data, event, UI, and persistence conventions.
+ Reuse its working interfaces instead of introducing a parallel framework.
+4. Implement one small end-to-end slice with verified APIs, then run the established build,
+ tests, and game. Check lifecycle changes such as scene reload or entity destruction.
+5. Report tested behavior, commands, and any remaining unknown API binding explicitly.
+
+For an RPG inventory, first locate the project's content schema/loader, player-state owner,
+UI event handler, and save serializer. Keep item definitions separate from mutable quantities;
+store stable IDs and versioned state rather than engine pointers. Test add/remove/stack and
+equip/unequip rules, then a save/load round trip using the real serializer. This is an
+integration recipe, not a proposed proprietary-engine API.
+
+## Failure modes
+
+- **Unknown engine becomes a Godot scaffold:** distinguish an existing unsupported engine from
+ an empty new project. Keep the existing engine, language, assets, and build system.
+- **A sample compiles only in another engine:** treat concrete examples as concepts and bind
+ them to the verified local contract before writing production code.
+- **No SDK access:** state precisely which binding is blocked; provide pseudocode and request
+ the required signature/example rather than guessing names or return values.
+- **New code bypasses engine ownership:** follow the working example's lifecycle and cleanup;
+ test scene changes and restart as well as the first successful interaction.
diff --git a/router/references/engine-detection.md b/router/references/engine-detection.md
index 5adc2ff..d132b4e 100644
--- a/router/references/engine-detection.md
+++ b/router/references/engine-detection.md
@@ -2,7 +2,8 @@
The router body carries the primary signal per engine; this file holds the **complete**
fingerprint table, the disambiguation rules, and the secondary signals. Detection is
-**exclusive**: pick exactly one engine skill set (or "unknown" and use the fallback).
+**exclusive**: identify one engine for the target project. A custom/proprietary engine can be
+known without a catalog skill; use the router's custom-engine fallback in that case.
Scan for the highest-confidence signal and stop at the first match in this precedence order.
@@ -66,6 +67,10 @@ preserve the detected version unless the user explicitly requests migration.
file or subdirectory the request is about. If still ambiguous, ask one targeted question.
- **No engine files at all** — go to the unknown-engine fallback (router body §6). Many
discipline / genre / workflow tasks need no engine at all.
+- **Custom/proprietary engine** — inspect the named engine's build files, runtime entry point,
+ local SDK/docs and examples. A generic CMake project, `.csproj`, Lua file, or bundled renderer
+ alone does not establish a catalog engine. Preserve the existing engine; record its revision
+ from build metadata or local documentation and use `custom-engines.md` for API bindings.
## Plain-text engine mentions
diff --git a/router/references/routing-table.md b/router/references/routing-table.md
index 4b2fb12..06bb9eb 100644
--- a/router/references/routing-table.md
+++ b/router/references/routing-table.md
@@ -109,7 +109,7 @@ a real folder at `skills/<category>/<name>/SKILL.md`. Trigger words (`says:`) an
| Genre skill | `says:` triggers | composes (bind `*` to the detected engine) |
|-------------|------------------|---------------------------------------------|
-| `platformer` | platformer, jump mechanic, double jump, Mario-like | `godot-2d-movement` (or engine physics) + `godot-tilemap`/`unity-tilemap-2d` + `level-design` + `camera-systems` + `game-feel` |
+| `platformer` | platformer, jump mechanic, double jump, wall jump, wall slide, Mario-like | `godot-2d-movement` (or engine physics) + `godot-tilemap`/`unity-tilemap-2d` + `level-design` + `camera-systems` + `game-feel` |
| `roguelike` | roguelike, procedural dungeon, permadeath, turn-based grid | `procedural-gen` + `godot-tilemap`/`unity-tilemap-2d` + `game-ai` + `save-systems` + `game-feel` |
| `rpg` | RPG, stats/leveling, inventory, quest system | `godot-resources`/`unity-scriptableobjects` + `dialogue-systems` + `save-systems` + `game-ui-ux` |
| `fps-shooter` | FPS, first-person shooter, hitscan, aim/shoot | `godot-3d-essentials`/`unreal-cpp-gameplay` + `input-systems` + `game-ai` + `camera-systems` + `game-feel` |
@@ -130,6 +130,11 @@ a real folder at `skills/<category>/<name>/SKILL.md`. Trigger words (`says:`) an
## Binding gaps (be honest; do not fabricate a skill)
+For a **custom, proprietary, in-house, or unsupported engine**, keep the engine and use the
+router's `custom-engines.md` reference. Load the relevant genre/discipline skills; replace
+catalog engine bindings with verified project APIs. Engine-specific names in composition
+tables are examples, not mandatory dependencies for portable genre systems.
+
The collection does not yet have a skill for every engine × concept. Several cross-cutting
concerns are now covered **engine-neutrally** by disciplines that pair with any detected engine —
camera work (`camera-systems`), HUD/menus (`game-ui-ux`), juice/feedback (`game-feel`), and
diff --git a/skills/disciplines/performance-optimization/SKILL.md b/skills/disciplines/performance-optimization/SKILL.md
index 27122e6..e6878a4 100644
--- a/skills/disciplines/performance-optimization/SKILL.md
+++ b/skills/disciplines/performance-optimization/SKILL.md
@@ -112,6 +112,8 @@ share state (most bind several textures per batch), so ordering and atlasing dec
takes precedence), MultiMesh / MultiMeshInstance (Godot), Instanced Static Mesh (Unreal).
- Static geometry → static batching / baking; mark non-moving objects static.
- Reduce overdraw: limit large overlapping transparent/particle layers (they re-shade pixels).
+- If fill rate dominates, lower render resolution: 2× pixel ratio means 4× the pixels of 1×.
+ For three.js game defaults and warm-up-aware resolution tuning, read `threejs-scene-setup`.
- Fewer real-time lights/shadows; bake lighting where it doesn't move.
Measure draw calls before and after — the count should drop, and so should GPU frame time.
```
diff --git a/skills/ebitengine/ebitengine-game/SKILL.md b/skills/ebitengine/ebitengine-game/SKILL.md
index 9cb7592..ef948ba 100644
--- a/skills/ebitengine/ebitengine-game/SKILL.md
+++ b/skills/ebitengine/ebitengine-game/SKILL.md
@@ -142,6 +142,13 @@ proof of a broken build. A clean result proves neither API correctness nor
quality. Run other relevant package tests too; on Linux, tests that initialize
graphics need `xvfb-run -a`.
+The checker cannot infer Go receiver types. Ambiguous `.At()` calls in `Update`/`Draw`
+are informational notes, not warnings: ordinary grid/map lookups are fine; verify
+whether the receiver is actually an `ebiten.Image` before treating it as a GPU
+readback. `ReadPixels()` remains a warning. Notes never fail `--strict`; JSON adds
+`note_count` and `notes` to the shared schema. `--max-issues` caps warnings and notes
+together, showing warnings first while retaining both totals.
+
For the starter, capture with `-demo -shot frame.png -shot-tick 240`. On Linux,
use a virtual display and, if needed, null audio without changing HOME:
diff --git a/skills/ebitengine/ebitengine-game/scripts/check_ebitengine.py b/skills/ebitengine/ebitengine-game/scripts/check_ebitengine.py
index f36a1c7..22dd4e6 100644
--- a/skills/ebitengine/ebitengine-game/scripts/check_ebitengine.py
+++ b/skills/ebitengine/ebitengine-game/scripts/check_ebitengine.py
@@ -4,8 +4,9 @@
This is a heuristic source scan, not a Go type checker or a quality verdict.
It recognises named/aliased imports, but not dot imports or variable shadowing;
it scans every selected file regardless of build constraints. Review warnings.
-Reads Go sources and go.mod only and never modifies them. All heuristic findings
-are warnings: deprecated does not mean broken. Use go build/vet for errors.
+Reads Go sources and go.mod only and never modifies them. Heuristic findings
+are warnings or informational notes: deprecated does not mean broken. Ambiguous
+At calls are notes and never fail --strict. Use go build/vet for errors.
The deprecation table matches
Ebitengine v2.10; on an older pinned version some replacements may not exist yet
(each finding names the version that deprecated the API).
@@ -87,7 +88,7 @@ IN_DRAW = [
# Checks inside Update and Draw bodies.
IN_LOOP = [
(r"\btime\.(Now|Since)\(", "wall-clock time in the game loop; use ticks for simulation, wall time may be intentional for profiling or external deadlines"),
- (r"\.ReadPixels\(|\.At\(", "possible GPU readback (if this is an ebiten.Image); review repeated reads, screenshots/tests are intentional"),
+ (r"\.ReadPixels\(", "possible GPU readback (if this is an ebiten.Image); review repeated reads, screenshots/tests are intentional"),
]
@@ -204,6 +205,11 @@ def scan_file(path, raw_imports):
add("warn", line0 + body.count("\n", 0, m.start()), "in Draw: " + msg)
for name in ("Update", "Draw"):
for line0, body in method_bodies(code, name):
+ # At is also a common grid/map method. Without Go type information,
+ # neither its name nor argument count proves an Image readback.
+ for m in re.finditer(r"\.At\s*\(", body):
+ add("note", line0 + body.count("\n", 0, m.start()), "in " + name +
+ ": At call has an unknown receiver type; only ebiten.Image.At reads GPU pixels, ordinary grid/map lookups are fine")
for pat, msg in IN_LOOP:
for m in re.finditer(pat, body):
add("warn", line0 + body.count("\n", 0, m.start()), "in " + name + ": " + msg)
@@ -284,9 +290,12 @@ def main(argv=None):
findings.append(("warn", p, line, "multiple audio.NewContext call sites; only one context may exist per process. "
"Check whether these sites can execute together (build tags and alternative entry points may exclude them)"))
- warnings = []
- for _, path, line, message in sorted(findings, key=lambda f: (str(f[1]), f[2], f[3])):
- if "deprecated:" in message or message.startswith("old import:"):
+ warnings, notes = [], []
+ for severity, path, line, message in sorted(findings, key=lambda f: (str(f[1]), f[2], f[3])):
+ if severity == "note":
+ code = "ambiguous-at"
+ fix = "Check the receiver type; avoid repeated Image.At reads in the loop. No action is needed for CPU grid/map lookups."
+ elif "deprecated:" in message or message.startswith("old import:"):
code = "deprecated-api" if "deprecated:" in message else "old-import"
fix = "Confirm the imported type and pinned engine version before applying the suggested replacement."
elif message.startswith("multiple audio.NewContext"):
@@ -295,22 +304,31 @@ def main(argv=None):
else:
code = "loop-review"
fix = "Review the operation in context; keep gameplay/input/audio triggers in Update and reuse expensive resources."
- warnings.append({"code": code, "file": Path(path).relative_to(root).as_posix(),
- "line": line, "message": message, "fix": fix})
+ (notes if severity == "note" else warnings).append(
+ {"code": code, "file": Path(path).relative_to(root).as_posix(),
+ "line": line, "message": message, "fix": fix})
shown = warnings[:args.max_issues] if args.max_issues else warnings
- truncated = len(shown) < len(warnings)
+ shown_notes = notes[:max(0, args.max_issues - len(shown))] if args.max_issues else notes
+ omitted = len(warnings) + len(notes) - len(shown) - len(shown_notes)
+ truncated = omitted > 0
if args.json:
print(json.dumps({"tool": TOOL, "schema": SCHEMA, "root": root.as_posix(),
"files_checked": len(files), "error_count": 0,
"warning_count": len(warnings), "errors": [],
- "warnings": shown, "truncated": truncated}, indent=2))
+ "warnings": shown, "note_count": len(notes), "notes": shown_notes,
+ "truncated": truncated}, indent=2))
else:
for issue in shown:
print(f"WARNING {issue['file']}:{issue['line']}: {issue['message']}")
print(f" fix: {issue['fix']}")
+ for issue in shown_notes:
+ print(f"NOTE {issue['file']}:{issue['line']}: {issue['message']}")
+ print(f" fix: {issue['fix']}")
if truncated:
- print(f"... and {len(warnings) - len(shown)} more")
+ print(f"... and {omitted} more")
print(f"Summary: 0 errors, {len(warnings)} warnings in {len(files)} files checked")
+ if notes:
+ print(f"Notes: {len(notes)} informational findings (do not affect --strict)")
return 1 if args.strict and warnings else 0
diff --git a/skills/genres/platformer/SKILL.md b/skills/genres/platformer/SKILL.md
index 1986994..4d5337b 100644
--- a/skills/genres/platformer/SKILL.md
+++ b/skills/genres/platformer/SKILL.md
@@ -2,7 +2,8 @@
name: platformer
description: >
Build a 2D platformer: run/jump control with coyote time, jump buffering, and variable jump
- height, plus tiled levels and hazards. Use for a platformer or Mario/Celeste-like, or tuning jump feel.
+ height, wall slide and wall jump, plus tiled levels and hazards. Use for a platformer or
+ Mario/Celeste-like, or tuning jump feel.
---
# Platformer
@@ -54,6 +55,7 @@ Tune these by **outcome** (height in tiles, time to apex in seconds), not by raw
| Apex hang | brief float at the top for air control | reduce gravity ×0.5 near `|vy|`<threshold |
| Ground accel / friction | responsiveness vs. ice | reach top speed in 0.05–0.1 s |
| Corner correction | nudge past a ledge clipped by 1–2 px | nudge up to ~4 px sideways |
+| Wall slide / wall jump | controlled descent and kick-off | wall grace, kick/steering lock, air-jump refresh policy; see refs §9 |
Derive gravity and jump velocity from the *feel* values rather than guessing — see Pattern 1.
@@ -74,6 +76,9 @@ fall_gravity = gravity * 1.8 # heavier on the way down → less floaty
### 2. Coyote time + jump buffer + variable height (the feel core)
+For wall or air jumps, replace this simple jump resolver with the unified resolver in refs §9;
+keep variable-height and gravity integration only once per tick.
+
```python
# Pseudocode in the per-frame update. dt = seconds since last frame.
# Timers count DOWN; refresh coyote while grounded, buffer on a fresh press.
@@ -122,6 +127,8 @@ Down + Jump (refs §5).
- **Floaty jumps** → symmetric gravity. Make fall gravity heavier than rise gravity.
- **"The jump didn't register"** → no input buffering. Buffer presses for ~0.1 s before landing.
- **"I fell off and couldn't jump"** → no coyote time. Allow a jump for ~0.1 s after leaving ground.
+- **Wall jump overrides a ground jump or consumes the double jump** → resolve one buffered
+ press in ground/coyote → wall → air order, with an explicit air-jump refresh policy (refs §9).
- **Sticking to walls / catching on tile seams** → use a single capsule/box collider, not
per-tile colliders, and add corner correction.
- **Tunneling through floors at high speed** → enable continuous collision / smaller fixed
@@ -142,5 +149,5 @@ Down + Jump (refs §5).
## References
-- For jump math derivation, a full feel-tuning table, corner correction, moving/one-way
+- For jump math derivation, wall slide/jump, a full feel-tuning table, corner correction, moving/one-way
platforms, and camera follow, read `references/feel-tuning.md`.
diff --git a/skills/genres/platformer/references/feel-tuning.md b/skills/genres/platformer/references/feel-tuning.md
index e1143cd..7b2101c 100644
--- a/skills/genres/platformer/references/feel-tuning.md
+++ b/skills/genres/platformer/references/feel-tuning.md
@@ -136,3 +136,99 @@ The same idea on landing edges (a few px of "ledge grab"/snap) makes platforms f
- Place the first instance of any lethal hazard where failure is cheap (near a checkpoint,
no long re-traversal).
- Keep checkpoint-to-checkpoint segments short early, longer later; respawn must be instant.
+
+## 9. Wall slide and wall jump
+
+Treat wall traversal as part of the existing jump resolver, not a second independent jump
+script. Use fixed physics ticks and latched input edges. The following is engine-neutral
+pseudocode for static, vertical walls with positive Y downward; names are controller state,
+not engine APIs. Bind contact detection to the project's collision system. Distinguish walls
+from floors/ceilings using contact normals, and use contacts from the latest completed physics
+step or an explicit probe. Collision flags may disappear when the player stops pushing.
+
+Remember the last valid wall side (`-1` left, `+1` right) for a short **wall-coyote** window.
+Do not use the remembered contact to apply slide friction after the player has left the wall.
+For a narrow passage with both sides touching, pick one side deterministically, such as the
+side the player presses toward. Clear wall state on respawn, teleport, and scene changes.
+
+| Knob | Starting experiment, not a universal default |
+|------|---------------------------------------------|
+| Wall-coyote window | 0.08–0.12 s |
+| Wall jump height | about 0.8 × ground jump height |
+| Horizontal kick speed | about 1.25 × run speed |
+| Steering lock after kick | 0.10–0.15 s |
+| Slide max fall speed | about 0.2 × normal terminal speed |
+| Refresh air jumps on wall contact | explicit boolean; false preserves limited midair jumps |
+
+Derive upward kick speed from height: `-sqrt(2 * rise_gravity * WALL_JUMP_HEIGHT)`.
+Tune these values in the level's world units. Refreshing air jumps on each wall contact
+enables longer climbing routes; not refreshing them makes the existing air-jump budget matter.
+In this example a wall jump itself does **not** spend an air jump.
+
+```python
+# At each fixed tick, before moving. side is current contact; 0 means no wall.
+# All timers and air_jumps_left persist between ticks; initialize them on spawn.
+coyote_timer = max(0, coyote_timer - dt)
+wall_timer = max(0, wall_timer - dt)
+buffer_timer = max(0, buffer_timer - dt)
+steer_lock = max(0, steer_lock - dt)
+if jump_pressed_this_tick:
+ buffer_timer = JUMP_BUFFER
+if on_floor:
+ coyote_timer = COYOTE_TIME
+ air_jumps_left = MAX_AIR_JUMPS
+ wall_timer = 0
+elif side != 0 and steer_lock == 0:
+ wall_side = side
+ wall_timer = WALL_COYOTE
+ if REFRESH_AIR_JUMPS_ON_WALL:
+ air_jumps_left = MAX_AIR_JUMPS
+
+# Run normal horizontal steering only when steer_lock == 0.
+# After steering, remove only velocity INTO a current wall; retain velocity away.
+if side != 0 and velocity.x * side > 0:
+ velocity.x = 0
+
+jumped = False
+if buffer_timer > 0:
+ if on_floor or coyote_timer > 0: # ground/coyote wins
+ velocity.y = jump_velocity
+ jumped = True
+ elif wall_timer > 0 and steer_lock == 0: # then wall, using remembered side
+ velocity.x = -wall_side * WALL_KICK_SPEED
+ velocity.y = -sqrt(2 * rise_gravity * WALL_JUMP_HEIGHT)
+ steer_lock = WALL_STEER_LOCK
+ jumped = True
+ elif air_jumps_left > 0: # finally air jump
+ velocity.y = air_jump_velocity
+ air_jumps_left -= 1
+ jumped = True
+if jumped:
+ buffer_timer = 0 # consume the press exactly once
+ coyote_timer = 0
+ wall_timer = 0
+
+# Apply the existing variable-height/gravity rules once, then cap wall descent.
+# Keep the cap after gravity so gravity does not immediately exceed it.
+if not on_floor and side != 0 and velocity.y > 0 and input_x * side > 0:
+ velocity.y = min(velocity.y, WALL_SLIDE_MAX_FALL)
+# Move/collide once; refresh contacts for the next tick.
+```
+
+The lock prevents normal steering from cancelling the kick on its first frames. It also
+prevents the previous contact from immediately refreshing wall grace. Collision response still
+applies while locked. Landing restores the normal ground/air-jump state; clear stale grounded
+flags through the normal physics update after a jump. If a game forbids repeated jumps from
+the same wall until landing or reaching another wall, track wall identity separately.
+
+Test both left and right walls: ground jump beside a wall; jump one tick after losing wall
+contact; hold toward the wall through a kick; release direction while falling; double jump
+before/after wall contact under both refresh policies; one press with every jump eligible.
+Only one branch may fire per press. A weak kick usually means steering overwrote its X
+velocity; an unexplained launch after leaving a wall often means stored into-wall velocity
+was never removed. A slide while rising or away from a wall means the cap predicate is too broad.
+
+For an example of contact-query semantics, the primary
+[Godot CharacterBody2D reference](https://docs.godotengine.org/en/stable/classes/class_characterbody2d.html)
+documents wall normals and contact flags from the last movement call. Verify equivalent
+semantics against the actual engine/version before translating this pseudocode.
diff --git a/skills/genres/rpg/SKILL.md b/skills/genres/rpg/SKILL.md
index 55744af..6ce277d 100644
--- a/skills/genres/rpg/SKILL.md
+++ b/skills/genres/rpg/SKILL.md
@@ -12,6 +12,11 @@ dialogue, and combat. This is a **compositional** skill: it ties data-driven con
dialogue, and saving together. It does not re-teach those primitives; it defines the systems
that make growth and choice feel meaningful, and points to the skills that implement each.
+These systems also apply to custom/proprietary engines. Keep the project's engine and bind
+the concepts below to its documented data, events, UI, and save interfaces. Inspect local
+source/SDK examples before choosing APIs; the router's custom-engine fallback guides that
+mapping. Godot/Unity bindings below are examples, not prerequisites.
+
## When to use
- Use when building an RPG/JRPG/action-RPG: the player has **stats that grow**, an
@@ -109,7 +114,8 @@ def on_event(kind, data):
- **Stacked buffs explode** → percent modifiers multiplied together. Sum percents within a layer
unless a rule says otherwise (refs §1).
- **Content as code** → every item/quest hardcoded. Define items, enemies, and quests as
- **data** (`godot-resources` / `unity-scriptableobjects`).
+ **data** using the project's content schema/loader (`godot-resources` /
+ `unity-scriptableobjects` are catalog examples).
- **Save format with no version field** → old saves break on update. Add a `version` and a
migration path from day one (see `save-systems`).
- **Choices without consequences** → dialogue branches that reconverge immediately feel hollow.
@@ -121,9 +127,12 @@ def on_event(kind, data):
- **Dialogue:** `dialogue-systems` (Yarn Spinner / Ink) — branching lines, conditions, variables.
- **Persistence:** `save-systems` — character, inventory, quest flags, world state, versioning.
-- **Content data:** `godot-resources` / `unity-scriptableobjects` — items, enemies, quests, skills as assets.
+- **Content data:** the engine's content schema/loader — items, enemies, quests, skills as assets;
+ `godot-resources` / `unity-scriptableobjects` when using those engines.
- **Combat AI:** `game-ai` for enemy behavior; for turn order reuse the scheduler idea in `roguelike`.
-- **UI:** `game-ui-ux` for HUD/menu layout, resolution scaling, and controller/keyboard nav; `godot-ui-control` for the concrete inventory, quest log, character sheet, and dialogue box.
+- **UI:** `game-ui-ux` for HUD/menu layout, resolution scaling, and controller/keyboard nav;
+ the project's UI API for inventory, quest log, character sheet, and dialogue box
+ (`godot-ui-control` when using Godot).
- **World:** `level-design` plus your engine's tilemap/3D skill (`godot-tilemap`, `godot-3d-essentials`).
## References
diff --git a/skills/web-engines/phaser-core/SKILL.md b/skills/web-engines/phaser-core/SKILL.md
index 8310ad4..20231b0 100644
--- a/skills/web-engines/phaser-core/SKILL.md
+++ b/skills/web-engines/phaser-core/SKILL.md
@@ -146,6 +146,11 @@ this.cameras.main.setZoom(1.5);
## Pitfalls
+- **A key works once, then stays down (or Left + Right cancel out)** → in Phaser
+ 4.2.1, a `keyup` cancelled before the keyboard manager receives it is ignored
+ because `event.defaultPrevented` is set. Inspect host-page listeners and browser
+ extensions before changing movement code. Read the keyboard diagnosis and
+ capture-phase fallback contract in `references/scene-flow.md`.
- **Assets are `undefined` in `create`/`update`** → you forgot to queue them in
`preload`, or used the wrong key. The loader runs between `preload` and `create`.
- **State leaks across a restart** → you set fields in the constructor. The Scene
@@ -188,7 +193,7 @@ this.cameras.main.setZoom(1.5);
## References
- For the full scene state machine (pause/resume vs sleep/wake vs stop/start, the
- restart-state bug, and removing/replacing scenes), read
+ restart-state bug, removing/replacing scenes, and stuck keyboard input), read
`references/scene-flow.md`.
## Related skills
diff --git a/skills/web-engines/phaser-core/references/scene-flow.md b/skills/web-engines/phaser-core/references/scene-flow.md
index e489d7a..fa3d10d 100644
--- a/skills/web-engines/phaser-core/references/scene-flow.md
+++ b/skills/web-engines/phaser-core/references/scene-flow.md
@@ -113,3 +113,56 @@ this.scene.add('level', NewLevelScene, true); // true = autostart
A handy alternative to juggling keys is to store the active level key in the
registry and add/remove by that value.
+
+## Keys stay down after release (Phaser 4.2.1)
+
+The keyboard manager skips events already marked `defaultPrevented`. With its
+default `window` event target, a host-page listener earlier in propagation can
+cancel `keyup` before Phaser handles it. A tracked `Key` then stays `isDown`;
+opposing directions can cancel each other and later presses lose their down edge.
+Check the installed version's implementation before applying this diagnosis elsewhere.
+
+1. Inspect `keydown` and `keyup` at window capture and at the configured keyboard
+ target. Compare `event.code`, `event.defaultPrevented`, and the tracked key state.
+2. Temporarily disable host keyboard handlers and test with extensions disabled.
+ Remove or narrow the handler that cancels releases for game-owned keys.
+3. After removing the interference, call the affected Scene's
+ `this.input.keyboard.resetKeys()` once to clear its stale tracked keys.
+ Calling it every frame would break held input. Phaser already resets these keys
+ on game blur, Scene pause, and Scene sleep; adding another blur reset alone
+ does not repair a release cancelled while the game remains focused.
+
+For a local reproduction with the default keyboard target, temporarily register
+this listener, press and release an arrow key, and inspect its `isDown` value:
+
+```js
+const cancelRelease = (event) => {
+ if (event.code === 'ArrowLeft') event.preventDefault();
+};
+document.addEventListener('keyup', cancelRelease);
+// After inspecting the stuck key, remove the diagnostic listener:
+// document.removeEventListener('keyup', cancelRelease);
+// Then reset the affected Scene's keys once as described above.
+```
+
+If the host cannot be changed, replace keyboard handling deliberately: configure
+the Game with `input: { keyboard: false }`, remove `createCursorKeys()` and other
+keyboard-plugin calls, and own `window` capture listeners for `keydown`/`keyup`.
+The replacement reader needs this contract:
+
+- Track held keys by `event.code`; latch press/release edges until a simulation
+ tick consumes them so a short tap between ticks is retained. Suppress repeated
+ `keydown` edges while a key is held.
+- Clear held state and pending edges on blur or document hiding. Clear and suspend
+ gameplay input on Scene pause/sleep, resume cleanly on resume/wake, and remove
+ DOM and Scene listeners on shutdown so restarts do not duplicate them.
+- Limit capture to game-owned keys while gameplay owns focus; leave text fields,
+ editable content, and browser shortcuts usable. Process releases for keys already
+ held even if focus changed before release.
+- Test short taps, opposite directions, key repeat, focus loss, pause/resume,
+ sleep/wake, and Scene restart. Capture sees events before later cancellation,
+ but cannot recover an event blocked by an earlier `stopImmediatePropagation()`.
+
+Primary sources: Phaser 4.2.1
+[KeyboardManager](https://github.com/phaserjs/phaser/blob/v4.2.1/src/input/keyboard/KeyboardManager.js)
+and [KeyboardPlugin](https://github.com/phaserjs/phaser/blob/v4.2.1/src/input/keyboard/KeyboardPlugin.js).
diff --git a/skills/web-engines/threejs-scene-setup/SKILL.md b/skills/web-engines/threejs-scene-setup/SKILL.md
index 3e3788e..fad847f 100644
--- a/skills/web-engines/threejs-scene-setup/SKILL.md
+++ b/skills/web-engines/threejs-scene-setup/SKILL.md
@@ -75,7 +75,7 @@ import * as THREE from 'three';
const canvas = document.querySelector('#c');
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });
-renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); // cap for perf
+renderer.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)); // starting budget; profile on target hardware
renderer.setSize(window.innerWidth, window.innerHeight);
const scene = new THREE.Scene();
@@ -103,16 +103,24 @@ scene.add(cube);
const timer = new THREE.Timer(); // replaces the deprecated THREE.Clock (r183+)
timer.connect(document); // optional: no huge delta after a hidden tab
-renderer.setAnimationLoop((time) => {
- timer.update(time); // call once per frame, before getDelta()
- const dt = timer.getDelta(); // seconds since last frame
+renderer.setAnimationLoop(() => {
+ timer.update(); // use performance.now(), like visibility reset
+ const dt = Math.min(Math.max(timer.getDelta(), 0), 0.1); // seconds; bound stalls and negative deltas
cube.rotation.x += dt; // frame-rate independent
cube.rotation.y += dt * 0.7;
renderer.render(scene, camera);
});
// renderer.setAnimationLoop(null); // stop the loop
+// timer.dispose(); // remove visibility listener when tearing down
```
+In r186, visibility reset samples `performance.now()`. A supplied animation-frame
+timestamp can precede that reset and produce a negative delta. Using `update()`
+keeps the clock source consistent; the lower clamp also protects a fixed-step
+accumulator. Feed the bounded `dt` into simulation, not raw `getDelta()`.
+The 0.1-second upper bound deliberately drops excess time after a stall; tune it
+to the game's catch-up policy rather than using it for real-world deadlines.
+
### 4. Responsive resize
```js
@@ -152,7 +160,7 @@ falls back to a WebGL 2 backend where WebGPU is unavailable.
import * as THREE from 'three/webgpu';
const renderer = new THREE.WebGPURenderer({ antialias: true });
-renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
+renderer.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)); // starting budget; profile on target hardware
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
await renderer.init(); // required before direct render()/compute()
@@ -163,6 +171,21 @@ renderer.setAnimationLoop(() => renderer.render(scene, camera));
Scenes, cameras, built-in `Mesh*Material`s, and most addons carry over; custom
GLSL (`ShaderMaterial`, `onBeforeCompile`) does not.
+### 7. Resolution is a performance budget
+
+A ratio of 2 draws four times as many pixels as 1 at the same CSS size. A cap
+of 2 does nothing on a 2× display. Start games around 1.25–1.5, expose a resolution
+setting, and profile the target device; these are tuning defaults, not an FPS guarantee.
+Lower resolution helps fill-rate bottlenecks, not CPU-bound simulation.
+
+For adaptive resolution, measure several seconds of frame time after assets and
+shader warm-up. Ignore hidden-tab intervals and loading stalls. If sustained
+GPU/fill-rate pressure exceeds the budget, lower the ratio in 0.25 steps to a
+chosen floor (for example 1), never above the device ratio or user setting.
+Use a cooldown and a separate recovery threshold before raising it again to avoid
+oscillation. Reapply the chosen ratio on display/DPR changes and resize render
+targets or postprocessing buffers consistently with the renderer.
+
## Pitfalls
- **`Failed to resolve module specifier "three"`** → missing import map (or bundler
@@ -174,8 +197,11 @@ GLSL (`ShaderMaterial`, `onBeforeCompile`) does not.
call `setAnimationLoop` but render outside it.
- **Stretched / squashed view on resize** → you resized the renderer but didn't
update `camera.aspect` + `updateProjectionMatrix()`.
-- **Blurry or jagged on HiDPI** → set `renderer.setPixelRatio(...)`; cap it (≈2) so
- 4K/retina screens don't tank performance.
+- **Blurry or slow on HiDPI** → balance sharpness against fill rate with a resolution
+ setting. Start around 1.25–1.5; a cap of 2 still renders 4× the pixels of 1×.
+- **Simulation freezes after restoring a tab** → r186 can mix a frame timestamp
+ with visibility-reset time. Use `timer.update()` and clamp simulation delta to
+ `[0, 0.1]` as above so a negative delta cannot drain the fixed-step accumulator.
- **OrbitControls feel dead** → with `enableDamping = true` you must call
`controls.update()` every frame.
- **Old tutorials use `<script src="three.min.js">` or `examples/js/...`** →
@@ -190,6 +216,9 @@ GLSL (`ShaderMaterial`, `onBeforeCompile`) does not.
## References
+- Primary sources: [r186 Timer implementation](https://github.com/mrdoob/three.js/blob/r186/src/core/Timer.js)
+ and [r186 responsive rendering manual](https://github.com/mrdoob/three.js/blob/r186/manual/pages/responsive.html).
+
- For coordinate conventions, the scene-graph (`Group`, parent/child transforms,
`Object3D` add/remove), `OrthographicCamera` for 2.5D, and disposing of
geometries/materials/textures to avoid leaks, read `references/scene-graph.md`.
diff --git a/tests/test_check_ebitengine.py b/tests/test_check_ebitengine.py
index 2a83b9e..79c4577 100644
--- a/tests/test_check_ebitengine.py
+++ b/tests/test_check_ebitengine.py
@@ -39,7 +39,8 @@ class CheckEbitengineTests(unittest.TestCase):
self.assertEqual(result.returncode, 0, result.stderr)
report = json.loads(result.stdout)
self.assertEqual(set(report), {"tool", "schema", "root", "files_checked",
- "error_count", "warning_count", "errors", "warnings", "truncated"})
+ "error_count", "warning_count", "errors", "warnings", "truncated",
+ "note_count", "notes"})
self.assertEqual((report["tool"], report["schema"]), ("check_ebitengine", 1))
self.assertEqual(report["root"], self.root.resolve().as_posix())
self.assertEqual((report["error_count"], report["warning_count"], report["files_checked"]), (0, 2, 1))
@@ -128,6 +129,46 @@ func f(s *S, r R) { s.audio.NewPlayer(r); s.e.SetMaxTPS(60); audio.CurrentContex
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
self.assertEqual(json.loads(result.stdout)["warning_count"], 0)
+ def test_ambiguous_at_calls_are_notes_and_do_not_fail_strict(self):
+ self.write("main.go", '''package main
+import e "github.com/hajimehoshi/ebiten/v2"
+func (g *Game) Draw(screen *e.Image) {
+ g.Map.At(p)
+ grid.At(x, y)
+ screen.At(0, 0)
+ // screen.At(1, 1)
+ s := "screen.At(2, 2)"
+}
+''')
+ result = self.run_check("--json", "--strict")
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
+ report = json.loads(result.stdout)
+ self.assertEqual(report["warning_count"], 0)
+ self.assertEqual(report["note_count"], 3)
+ self.assertEqual([n["line"] for n in report["notes"]], [4, 5, 6])
+ text = self.run_check("--strict")
+ self.assertEqual(text.returncode, 0)
+ self.assertIn("NOTE main.go:4:", text.stdout)
+
+ def test_readpixels_stays_warning_and_notes_obey_report_limit(self):
+ self.write("main.go", '''package main
+import "github.com/hajimehoshi/ebiten/v2"
+func (g *Game) Update() error {
+ g.Map.At(p)
+ g.Map.At(q)
+ g.image.ReadPixels(pixels)
+ return nil
+}
+''')
+ result = self.run_check("--json", "--strict", "--max-issues", "1")
+ self.assertEqual(result.returncode, 1, result.stdout + result.stderr)
+ report = json.loads(result.stdout)
+ self.assertEqual((report["warning_count"], report["note_count"]), (1, 2))
+ self.assertEqual(len(report["warnings"]), 1)
+ self.assertEqual(len(report["notes"]), 0)
+ self.assertIn("GPU readback", report["warnings"][0]["message"])
+ self.assertTrue(report["truncated"])
+
def test_deprecated_player_methods_are_checked_only_with_audio_import(self):
body = "func f(p *P, file *F) { p.Close(); p.Seek(d); p.Current(); file.Seek(0, 0) }\n"
self.write("main.go", 'package main\nimport "github.com/hajimehoshi/ebiten/v2/audio"\n' + body)
diff --git a/tests/test_ebitengine_tools.py b/tests/test_ebitengine_tools.py
index df115f1..63c0c51 100644
--- a/tests/test_ebitengine_tools.py
+++ b/tests/test_ebitengine_tools.py
@@ -8,6 +8,7 @@ require a display, Go, network access, or a signing identity.
import contextlib
import importlib.util
import io
+import os
import plistlib
import struct
import subprocess
@@ -145,7 +146,10 @@ import (
with (app / "Contents/Info.plist").open("rb") as f:
self.assertEqual(plistlib.load(f)["CFBundleExecutable"], "testgame")
target = app / "Contents/MacOS/testgame"
- self.assertTrue(target.stat().st_mode & 0o111)
+ # Windows does not expose POSIX execute bits for an extensionless file.
+ # Keep the rest of the bundle/preservation test active on every platform.
+ if os.name != "nt":
+ self.assertTrue(target.stat().st_mode & 0o111)
original = target.read_bytes()
# A failed universal merge should never destroy an existing good bundle.
argv = ["package_macos_app.py", *map(str, self.package_args(arm, "--amd64", self.macho_header("amd64"), "--force"))]
diff --git a/tests/test_threejs_examples.py b/tests/test_threejs_examples.py
new file mode 100644
index 0000000..dc94d30
--- /dev/null
+++ b/tests/test_threejs_examples.py
@@ -0,0 +1,59 @@
+"""Execute the published scene examples with small renderer/timer test doubles."""
+import json
+import re
+import shutil
+import subprocess
+import unittest
+from pathlib import Path
+
+SKILL = Path(__file__).resolve().parents[1] / "skills/web-engines/threejs-scene-setup/SKILL.md"
+
+
[email protected](shutil.which("node"), "Node.js required to execute JavaScript examples")
+class ThreeExamplesTests(unittest.TestCase):
+ def run_js(self, source):
+ result = subprocess.run(["node", "--input-type=module", "-e", source],
+ capture_output=True, text=True)
+ self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
+
+ def test_loop_bounds_negative_and_stalled_deltas_without_losing_normal_time(self):
+ section = SKILL.read_text(encoding="utf-8").split("### 3.")[1].split("### 4.")[0]
+ snippet = re.search(r"```js\n(.*?)```", section, re.S).group(1)
+ self.run_js('''
+import assert from 'node:assert/strict';
+let delta = 0, callback, updates = 0, renders = 0;
+const THREE = { Timer: class {
+ connect() {} update() { updates++; } getDelta() { return delta; }
+}};
+const document = {}, scene = {}, camera = {};
+const cube = { rotation: { x: 0, y: 0 } };
+const renderer = { setAnimationLoop(fn) { callback = fn; }, render() { renders++; } };
+''' + snippet + '''
+for (const [raw, expected] of [[-0.004, 0], [2, 0.1], [0.016, 0.016], [0, 0]]) {
+ delta = raw;
+ const before = cube.rotation.x;
+ callback(1000);
+ assert.ok(Math.abs(cube.rotation.x - before - expected) < 1e-10,
+ `delta ${raw} advanced by ${cube.rotation.x - before}, expected ${expected}`);
+}
+assert.equal(updates, 4);
+assert.equal(renders, 4);
+''')
+
+ def test_renderer_defaults_bound_hidpi_without_upscaling_low_dpi(self):
+ expressions = re.findall(r"renderer\.setPixelRatio\((.*)\);", SKILL.read_text(encoding="utf-8"))
+ self.assertGreaterEqual(len(expressions), 2)
+ for expression in expressions:
+ with self.subTest(expression=expression):
+ self.run_js('''
+import assert from 'node:assert/strict';
+const expression = ''' + json.dumps(expression) + ''';
+for (const dpr of [0.75, 1, 1.25, 2, 3]) {
+ const value = Function('window', `return (${expression})`)({devicePixelRatio: dpr});
+ assert.ok(value > 0 && value <= Math.min(dpr, 1.5), `unexpected ratio ${value}`);
+}
+''')
+
+
+if __name__ == "__main__":
+ unittest.main()