From 7f0fd45dad1efc9a78fa15f1e65d98fcb4c02bc4 Mon Sep 17 00:00:00 2001 From: ejfn <148174+ejfn@users.noreply.github.com> Date: Sat, 6 Jun 2026 14:47:31 +0930 Subject: [PATCH] Refine boss conservation heuristics to prevent wasting off-suit bosses when they cannot win --- src/ai/llm/llmGamePrompt.ts | 2 +- src/ai/llm/llmPromptTemplates.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ai/llm/llmGamePrompt.ts b/src/ai/llm/llmGamePrompt.ts index 8400639..f86b0b8 100644 --- a/src/ai/llm/llmGamePrompt.ts +++ b/src/ai/llm/llmGamePrompt.ts @@ -226,7 +226,7 @@ function localBuildSeatGuidance(g: { } } else { // Opponent winning, thin trick (§5.4). - bullet = `Only ${g.trickPoints} pts and ${g.oppListStr} still to act — if off-suit, play your boss/highest to win the trick and secure the lead; if trump, duck low and conserve.`; + bullet = `Only ${g.trickPoints} pts and ${g.oppListStr} still to act — if off-suit and you can beat the winner, play your boss/highest to win the trick and secure the lead; if trump or you cannot beat the winner, duck low and conserve.`; } return `- ${bullet}`; diff --git a/src/ai/llm/llmPromptTemplates.ts b/src/ai/llm/llmPromptTemplates.ts index e6c11d6..3c7e0fe 100644 --- a/src/ai/llm/llmPromptTemplates.ts +++ b/src/ai/llm/llmPromptTemplates.ts @@ -26,14 +26,14 @@ Trust the **Rule Score** ordering as your baseline, cashing bosses first and ble - **Absolute Laws**: Follow the led suit/trump group if you hold it. You must match the led combo structure — obey the requirements in **## Suit-Following Analysis** (provided in the prompt below). If you do not hold matching combos (e.g. you hold only singles under a pair lead), follow with singles instead. NEVER split pairs when matching combos are held, and NEVER play or duplicate cards that are not explicitly shown in your hand list — you cannot play a pair or repeat a card's notation unless you hold multiple copies of that card (shown multiple times in your hand/available cards). If a multi-combo is led, match the combo structure and total length. - **Seat Guidance**: Obey the situation-specific bullet under **## Seat Guidance** (provided in the prompt below) as your primary instruction. It dynamically tells you when to duck low, bank points on a safe teammate's trick, ruff/sluff, or conserve your elite cards. - **Ruffing & Sluffing (Void)**: Ruff only to secure a worthwhile trick (≥10 pts) or block opponents. Size your ruff high enough to survive later players' over-ruffs; if you'll be out-ruffed regardless, use a low card to sluff instead of wasting trump. Never ruff over a teammate who is winning safely. -- **Conserve Control**: Hoard high trumps for key wins/blocks. Do NOT conserve off-suit cards; play off-suit bosses/highest cards to win tricks, preventing opponents from escaping points and enabling teammates to contribute points safely. When your teammate is winning safely, play points (5/10/K) freely even if doing so out-ranks your teammate's card. +- **Conserve Control**: Hoard high trumps for key wins/blocks. Play off-suit bosses/highest cards to win tricks, but avoid spending them on tricks you cannot win (e.g. if a trump, or an equal/higher card was played first). Conserve bosses when they cannot win. When your teammate is winning safely, play points (5/10/K) freely. ## 6. Position Cues - **2nd Seat**: Commit early only with a clear boss when points are up. Teammate (4th) can still cover. - **3rd Seat**: Back a strong teammate or block an opponent, but ensure your play survives the 4th seat. Never over-trump your teammate. - **4th Seat**: Perfect information. Win with the cheapest sufficient card if you can. Prefer winning if you hold points that can win or the trick contains points; otherwise dump your lowest non-point. Never conserve off-suit cards. -Conservation: Hoard top trumps for key wins/blocks. Do not conserve off-suit cards; use them to win tricks and secure the lead. +Conservation: Hoard top trumps. Play off-suit bosses to win tricks and secure the lead, but conserve them if they cannot win. `; export interface UserPromptTemplateArgs {