Add dialogue system, critters, NPCs, and new areas to Kingdom#25
Open
jordangarrison wants to merge 6 commits into
Open
Add dialogue system, critters, NPCs, and new areas to Kingdom#25jordangarrison wants to merge 6 commits into
jordangarrison wants to merge 6 commits into
Conversation
…orld Expands the kingdom's shared contracts and game engine toward an Animal Crossing / Stardew Valley feel: - types.ts: 3 new areas (beach, berry-woods, bakery), new tiles (fence, dock, palm, oven, rug...), 4 new items (berry, shell, butterfly, muffin), friendship hearts, fetch-errand quests, ambient critters, data-driven ground-item spawners, save v2 - save.ts: v1 -> v2 migration so existing saves keep their progress - plots.ts: berry bushes that regrow like lavender - KingdomGame.svelte: NPC wander AI, dialogue/quest state machine with rewards and heart gains, butterfly catching, shell collecting, muffin baking, furniture flavor text, sfx, smarter HUD with errand tracker Pixel sprites, dialogue content/panel, new maps and critter simulation land in the follow-up commit. https://claude.ai/code/session_01SHPKH43kQPii8zrCEy251v
- areas.ts: courtyard reworked into a fountain plaza with paths to all 7 doors; dock on the pond; cozier cottage (rug, table, bookshelf); fences and flower accents throughout; three new areas wired in: pond -> Beach Cove (shells, palms, sandcastle), rose garden -> Berry Woods (8 berry bushes, catchable butterflies), courtyard -> Sweet Bakery (oven, counter cafe). Legacy plot ids and coordinates preserved for old saves; module-load integrity assertion guards every map's dimensions. - critters.ts: gentle wandering butterflies, bees, drifting petals, water-skimming dragonflies, and fly-over birds with repopulation, plus butterflyAt() hit-testing for catching. https://claude.ai/code/session_01SHPKH43kQPii8zrCEy251v
Background agents are still finishing the pixel-sprite module, renderer rewrite, and dialogue panel; this snapshot keeps the branch in sync. Final integration commit follows. https://claude.ai/code/session_01SHPKH43kQPii8zrCEy251v
- dialogue.ts: per-NPC voices with first-meeting intros, greeting variants across three friendship tiers, family chatter with gameplay tips, contextual flavor reactions to what the player carries, and 20 fetch-errand quest templates (4 per family member) with thematic rewards. Lines about a family member are filtered when the player is playing as them. - DialoguePanel.svelte: bottom-anchored conversation panel with an animated pixel-sprite portrait, name plate, friendship hearts, 24ms/char typewriter text, page-advance indicators, and tap/click to advance. https://claude.ai/code/session_01SHPKH43kQPii8zrCEy251v
…tion - render.ts/sprites.ts: final art-pass versions (the earlier WIP snapshots captured these mid-edit). - Playtesting found that holding a direction key through the courtyard <-> bakery doors bounced the player back and forth forever: both landings sit in the travel direction of the return door. Clear held movement input on every area transition instead — you now stop in the doorway of each new area, which also gives kids a beat to see where they've arrived. - Persist v1 saves immediately after migrating (one-shot upgrade). - Lint cleanup: fix empty-arrow eslint error, prettier-format the kingdom module including pre-existing TextBubble drift. https://claude.ai/code/session_01SHPKH43kQPii8zrCEy251v
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR significantly expands the Kingdom game with a full dialogue and quest system, ambient critters, NPC wandering AI, and three new explorable areas (beach, berry woods, bakery).
Summary
The Kingdom now features a complete conversation system with character personalities, friendship tracking, and fetch-quest errands. NPCs wander their home areas, critters (butterflies, bees, birds, etc.) animate the world, and players can pick up ground items and complete quests to deepen relationships.
Key Changes
Dialogue & Quests
dialogue.tsmodule with all conversation content: greetings, personality chatter, contextual flavor lines, and quest templatesDialoguePanel.sveltecomponent for rendering conversations with typewriter effect, character portraits, and heart-based friendship displayCharacter Sprites
sprites.tsmodule with pixel-art character rendering (Jane, Isla, Ollie, Mommy, Daddy)Critters & Ambient Life
critters.tsmodule for ambient creatures: butterflies, bees, petals, dragonflies, birdsNPC AI & Wandering
New Areas
Ground Items & Pickups
GroundItemtype replaces the oldWildTulipsystemRendering Improvements
draw()to accept a singleDrawArgsobject for cleaner signaturesType System Expansion
CharacterIdtype for type-safe NPC referencesCritter,GroundItem,GroundSpawnDef,CritterKind,ActiveQuest,FriendshipTileKindwith new terrain and furniture typesSaveStatenow tracks active quests and friendship levels per NPCGame Loop Integration
Notable Implementation Details
Math.random()for pseudo-random but stable selection within a callMAX_HEARTS(5) with persistent storagehttps://claude.ai/code/session_01SHPKH43kQPii8zrCEy251v