Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quackle sometimes making obviously bad plays when alternative bag with more blanks is used #108

Open
jimsemantic opened this issue Jan 8, 2020 · 4 comments
Assignees
Labels

Comments

@jimsemantic
Copy link

jimsemantic commented Jan 8, 2020

I added an additional quackle_alphabet file which differs from the standard english bag by adding 8 blanks and removing AEEIONRT (thus maintaining 100 total tiles) and have been running thousands of selfplay games at 20-Second-Championship-Player level, CSW19, v1.0.4.1. Glancing at a few of the game reports, I noticed a game that really stands out for bad play. .report file as .txt is attached here.

The problem: notice that when Player A has 3 or more blanks on its rack it keeps making dinky plays, using only the non-blank tiles on its rack, only finally bingoing in the endgame when it will have no more chances to play.

Looking at .report files from several other games where 3+ blanks are accumulated simultaneously by a player, this bad behavior is consistent.

Twenty_Second_Championship_Player-game-496.txt

@jimsemantic
Copy link
Author

jimsemantic commented Jan 8, 2020

Looking at the .report file more closely, it looks like the move generator for Static Player will use up to 2 blanks but no more, except at the end when it will finally acknowledge all the blanks available.

@jimsemantic
Copy link
Author

jimsemantic commented Jan 9, 2020

After diving into the code, it looks to me like the problem is in ScorePlusLeaveEvaluator::leaveValue(), where the bogowin player, when it calculates move equity, which is taking into account leave value, is usually calculating that it's best to leave those 3+ juicy blanks for a future turn, because each blank is valued enough (21.7777) so that 3 or more of them outweigh the 50-point bingo bonus when using all of them on the current turn. So all of the bingo move options for the current turn are getting valued lower and not making the best or even best 10 list. Thus, a bingo never gets played with the 3+ blanks until the preendgame or endgame, when different players take over from bogowin.

Simply reducing the value of a blank won't work, since it has to be done in relation to the values of all of the letters and in relation to the fixed bonus of 50. Also, I assume the values in the worths file were generated empirically somehow. Perhaps adding special logic for 3+ blanks will work.

@jfultz
Copy link
Member

jfultz commented Jan 13, 2020

Haven't confirmed your analysis yet, but it seems quite plausible. Just coincidentally, I was last week looking at the equity code and I noticed that the leave value is floored at -40 (in ScorePlusLeaveEvaluator::leaveValue), but there's no ceiling on it. There certainly should be...have to think about whether that ceiling is conditional (and if so, what the conditions are), but I think that would resolve your problem.

@jfultz jfultz self-assigned this Jan 13, 2020
@jfultz jfultz added the bug label Jan 13, 2020
@Rascalitos
Copy link

I can see the same issue.

To reproduce it, take a bag with a blanks. Generate all moves and start a simulation.
Quackle will play suspicious moves, and tries to always keep the blanks in its bag. Sometimes until the end of the game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants