WillFlame14 / hanabi-bot

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

bot crash #228

Closed elamate closed 1 month ago

elamate commented 4 months ago

Version (PM the bot with /version): v1.4.2 Convention settings:/setall 11 Steps to reproduce or replay link:https://hanab.live/shared-replay/1169028#4 *Additional information: Bot crash after 3 clue. The 2 clue later means its a double bluff 2 connect 1 so its a finesse but elamate see both p2 so its a bluff but for other bot its probably very confusing 3 clue is just a finesse but bot21 crash:

focus possible: [ 'r2', 'p2' ] symmetric connections [ '[3 r1 playable (will-bot22) -> r2?]', '[1 b1 playable (will-bot22) -> b2?]' ] adding play link with orders [ 3, 1 ] prereq b1 connected r2 final inference on focused card r2,b2,p2 checking tccm: old score [ 0, 2, 0, 0, 1 ] Set(2) { 3, 4 } new score [ 1, 2, 0, 0, 1 ] Set(2) { 1, 4 } target was locked, not tccm ------- EXITING HYPO -------- result, {"clue":"(2 to elamate90)","bad_touch":0,"trash":0,"interpret":["r2","b2","p2"],"elim":0,"new_touched":0,"finesses":1,"playables":["b1 (will-bot22)"],"chop_moved":[],"remainder":0} 1 invalid play clue (3 to elamate90) has incorrect interpretation, (card g3 16 lost all inferences and was reset) file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:199 throw new Error(Attempted to rewind ${JSON.stringify(rewind_action)} that was already rewinded!); ^

Error: Attempted to rewind {"type":"identify","order":7,"playerIndex":1,"suitIndex":0,"rank":2} that was already rewinded! at HGroup.rewind (file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:199:10) at HGroup.interpret_clue (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/clue-interpretation/interpret-clue.js:167:9) at file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:339:14 at Logger.wrapLevel (file:///home/elamate/hanabi-willbot/hanabi-bot/src/tools/logger.js:27:3) at HGroup.simulate_clue (file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:338:10) at evaluate_clue (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/clue-finder/determine-clue.js:34:25) at find_clues (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/clue-finder/clue-finder.js:123:22) at HGroup.take_action (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/take-action.js:141:61) at Timeout._onTimeout (file:///home/elamate/hanabi-willbot/hanabi-bot/src/action-handler.js:115:52) at listOnTimeout (node:internal/timers:573:17)

elamate commented 4 months ago

I just crashed again: https://hanab.live/shared-replay/1169157#15

------- EXITING HYPO -------- result, {"clue":"(green to will-bot21)","bad_touch":1,"trash":0,"interpret":["g2"],"elim":0,"new_touched":2,"finesses":0,"playables":["g2 (will-bot21)"],"chop_moved":[],"remainder":0} 0.15999999999999986 found play clues [ '(4 to will-bot22)', '(red to will-bot22)', '(2 to will-bot21)', '(green to will-bot21)' ] playable cards [ { visible: 'unknown', order: 19, flags: [ 'clued' ], possible: [ 'r1', 'y1', 'g1', 'b1', 'p1' ], inferred: [ 'p1' ], reasoning: [ 13 ] } ] discards [ { visible: 'unknown', order: 19, flags: [ 'clued' ], possible: [ 'r1', 'y1', 'g1', 'b1', 'p1' ], inferred: [ 'p1' ], reasoning: [ 13 ] } ] best playable card is order 19, inferences p1 ------- FINDING CLUES ------- (1 to elamate90) has incorrect interpretation, (card y1 1 lost all inferences and was reset) (yellow to elamate90) has incorrect interpretation, (card y1 1 lost all inferences and was reset) file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:199 throw new Error(Attempted to rewind ${JSON.stringify(rewind_action)} that was already rewinded!); ^

Error: Attempted to rewind {"type":"identify","order":5,"playerIndex":1,"suitIndex":4,"rank":1} that was already rewinded! at HGroup.rewind (file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:199:10) at HGroup.interpret_clue (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/clue-interpretation/interpret-clue.js:167:9) at file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:339:14 at Logger.wrapLevel (file:///home/elamate/hanabi-willbot/hanabi-bot/src/tools/logger.js:27:3) at HGroup.simulate_clue (file:///home/elamate/hanabi-willbot/hanabi-bot/src/basics/Game.js:338:10) at evaluate_clue (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/clue-finder/determine-clue.js:34:25) at find_clues (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/clue-finder/clue-finder.js:123:22) at HGroup.take_action (file:///home/elamate/hanabi-willbot/hanabi-bot/src/conventions/h-group/take-action.js:141:61) at Timeout._onTimeout (file:///home/elamate/hanabi-willbot/hanabi-bot/src/action-handler.js:115:52) at listOnTimeout (node:internal/timers:573:17)

WillFlame14 commented 4 months ago

The first replay no longer crashes after 8ab0856, but the 2 clue given by bot22 should probably be illegal (both bot20 and bot21 try to play r1 into it).

The second replay crashed since the bot disallowed using cards as elim targets when they became part of a waiting connection, even when they were fully known. It'll be fixed in the next update.

WillFlame14 commented 1 month ago

bot22 no longer suggests giving 2 on turn 1 as of cd94a0b, preferring giving green to bot21 instead.