Smarter AI: card knowledge tracking and strategic play priorities#40
Smarter AI: card knowledge tracking and strategic play priorities#40
Conversation
Co-authored-by: Chrizpy <38702971+Chrizpy@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
royalletters | c4c7ad0 | Commit Preview URL Branch Preview URL |
Mar 06 2026, 08:00 PM |
…scape Co-authored-by: Chrizpy <38702971+Chrizpy@users.noreply.github.com>
|
I saw an AI prince their handmade because it was known, that's a bit unnecassary I just really want the AI try to make the best decisions it can do, based on the rules of the game, the knowledge that is presented and so on. Just like a human would have played |
…lue exposed cards Co-authored-by: Chrizpy <38702971+Chrizpy@users.noreply.github.com>
Fixed in c4c7ad0. The AI now behaves more like a human player in two ways:
|
Bots were predictable and tactically naive — they ignored Priest-revealed card information, never reacted to being exposed, and always played the lowest-value card regardless of context.
Knowledge tracking
Two optional fields added to
PlayerState:knownCards: Record<string, string>— cards seen via Priest (opponentId → cardId)exposedToPlayerIds: string[]— who currently knows this player's cardThese are populated in the Priest effect and cleared whenever a card changes hands (Prince force-discard, King swap), and reset each round.
Strategic play priorities (
chooseCardToPlay/chooseTarget)AI now evaluates moves in priority order rather than defaulting to lowest-value:
Smarter Chancellor return
When the AI has card knowledge, it prefers to keep Guard (for a certain kill next turn) over keeping the raw highest-value card.
Guard/revenge guess
chooseGuardGuessnow returns the known card directly when Priest knowledge is available, rather than using probability weights.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.