feat: Social Deduction Game demo#36
Conversation
Add the supporting files for the Undercover/Spy Words social deduction game demo: Ollama config, description-phase prompt template, and README with hypothesis, game mechanics, and setup instructions.
Implement the full Undercover/Spy Words social deduction game with: - Circle layout for N players (4-8), one randomly assigned as spy - Description phase using llm:chat-with-template for word clues - Voting phase using llm:choose for constrained spy identification - Elimination with tie-breaking, win condition checks - 15 word pairs across 3 difficulty tiers - Cumulative stats tracking across games (detection rate, wins) - Vote plot and detection rate plot - Word leak protection and LLM error fallbacks
- Add disableUntilTicks to buttons (required attribute) - Add fontSize to monitors (required attribute) - Fix plot attributes to camelCase (xMin/xMax/yMin/yMax/autoPlotX/autoPlotY) - Fix llm:chat-with-template to use nested [key value] pairs - Use llama3.2:3b model name in config
… indicator - Fix player visibility: radius 10, -90° offset (12 o'clock start), size 4.0 - Distinct player colors: 8-color palette with base-color variable - Dark noir background: charcoal gradient + dark red circular table - Vote arrows: directed links from voter to target in voter's color - Center phase indicator: shows round, phase, elimination, and win state - Spy reveal: size 5.0, bright red, all words shown on reveal - Eliminated players: muted color (base-color - 4) instead of gray - Correct link shape XML for NetLogo 7.0.3 format
- Add vote-template.yaml with system/template structure matching description template - Replace inline vote prompt with llm:chat-with-template call - Validate LLM response against alive player names, fallback to llm:choose - Update Votes Per Round plot to use per-player base-color instead of red/sky - Update info tab to reflect template-based voting
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 151d8268de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <button x="120" y="10" width="100" height="40" | ||
| disableUntilTicks="false" kind="Observer" display="Go" forever="true">go</button> | ||
| <button x="10" y="60" width="100" height="40" | ||
| disableUntilTicks="false" kind="Observer" display="Step" forever="false">step-round</button> |
There was a problem hiding this comment.
Disable Go/Step until setup initializes game state
On a freshly opened model, these buttons are clickable before setup runs. go/step-round immediately test game-over? and llm-config-loaded?, but those globals are only initialized in setup, so NetLogo will evaluate their default numeric values instead of booleans and throw. This makes the demo fail on a very common first interaction: clicking Go or Step before Setup.
Useful? React with 👍 / 👎.
| ] | ||
|
|
||
| ;; Word leak check: if description contains the actual word, replace | ||
| if member? my-word desc [ |
There was a problem hiding this comment.
Match leaked secret words by token, not substring
member? on strings is a substring check, so this censors valid descriptions whenever the secret word appears inside another word. For example, the tea player saying steam rises from it would be replaced with the generic fallback even though no leak occurred. That systematically degrades some word pairs and changes vote outcomes for reasons unrelated to the agents' reasoning.
Useful? React with 👍 / 👎.
Description template:
- Demand distinguishing clues: "something TRUE about your word that would NOT be true for a similar word"
- Ban vague phrases and "I notice" narration style
- Add good vs bad clue examples for calibration
- Enforce one sentence under 20 words
Vote template:
- Add explicit self-vote prevention: "You CANNOT vote for {player_name}"
- Reinforce constraint in both system prompt and template
- Guide analytical comparison of clues
Voting code:
- Separate template vote and llm:choose fallback into independent carefully blocks
- Prevent cascading errors when template returns self-vote
- Rewrite description template: demand indirect associations, ban obvious properties
- Add good/bad clue examples for calibration
- Explicitly label transcript as "DO NOT repeat any of these"
- Ban common openings ("Best enjoyed", "Often enjoyed")
- Bump temperature to 0.8 in config for more diverse outputs
Summary
llm:chat-with-template, vote to eliminate via template +llm:choosefallbackFiles added
demos/social-deduction-game/social-deduction-game.nlogox— game modeldemos/social-deduction-game/config.txt— LLM provider configdemos/social-deduction-game/description-template.yaml— description phase promptdemos/social-deduction-game/vote-template.yaml— voting phase promptdemos/social-deduction-game/README.md— setup and usage docsTest plan