mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3419] [MERGED] feat(turn-games): add 8-Ball Pool as the fourth conversation-mode table game #5926
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5926
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3419
Author: @Romuromylus
Created: 7/10/2026
Status: ✅ Merged
Merged: 7/10/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/turn-games-8ball📝 Commits (8)
f2ee9bdfeat(turn-games): add 8-ball pool shared engine (hybrid model: real 2D positions, candidate-shot menu, seeded resolution)da9ddfafeat(turn-games): wire the [eightball] conversation command (parse, advertise, 2-player start)721ea3bfeat(turn-games): 8-ball client — SVG table board, shot menu, setup modal, commands and togglesaffa239fix(turn-games): drain match-win announcement on finished games, gate shot submit on the resolved candidatea73b49dfeat(turn-games): rework 8-ball onto a real 2D physics simulationb2ec362Merge branch 'staging' into feat/turn-games-8balla7943f5Fix turn-game narration leaking model chain-of-thought into chat56eaa9eMerge remote-tracking branch 'origin/staging' into feat/turn-games-8ball📊 Changes
26 files changed (+4205 additions, -12 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+5 -0)📝
packages/client/src/components/chat/ChatSetupWizard.tsx(+1 -0)📝
packages/client/src/components/chat/ConversationInput.tsx(+12 -2)📝
packages/client/src/components/chat/ConversationView.tsx(+12 -2)➕
packages/client/src/components/chat/EightBallBoard.tsx(+833 -0)➕
packages/client/src/components/chat/EightBallSetup.tsx(+202 -0)➕
packages/client/src/hooks/use-eightball.ts(+148 -0)📝
packages/client/src/hooks/use-generate.ts(+7 -0)📝
packages/client/src/lib/slash-commands.ts(+15 -0)➕
packages/client/src/stores/eightball-game.store.ts(+62 -0)📝
packages/server/src/routes/conversation-calls.routes.ts(+2 -0)📝
packages/server/src/services/conversation/character-commands.ts(+16 -0)📝
packages/server/src/services/generation/conversation-command-runtime.ts(+14 -2)📝
packages/server/src/services/generation/turn-game-command-runtime.ts(+40 -0)📝
packages/server/src/services/turn-games/turn-game-bot-runner.service.ts(+28 -6)➕
packages/shared/src/features/turn-games/eightball/engine.manifest.ts(+5 -0)➕
packages/shared/src/features/turn-games/eightball/engine.ts(+1104 -0)➕
packages/shared/src/features/turn-games/eightball/geometry.ts(+501 -0)➕
packages/shared/src/features/turn-games/eightball/physics.ts(+672 -0)...and 6 more files
📄 Description
Linked issue
Closes #3418
Closes #3427
Why this change
What changed
packages/shared/.../eightball/physics.ts): pure, deterministic 2D simulation — swept-circle continuous collision detection inside fixed 1/240s steps (no tunneling at break speeds), equal-mass restitution impulses, cushion bounces, friction, pocket capture with a jaw model (only genuinely pocket-bound balls pass the cushion line inside a pocket mouth; grazers reflect off the jaw; a ball that stops inside the jaws drops). No RNG, no wall clock — rewind/replay reproduces shots exactly.eightball/engine.ts,types.ts,tools.ts): move unionaimed(human: angle + power) /menu(character pick) /place(ball in hand) /next_rack. Characters still choose from the engine-computed candidate menu (pots/banks/safeties with advisory make-% estimates), converted to an aim vector with skill/style-based jitter and executed through the same physics. Rules derive from actual sim events: wrong-ball-first and scratches are fouls → ball in hand (kitchen-restricted after break fouls), slop counts, open table after every break, first legal pot assigns groups, early 8 loses, 8-on-the-break wins (bar rules, documented), 8+scratch loses. Race to 1/3/5, alternating breaks, player-paced racks. The seeded RNG's only remaining consumer is bot aim jitter.EightBallBoard.tsx,eightball-game.store.ts): drag-to-aim with an obstruction-clipped guide line, ghost-ball contact preview, and object-ball deflection tick; vertical power slider; tap-to-place ball-in-hand with kitchen overlay and invalid-spot tinting; every shot animates from server-produced 30Hz frames (the client never simulates;prefers-reduced-motionand hidden tabs snap instantly). Pointer events throughout — touch works.announcerCharacterId/drainAnnouncementshooks poker introduced;[eightball]command family with/8ball(alias/pool), NL launcher, per-chat toggle, setup modal.<think>block) — narration now strips inline reasoning with the same shared extractor the generation pipeline uses, treats an unclosed opening tag (output truncated mid-thought) as all-reasoning so the factual event-summary fallback runs, gets a 300-token budget (was 100/120, routinely exhausted by reasoning alone), and both narration prompts now demand the spoken line only. The bot move call is unaffected (it only consumes tool calls).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Verified on a live deployment of this branch (
a73b49d5), full game session against a character opponent with a character announcer (race to 3):/8ballsetup modal (opponent radio, announcer dropdown, race-to, who-breaks)Not individually re-verified in the browser (covered by the local test suites and by UI identical to the shipped poker/chess patterns): rack end → "Next rack" pacing, match-winner banner, character-initiated
[eightball]invite, explicit light-mode pass (board colors are physical table colors, not theme surfaces).The narration chain-of-thought fix (#3427) is covered by local unit tests (11 cases: closed/unclosed/bracket-style thinking blocks, case-insensitivity, mid-line tag mentions, fallback on all-reasoning output), reproduced against the exact leaked message from the bug report.
Docs and release impact
CHANGELOG entries added under [Unreleased] (game, announcer, command family). No version bump in this PR.
UI evidence (if applicable)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.