owned this note
owned this note
Published
Linked with GitHub
# Hat with finesses (for 4p+)
## Introduction
One of the key ideas of [Reactor](/@hanab/reactor) is that we can split up two pieces of information in our [Hat Guessing](https://github.com/hanabi/hanabi.github.io/blob/main/misc/hat-guessing.md) clues: the sum of the slots of the actions and the types of actions. For example. in a 3p game, a reactive color clue calls for 1 play and 1 discard and a reactive number clue calls for 2 plays.
In general, how much information about the types of actions do we need to encode? Without finesses, we just need to encode whether the number of plays is odd or even, because each player's decision is only whether to discard/clue or play which adds 0 or 1 to the total number of plays.
The problem is that with finesses, Bob has to decide the actions of both himself and the player with the one-away card: either they both discard/clue, Bob plays and the other discards/clues, or they both play (adding 0, 1, or 2 to the total number of plays). Adding 0 or 2 have the same effect on the parity (oddness/evenness) of the total, so Bob doesn't know which to decide. Instead of communicating the parity of the number of plays (which is the same as the number [mod](https://en.wikipedia.org/wiki/Modular_arithmetic) 2), we can communicate the number mod 3, that way adding 0 and 2 have different effects on the total.
## Discard slot 4 = lock (4p-specific)
In a 4-player game, if a player has no plays or safe discards, we can assign them a "discard slot 4" instruction. When a player receives such an instruction, they know that it actually means to give a clue (they are basically locked). Unfortunately, this means we have no way of telling slot 4 to discard.
## Discard slot 5 = lock (5p-specific)
In a 5-player game, if a player has no plays or safe discards, we can assign them a "discard slot 5" instruction (in reality, they have no slot 5). This means that all sums of slots are taken mod 5 instead of mod 4.
## Tables
Another nice benefit of splitting clue meanings into two different numbers is that we can use a much easier to remember method for determining what clues mean that Hat Guessing (where you have to consult a document on every turn).
The number of plays equals the number of players away you're cluing:
| person clued | # plays (mod 3) |
| ------------ | --------------- |
| Bob | 1 (or 4) |
| Cathy | 2 |
| Donald | 3 (or 0) |
The sum of slots to play or discard is determined by the type of clue given:
| type of clue | sum of slots (mod 4 in 4p, mod 5 in 5p) |
| -------------------- | --------------------------------------- |
| number not on newest | 1 |
| number on newest | 2 |
| color on newest | 3 |
| color not on newest | 4 |
These types of clues are picked because it's very likely that all four are available in No Variant. The assignment of clue types to numbers here is currently pretty arbitrary, but it could be optimized in the future because certain sums of slots are actually more likely than others. (i.e. newer cards are more likely to be playable or trash)
In a 5-player game, there is also a fake "slot 5", and the sum of slots is added mod 5 instead of mod 4. If the sum of slots is 5, then you give a clue to Emily, and the type of clue determines the number of plays instead of the sum of slots.
| person clued | type of clue | # plays (mod 3) | sum of slots (mod 5) |
| ------------ | -------------------- | --------------- | -------------------- |
| Emily | number not on newest | 1 (or 4) | 5 |
| Emily | number on newest | 2 | 5 |
| Emily | color on newest | 3 (or 0) | 5 |
| Emily | color not on newest | 4 (or 1) | 5 |
## Instruction priority
1. Play leftmost playable
2. Discard leftmost trash / Play one-away (it will be clear which one due to #plays)
3. Lock
## Deciding which one-away card to play into
If there are multiple one-away cards, perhaps even in different player's hands, how can a responding player know which one they're supposed to play into, and therefore which slot they're supposed to play?
Current policy chosen for simplicity: The player playing into the finesse plays the leftmost slot which would work
## Future ideas
- Extend to double finesses by communicating the number of plays mod 4
- Have the undiscardable slot in 4p be slot 2 or 3 so that it moves when a card plays
- Have the undiscardable slot in 4p be a slot that has known trash, a known play, or a known critical when one exists
- Refined one-away targeting policy:
- Target the player who had no trash cards in hand?
- Prefer "prompts" where you're playing a clued card which matches the one-away card?
- Target the closest/furthest away player?
- Players always respond in turn order to promote tempo:
- When Bob already has a play and Cathy has one-away cards, there are three possibilities, depending on the number of plays between the two:
- plays = 0: Bob will play the already-gotten card and note down a discard for later. Cathy will note down a discard
- In this situation, despite Bob being the first one who could have responded to the clue, Cathy could still be the First Responder in the sense that Alice could instruct her to discard anything she wanted.
- plays = 1: Bob will play the already-gotten card and note down a discard for later. Cathy will play a card on top of Bob's already-gotten card
- This is the reverse of the normal configuration, where Bob would assume that Cathy is discarding
- plays = 2: Bob will play a new card and Cathy will play a card on top of it
## Appendix
### Combined tables (for resemblance to traditional hat)
4-player:
| person clued | # plays (mod 3) | type of clue | sum of slots (mod 4) |
| ------------ | --------------- | -------------------- | -------------------- |
| Bob | 1 | number not on newest | 1 (5) |
| Bob | 1 | number on newest | 2 (6) |
| Bob | 1 | color on newest | 3 (7) |
| Bob | 1 | color not on newest | 4 (8) |
| Cathy | 2 | number not on newest | 1 (5) |
| Cathy | 2 | number on newest | 2 (6) |
| Cathy | 2 | color on newest | 3 (7) |
| Cathy | 2 | color not on newest | 4 (8) |
| Donald | 3 (0) | number not on newest | 1 (5) |
| Donald | 3 (0) | number on newest | 2 (6) |
| Donald | 3 (0) | color on newest | 3 (7) |
| Donald | 3 (0) | color not on newest | 4 (8) |
5-player:
| person clued | # plays (mod 3) | type of clue | sum of slots (mod 5) |
| ------------ | --------------- | -------------------- | -------------------- |
| Bob | 1 (4) | number not on newest | 1 (6) |
| Bob | 1 (4) | number on newest | 2 (7) |
| Bob | 1 (4) | color on newest | 3 (8) |
| Bob | 1 (4) | color not on newest | 4 (9) |
| Cathy | 2 | number not on newest | 1 (6) |
| Cathy | 2 | number on newest | 2 (7) |
| Cathy | 2 | color on newest | 3 (8) |
| Cathy | 2 | color not on newest | 4 (9) |
| Donald | 3 (0) | number not on newest | 1 (6) |
| Donald | 3 (0) | number on newest | 2 (7) |
| Donald | 3 (0) | color on newest | 3 (8) |
| Donald | 3 (0) | color not on newest | 4 (9) |
| Emily | 1 (4) | number not on newest | 5 (10) |
| Emily | 2 | number on newest | 5 (10) |
| Emily | 3 (0) | color on newest | 5 (10) |
| Emily | 4 (1) | color not on newest | 5 (10) |
### Replays
First 5 wins are in! (Plus 13 0s :P)
- [4p No Variant](https://hanab.live/replay/910328)
- [4p No Variant](https://hanab.live/replay/910228)
- [4p No Variant](https://hanab.live/replay/910220)
- [4p No Variant](https://hanab.live/replay/910196)
- [5p No Variant](https://hanab.live/replay/910164)
- [5p No Variant](https://hanab.live/replay/910069)
- Explanation TODO
### Hypotheticals
Here is a hypothetical game created before having played the system:
- [5p No Variant](https://hanab.live/shared-replay-json/515tvamnpihkdcarbdaf-wgqsqiwucklgpbsuymlx-ffropuxhejnkv,03tbaf-aiapaqgcbgbvanatlbay-azamgcaba2obaoa1adah-wbawaxa5aAala7ldaaae-bFbGkdbHaEaJaK,0)
- Turn 1: 4 plays. 3 + 4 + 1 + 4 = 12 = 2 mod 5
- Turn 6: 2 plays. 3 + 1 + 3 + 2 = 9 = 4 mod 5
- Turn 8: Cathy has a known trash and chooses to discard and let Alice give a clue
- Turn 10: Emily could give a clue but chooses to play and let Alice give a clue
- Turn 11: 4 plays. 1 + 1 + 4 + 1 = 7 = 2 mod 5
- Turn 15: 3 plays. 3 + 1 + 1 + 4 = 9 = 4 mod 5
- Turn 18: Finally a finesse! Donald and Emily already have r4 and g2 to play, so they will respond after Alice and Bob. Cathy wants to give a finesse on Bob's y3 and Donald's y4. There will be no ambiguity on Bob's turn as to which one-away card he is playing into because y4 is the only one, so the finesse will definitely work. Cathy clues 4 plays. 2 + 3 + 3 + 2 = 10 = 5 mod 5
- Turn 23: Donald and Emily already have y4 and p3 to play, so they will respond after Alice and Bob. Cathy wants to give a finesse on Bob's p4 and Donald's p5. There will again be no ambiguity. Cathy clues 3 plays. 2 + 1 + 1 + 1 = 5 = 5 mod 5
- Turn 28: Cathy might as well try to play a r5 instead of discarding
- Turn 30: 2 plays. 4 + 4 + 1 + 1 = 10 = 5 mod 5
- Turn 35: 3 plays. 1 + 2 + 1 + 1 = 5 = 5 mod 5
## Puzzles
What turn 1 clues can Alice give to maximize plays and prevent BDRs?
- [(A)](https://hanab.live/shared-replay-json/415jkgtnjpi0da3hbyqc-rgrblfdaokxzavpmcwih-qknpsmsffe12l,04o,1-472)
:::spoiler Analysis
[will add once discord conversation is quiet]
:::
---
- [(B)](https://hanab.live/shared-replay-json/415jkgtpuniad03hbyqc-rgrblfdaokxzavpmcwih-qknpsmsffe12l,04o,1-472)
:::spoiler Analysis
[will add once discord conversation is quiet]
:::
---