botbowl icon indicating copy to clipboard operation
botbowl copied to clipboard

Reroll procedure should not depend on game.actor.human

Open mrbermell opened this issue 2 years ago • 0 comments

(as raised by user AurelianTactics on Discord)

The Reroll-procedure is looking at self.game.get_team_agent(self.player.team).human when determining which the available actions shall be. This means you get different behavior of the game class depending on these two situations.

Scenario 1:

game = Game(...) 
agent = MyAgent(...) 
agent.human = True 
game.replace_home_agent(agent) 
game.init()  
while not game.state.game_over: 
    action = agent.act(game) 
    game.step(action)
assert game.state.game_over

Scenario 2:

game = Game(...) 
agent = MyAgent(...) 
agent.human = False 
game.replace_home_agent(agent) 
game.init()  
assert game.state.game_over

This is confusing and the user should be given the freedom to step the game in a convenient way. There are workarounds but they are neither obvious nor straight-forward to the average user.

mrbermell avatar May 17 '22 08:05 mrbermell