WillFlame14 / hanabi-bot

A bot that plays on the hanab.live interface.
GNU General Public License v3.0
16 stars 10 forks source link

Improve valuation heuristics around clue decision making #214

Open flackr opened 6 months ago

flackr commented 6 months ago

Version (PM the bot with /version): v1.3.10 Convention settings: Any Steps to reproduce or replay link: See below Additional information:

There seems to be a general issue of the bot giving clues when it should wait or just not clue. Some cases I have seen,

  1. Cluing direct plays in finesse slots to anyone except the player immediately after should be avoided when that player has a future valuable card on chop. Examples:
  2. It clues plays of things that overlap clued cards in its own hand. While this is sometimes necessary it should check to see if there's someone else who could give that clue before it would be discarded and prefer to play the clued cards it has.

Of course there are counter-examples, e.g. sometimes there are many clues to be given, in which case it should give the ones that likely can't be done more efficiently by others.

I'll add other cases as I play more. In general the bot seems to quickly drive the game down to 0 clues often cluing things that are unnecessary or could be given more efficiently by another player or later on (e.g. when the card is in chop).

elamate commented 6 months ago

You listed 2 problem. 1.Sometimes clueing directly even if can be finessed is good. Giving clue or discard decision happens after early game when often only 1 playclue avaible.So bot need to deciede who discard and who give the clue. I think best way to do it is to valuate your and your teamate hands. Forexample if you have 3 marked cards and your teamates have trash on chop, than stealing a clue is most often better, than discarding a potentialy good card. On the other hand if forexample your teamate have b3 on chop and b1 is already played, you want to save b3 as much as possible so discard is better. I personaly value very high every card that i not see the other copy. So my basic soultion idea is : if you are dda then clue.If all player that can clue that card have trash or card that you see other copy, then you clue, else you discard. Another possible solution is to give value all player cards depending on position, and how important, then compare your hand value, and your chop value always change depens other player discard, or steal clue.

2.I totaly agree, if other player discard instead of giving a playclue the bot can assume his clue card is that playable. Many times bot clue already clued cards, that need to fix it later and because team saving trash, its more likely to discard usefull cards

flackr commented 6 months ago

You listed 2 problem. 1.Sometimes clueing directly even if can be finessed is good. Giving clue or discard decision happens after early game when often only 1 playclue avaible.So bot need to deciede who discard and who give the clue. I think best way to do it is to valuate your and your teamate hands. Forexample if you have 3 marked cards and your teamates have trash on chop, than stealing a clue is most often better, than discarding a potentialy good card. On the other hand if forexample your teamate have b3 on chop and b1 is already played, you want to save b3 as much as possible so discard is better. I personaly value very high every card that i not see the other copy. So my basic soultion idea is : if you are dda then clue.If all player that can clue that card have trash or card that you see other copy, then you clue, else you discard. Another possible solution is to give value all player cards depending on position, and how important, then compare your hand value, and your chop value always change depens other player discard, or steal clue.

I agree you want to take what's on chop into account, but I still think there's a lot of value to saving finesse slot clues in case there are good bluffs / finesses that can be given.

Also, if someone has given a clue past you in the past that you could have given (and that didn't unlock high value clues) it could be treated as a signal that your chop is probably not valuable.

elamate commented 6 months ago

You listed 2 problem. 1.Sometimes clueing directly even if can be finessed is good. Giving clue or discard decision happens after early game when often only 1 playclue avaible.So bot need to deciede who discard and who give the clue. I think best way to do it is to valuate your and your teamate hands. Forexample if you have 3 marked cards and your teamates have trash on chop, than stealing a clue is most often better, than discarding a potentialy good card. On the other hand if forexample your teamate have b3 on chop and b1 is already played, you want to save b3 as much as possible so discard is better. I personaly value very high every card that i not see the other copy. So my basic soultion idea is : if you are dda then clue.If all player that can clue that card have trash or card that you see other copy, then you clue, else you discard. Another possible solution is to give value all player cards depending on position, and how important, then compare your hand value, and your chop value always change depens other player discard, or steal clue.

I agree you want to take what's on chop into account, but I still think there's a lot of value to saving finesse slot clues in case there are good bluffs / finesses that can be given.

Also, if someone has given a clue past you in the past that you could have given (and that didn't unlock high value clues) it could be treated as a signal that your chop is probably not valuable.

So i think its depends on game mode. Agressive discard couse more bdr, so chance to lose game more likely. Its diffenrent story if you play clue starve or play no variant. No variant after early game your efficiency need less than 1 so 1 for 1 is more than enough. Clue starve you need a very good reason to clue 1 for 1 on finesse position.

flackr commented 6 months ago

Sorry, not super familiar with the acronyms, what is BDR? I added an example to the OP of a case where I think it should wait, but would be happy to hear if you disagree.

I think there's no disagreement that we should prioritize the strategy that's most likely to lead to a win. I just think that there are situations where efficiency is more important than being afraid to discard.

elamate commented 6 months ago

BDR- i think Bad Discard Risk. Means discarding a first copy and second copy can be bottom of the deck. So have more chance to lose the game. I see some turnament when bdr is the first factor to decide wich team do better at same score.

flackr commented 6 months ago

Gotcha, so maybe the linked example is not great since the y3 on chop is known duplicated and so of no consequence to be discarded.

Also, if someone has given a clue past you in the past that you could have given (and that didn't unlock high value clues) it could be treated as a signal that your chop is probably not valuable.

As I mentioned above this could be used as a hint that the bot's chop is not valuable to know that it doesn't need to avoid discard.

elamate commented 6 months ago

yeh the example is not that good. Bot1 chop can be g3 forexample and its very loaded, so team dont realy want bot discard and draw more critical. Other hand osric can discard trash 2 times, and after savinge y3 and r4 have also 1 more trash, so team want to osric dicard and maybe team can play clue r4 or y3 later without touching both copy.

flackr commented 6 months ago

Thanks, yeah that makes sense. I updated the original point. I think it'd be good to extend this consideration more generally for clue stealing, to both use it as a signal when other players clue steal the only available clue that the bot's chop is likely not valuable, and make the same consideration when deciding whether to clue steal.

elamate commented 6 months ago

T17 Osric discard with 4 clue card also means flackr hand have some good card. beacuse drawing 5 or black cards. flackr need to consider if he want discard. some situation chop can be even critical beacuse osric se flackr clue r1. Flackr should not discard T18. lets asume osric hand K3 Y3 instead of R3 Y3, so flackr basicly discarding a playable card. flack should clue red 1 as red and let robot make decission if he want to play and finesse p1 later or finesse out now

Later T40 similar situation. Bot dicard and let osric to finesse out? Discarded card can be p3 forexample, so letting osric discard is a good decition.

T20 purple clue wierd, why not clue p2 on flackr hand? Ok can be bot hand

flackr commented 6 months ago

Note to self and others - this is the game for these comments: https://hanab.live/replay/1165899

T17 Osric discard with 4 clue card also means flackr hand have some good card. beacuse drawing 5 or black cards. flackr need to consider if he want discard. some situation chop can be even critical beacuse osric se flackr clue r1. Flackr should not discard T18. lets asume osric hand K3 Y3 instead of R3 Y3, so flackr basicly discarding a playable card. flack should clue red 1 as red and let robot make decission if he want to play and finesse p1 later or finesse out now

Me not cluing was out of a desire to have the bot finesse or bluff me rather than play, but of course I agree I probably should have clued red anyways.

Later T40 similar situation. Bot dicard and let osric to finesse out? Discarded card can be p3 forexample, so letting osric discard is a good decition.

T40 is a double discard avoidance situation since I just discarded a useful card. I'm not sure if the bot understands DDA yet but it should absolutely avoid discarding, even giving a trash clue if needed.

T20 purple clue wierd, why not clue p2 on flackr hand? Ok can be bot hand

The bot absolutely should clue p2 on T20 since it's no worse than the direct clue, if it's a duplicate I can discard it.