# AI use cases for H3 Game Sprites (gary149/h3-game-sprites)

Repo: [gary149/h3-game-sprites](https://github.com/gary149/h3-game-sprites) | Use cases: 3 | Page: https://dedupedai.com/use-cases/gary149-h3-game-sprites/

An Agent Skill and Python scripts that turn AI-generated video into 2D game sprite sheets, with chroma keying, keyframe selection, walk-cycle detection and atlas packing.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Cut a generated move clip into keyed sprite frames: https://dedupedai.com/use-cases/gary149-h3-game-sprites/cut-move-clip-into-sprite-frames/
- Build a seamless walk cycle from a generated clip: https://dedupedai.com/use-cases/gary149-h3-game-sprites/build-seamless-walk-cycle/
- Pack a character's moves into one engine-ready atlas: https://dedupedai.com/use-cases/gary149-h3-game-sprites/pack-character-moves-into-atlas/

## How to cut a generated move clip into keyed sprite frames with H3 Game Sprites

Repo: [gary149/h3-game-sprites](https://github.com/gary149/h3-game-sprites) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Turn one AI-generated punch or kick clip into transparent, keyed sprite frames you can check.

**Who it is for:** A solo indie game developer with a 2D fighter or action character who has one generated move clip and needs usable frames for the engine.

**The problem:** A raw video clip has a flat magenta backdrop, dozens of near-identical frames and no transparency, so it cannot go into a game as is.

**The outcome:** A folder of keyed frames with a strip, a GIF and a metrics report showing key purity and how closely the move returns to its starting pose.

### Steps

1. Generate the character still on a flat magenta backdrop in side view, then generate the move clip with the first and last frame set to the same idle still (the idle pin).
2. Save the clip as clips/punch.mp4.
3. Run `python3 scripts/sprite_cut.py clips/punch.mp4 sprites/punch --frames 12`.
4. Open the strip, the GIF and the metrics report in sprites/punch and check key purity per frame and the return-to-start figure.
5. If the pose extremes look wrong, change the --frames value and run the same command again.

### Prompt to paste into your agent

```text
Using the h3-game-sprites repo, cut the move clip at <path to clip.mp4> into 12 keyed frames with scripts/sprite_cut.py, writing to sprites/<move-name>. Report the output folder contents and the key purity and return-to-start numbers from the metrics report, and confirm the first and last frames match the idle still.
```

### Caveat

The README gives the chroma-key and clip recipe but does not promise that any generated clip will return cleanly to idle, so check the metrics report before trusting a move.

Risk, credentials: If you use the bundled gen_still.py for the character still, it reads OPENROUTER_API_KEY, so keep that key in your environment and out of the repo and your commits.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/gary149-h3-game-sprites/cut-move-clip-into-sprite-frames/

## How to build a seamless walk cycle from a generated clip with H3 Game Sprites

Repo: [gary149/h3-game-sprites](https://github.com/gary149/h3-game-sprites) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Get a walk loop that resets cleanly instead of visibly jumping back to a start pose.

**Who it is for:** A 2D game developer whose character needs a walk animation for a side-scrolling or top-down level, and whose generated walk clip looks like it resets at the loop point.

**The problem:** Whole-clip keyframes include the start-up and the settle back to idle, so a naive loop snaps back to the start of the walk.

**The outcome:** A set of walk frames chosen to form a seamless cycle, with a strip and GIF to review before import.

### Steps

1. Generate a walk clip in place, using the in-place (treadmill) walk phrasing so the engine controls movement.
2. Save it as clips/walk.mp4.
3. Run `python3 scripts/sprite_cut.py clips/walk.mp4 sprites/walk --frames 8 --loop`. (inferred, check the README)
4. Open sprites/walk and check that the last frame flows into the first with no visible reset.
5. Compare the metrics report feet drift figure against your engine's expected movement speed.

### Prompt to paste into your agent

```text
Using the h3-game-sprites repo, run scripts/sprite_cut.py with --loop on <path to walk.mp4> and 8 frames, writing to sprites/walk. Report which frames were selected and whether the cycle is seamless, citing the metrics report.
```

### Caveat

The README says the loop option finds a seamless cycle, but the result still needs a visual check in the GIF because the metrics alone may not catch every visible reset.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/gary149-h3-game-sprites/build-seamless-walk-cycle/

## How to pack a character's moves into one engine-ready atlas with H3 Game Sprites

Repo: [gary149/h3-game-sprites](https://github.com/gary149/h3-game-sprites) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Combine idle, walk and attack frames into one atlas at a single global scale with shared anchors.

**Who it is for:** A developer building a 2D fighter or action game who has several cut move folders and needs one atlas with consistent scale so characters stand on the floor.

**The problem:** Per-frame scaling and mismatched anchors make a character jump in size or sink through the ground when drawn in the engine.

**The outcome:** An atlas.json describing all moves with one global scale and shared ankle-based anchors, ready for drawImage in the engine.

### Steps

1. Cut each move clip into its own folder under sprites/ with scripts/sprite_cut.py, for example sprites/idle, sprites/walk and sprites/punch.
2. Run `python3 scripts/build_atlas.py sprites/ atlas.json --moves idle,walk,punch --ref idle`.
3. Open atlas.json and confirm the moves listed match the folders you cut.
4. Render a test frame in your engine and measure the on-screen height and floor contact, as the README advises, rather than trusting metadata alone.

### Prompt to paste into your agent

```text
Using the h3-game-sprites repo, build an atlas from the cut move folders in <sprites directory> using scripts/build_atlas.py with --ref idle, writing atlas.json. Report the moves included and the global scale, and confirm that one rendered test frame stands on the floor.
```

### Caveat

The README explains the drawImage offset math but does not give engine-specific code, so the floor check has to be done in your own engine.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/gary149-h3-game-sprites/pack-character-moves-into-atlas/
