Skip to content

feat(web): bake and wire LPC skins for all 12 council NPCs - #18

Merged
moyunzero merged 2 commits into
mainfrom
feat/npc-lpc-all-council
Jul 14, 2026
Merged

feat(web): bake and wire LPC skins for all 12 council NPCs#18
moyunzero merged 2 commits into
mainfrom
feat/npc-lpc-all-council

Conversation

@moyunzero

@moyunzero moyunzero commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bake LPC walk/idle atlases from npc-asset for player-1 + npc-1npc-12 (pnpm assets:sync:lpc-npcs)
  • Wire Phaser runtime so all council seats use dedicated LPC sheets instead of Stardew npcs.png fallback
  • Update Guardrail #106 / BEGINNING-FIELDS / CREDITS for the full-council LPC decision; Object Shadows depth banding for map layers

Test plan

  • pnpm assets:sync:lpc-npcs → 13× 704×256 atlases
  • pnpm --filter @aetherlife/web test (pre-push)
  • worker pytest (pre-push)
  • Manual: pnpm dev:stack → hard refresh → confirm npc-1…12 skins on map
  • Optional before merge: pnpm verify:phase6:move-only + pnpm verify:phase13

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Expanded LPC character visuals to all players and council NPCs npc-1 through npc-12.
    • Added support for loading and animating dedicated player and NPC sprite sheets.
    • Improved map shadow rendering with dedicated layering, multiply blending, and consistent depth ordering.
  • Documentation

    • Updated visual, asset, rendering, and release documentation to reflect the expanded LPC coverage and asset workflow.
  • Tests

    • Added coverage for LPC profile routing, animation loops, and map depth ordering.

Extend the LPC bake pipeline and runtime mapping so player + npc-1…12 use dedicated walk/idle atlases instead of Stardew fallbacks for council seats.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@moyunzero, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 531579e1-7d83-4ca4-ba75-828a3e23445a

📥 Commits

Reviewing files that changed from the base of the PR and between 182238c and 7d8a156.

📒 Files selected for processing (1)
  • docs/DEVELOPMENT-HISTORY.zh-CN.md
📝 Walkthrough

Walkthrough

The PR expands LPC sprite assets to all players and council NPCs npc-1 through npc-12, adds profile-based animation handling, introduces multi-target asset baking, and changes map shadow rendering to use dedicated depth and blending behavior.

Changes

LPC visuals and map rendering

Layer / File(s) Summary
LPC asset baking and loading
package.json, scripts/..., apps/web/src/game/assetManifest.ts, apps/web/src/game/RoomScene.ts, apps/web/public/assets/CREDITS.md, apps/web/AGENTS.md
The asset command now bakes player and twelve NPC LPC atlases, registers them in the manifest, and requires the player texture before enabling sprite entities.
Profile-driven LPC sprite runtime
apps/web/src/game/lpcNpc1Sheet.ts, apps/web/src/game/entitySprites.ts, apps/web/src/game/lpcNpc1Sheet.test.ts, AGENTS.md, docs/DEVELOPMENT-HISTORY*, docs/ISSUE-LOG.md
LPC profiles, textures, frame ranges, animation keys, sprite creation, facing, and walk/idle playback now support the player and npc-1 through npc-12, with updated tests and contracts.
Map tile and shadow depth handling
apps/web/src/game/HomeMapBackground.ts, apps/web/src/game/entityLayout.ts, apps/web/src/game/entityLayout.test.ts, docs/BEGINNING-FIELDS.md, docs/DEVELOPMENT-HISTORY*, docs/ISSUE-LOG.md
Tile depth bands use shared constants, and Object Shadows render in a dedicated multiply-blended layer with sequential depths outside normal Y-sorting.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AssetCommand
  participant BakeScript
  participant AssetFiles
  participant AssetManifest
  participant RoomScene
  AssetCommand->>BakeScript: run assets:sync:lpc-npcs
  BakeScript->>AssetFiles: read player-1 and npc-1 through npc-12 sources
  BakeScript->>AssetFiles: write generated LPC atlases
  AssetManifest->>AssetFiles: register LPC spritesheets
  RoomScene->>AssetManifest: verify LPC textures
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.79% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: baking and wiring LPC skins for the council NPCs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/npc-lpc-all-council

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/web/src/game/lpcNpc1Sheet.ts (1)

36-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Naming drift: generic-profile functions still carry the Npc1-specific name.

lpcNpc1WalkCycleMs/lpcNpc1WalkLoopFrameRange (and the unchanged lpcNpc1FrameIndex/lpcNpc1NameplateY) now accept/default an arbitrary LpcNpcSpriteProfile and are invoked for every profile — including the player — from entitySprites.ts (e.g. registerLpcNpcAnimsForProfile, createLpcNpcSprite). Meanwhile lpcNpcAnimKey/registerLpcNpcAnims were properly generalized. The remaining Npc1-prefixed names are now misleading about scope.

Consider renaming to generic names (e.g. lpcWalkCycleMs, lpcWalkLoopFrameRange, lpcFrameIndex, lpcNameplateY) with thin @deprecated Npc1-named wrappers, mirroring the pattern already used for lpcNpcAnimKey/lpcNpc1AnimKey.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/game/lpcNpc1Sheet.ts` around lines 36 - 56, Rename the
profile-agnostic helpers lpcNpc1WalkCycleMs, lpcNpc1WalkLoopFrameRange,
lpcNpc1FrameIndex, and lpcNpc1NameplateY to generic names such as
lpcWalkCycleMs, lpcWalkLoopFrameRange, lpcFrameIndex, and lpcNameplateY, and
update all callers including entitySprites.ts. Retain thin `@deprecated`
Npc1-prefixed wrappers for compatibility, following the existing
lpcNpcAnimKey/lpcNpc1AnimKey pattern.
apps/web/src/game/assetManifest.ts (1)

97-110: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider reusing LPC_COUNCIL_NPC_IDS to avoid hardcoding the NPC indices array.

You can replace the inline array with the exported constant LPC_COUNCIL_NPC_IDS from lpcNpc1Sheet.ts to keep the council IDs defined in a single source of truth.

♻️ Proposed refactor

First, add the import at the top of the file:

+import { LPC_COUNCIL_NPC_IDS } from "./lpcNpc1Sheet";

Then replace the inline array:

-  ...([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] as const).map(
+  ...LPC_COUNCIL_NPC_IDS.map(
     (n): AssetSheetDef => ({
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/game/assetManifest.ts` around lines 97 - 110, Update the NPC
spritesheet mapping in the asset manifest to iterate over the exported
LPC_COUNCIL_NPC_IDS constant from lpcNpc1Sheet.ts instead of the inline numeric
array, adding the necessary import while preserving the existing key and URL
generation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/DEVELOPMENT-HISTORY.zh-CN.md`:
- Line 858: Update the zh-CN Phase 26.1 交付物 entry in
DEVELOPMENT-HISTORY.zh-CN.md to include the missing entitySprites LPC path
deliverable, matching the corresponding English entry while preserving the
existing listed assets and files.

---

Nitpick comments:
In `@apps/web/src/game/assetManifest.ts`:
- Around line 97-110: Update the NPC spritesheet mapping in the asset manifest
to iterate over the exported LPC_COUNCIL_NPC_IDS constant from lpcNpc1Sheet.ts
instead of the inline numeric array, adding the necessary import while
preserving the existing key and URL generation.

In `@apps/web/src/game/lpcNpc1Sheet.ts`:
- Around line 36-56: Rename the profile-agnostic helpers lpcNpc1WalkCycleMs,
lpcNpc1WalkLoopFrameRange, lpcNpc1FrameIndex, and lpcNpc1NameplateY to generic
names such as lpcWalkCycleMs, lpcWalkLoopFrameRange, lpcFrameIndex, and
lpcNameplateY, and update all callers including entitySprites.ts. Retain thin
`@deprecated` Npc1-prefixed wrappers for compatibility, following the existing
lpcNpcAnimKey/lpcNpc1AnimKey pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31c9667b-64d3-4a50-91db-b8d24bdf84b2

📥 Commits

Reviewing files that changed from the base of the PR and between 4216be8 and 182238c.

⛔ Files ignored due to path filters (12)
  • apps/web/public/assets/sprites/lpc-npc-10.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-11.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-12.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-2.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-3.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-4.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-5.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-6.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-7.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-8.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-npc-9.png is excluded by !**/*.png
  • apps/web/public/assets/sprites/lpc-player-1.png is excluded by !**/*.png
📒 Files selected for processing (17)
  • AGENTS.md
  • apps/web/AGENTS.md
  • apps/web/public/assets/CREDITS.md
  • apps/web/src/game/HomeMapBackground.ts
  • apps/web/src/game/RoomScene.ts
  • apps/web/src/game/assetManifest.ts
  • apps/web/src/game/entityLayout.test.ts
  • apps/web/src/game/entityLayout.ts
  • apps/web/src/game/entitySprites.ts
  • apps/web/src/game/lpcNpc1Sheet.test.ts
  • apps/web/src/game/lpcNpc1Sheet.ts
  • docs/BEGINNING-FIELDS.md
  • docs/DEVELOPMENT-HISTORY.md
  • docs/DEVELOPMENT-HISTORY.zh-CN.md
  • docs/ISSUE-LOG.md
  • package.json
  • scripts/sync-npc-lpc-assets.mjs

Comment thread docs/DEVELOPMENT-HISTORY.zh-CN.md Outdated
Include entitySprites LPC path so bilingual DEVELOPMENT-HISTORY entries match.

Co-authored-by: Cursor <cursoragent@cursor.com>
@moyunzero
moyunzero merged commit 27a5089 into main Jul 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant