JDBumgardner / stone_ground_hearth_battles

Apache License 2.0
20 stars 2 forks source link

Time Thief Stole My Sanity #63

Open DistilledData opened 3 years ago

DistilledData commented 3 years ago

When time thief is used on an opponent, is the discovered cards pulled from the pool? If so, what happens with tokens?

We got the following stack trace while the bot was attempting to use Time Thief on an opponent that had a token in its war party.

Traceback (most recent call last): File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\training\pytorch\worker\single_machine\worker.py", line 48, in play_game host.play_game() File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\host\round_robin_host.py", line 74, in play_game self.play_round() File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\host\round_robin_host.py", line 65, in playround for in self.play_round_generator(): File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\host\round_robin_host.py", line 46, in play_round_generator self._apply_and_record(player_name, action, agent_annotation) File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\host\host.py", line 41, in _apply_and_record action.apply(self.tavern.players[player_name]) File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\agent\actions.py", line 226, in apply player.play_spell(self.index, self.board_target, self.store_target) File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\core\player.py", line 598, in play_spell spell.on_play(BuyPhaseContext(self, self.tavern.randomizer), board_index, store_index) File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\core\spell_pool.py", line 187, in on_play context.owner.draw_discover(lambda card: type(card) in last_opp_warband_types) File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\core\player.py", line 258, in draw_discover discovered_cards.append(self.tavern.randomizer.select_discover_card(discoverables)) File "C:\Users\PycharmProjects\stone_ground_hearth_battles\hearthstone\simulator\core\randomizer.py", line 102, in select_discover_card return self.rand.choice(discoverables) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\random.py", line 347, in choice return seq[self._randbelow(len(seq))] IndexError: list index out of range python-BaseException

ethansaxenian commented 3 years ago

Oh I guess that makes sense, as tokens are not in the pool. I assume you have the option of discovering a token, and I think all non-tokens would be pulled from the pool. I'm not positive however.

jazzcs commented 3 years ago

I'm not sure, but I think Tess makes copies (not from pool) of the previous warparty. So, it might be the same here? Also would be weird to pull from pool for non-tokens when it can't for tokens.

jeremysalwen commented 2 years ago

Also do we know how time thief handles the case of <3 cards in the opponent's warparty? that seems like an easy one to determine just by looking at a single example of this happening, but not sure how to find it.