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

No player position during quick snap without pathfinding #231

Open
njustesen opened this issue Apr 13, 2022 · 0 comments
Open

No player position during quick snap without pathfinding #231

njustesen opened this issue Apr 13, 2022 · 0 comments

Comments

@njustesen
Copy link
Owner

This happened during quick snap when using the MCTS agent in a game with pathfinding disabled.

Traceback (most recent call last):
  File "/Users/noju/git/botbowl/examples/mcts_example.py", line 318, in <module>
    game.init()
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 151, in init
    self.step(start_action)
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 191, in step
    self.action = self._safe_act()
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 324, in _safe_act
    action = self.actor.act(self)
  File "/Users/noju/git/botbowl/examples/mcts_example.py", line 281, in act
    root = mcts.run(self.seconds)
  File "/Users/noju/git/botbowl/examples/mcts_example.py", line 185, in run
    tree_trajectory = self._select_and_expand(root)
  File "/Users/noju/git/botbowl/examples/mcts_example.py", line 225, in _select_and_expand
    new_chance_node, new_node = self._expand(node)
  File "/Users/noju/git/botbowl/examples/mcts_example.py", line 235, in _expand
    self.game.step(action)
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 172, in step
    done = self._one_step(self.action)
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 469, in _one_step
    self.set_available_actions()
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 625, in set_available_actions
    self.state.available_actions = self.state.stack.peek().available_actions()
  File "/Users/noju/git/botbowl/botbowl/core/procedure.py", line 2730, in available_actions
    actions = self.game.get_adjacent_move_actions(self.player)
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 2407, in get_adjacent_move_actions
    for square in self.get_adjacent_squares(player.position, occupied=False):
  File "/Users/noju/git/botbowl/botbowl/core/game.py", line 1707, in get_adjacent_squares
    sq = self.get_square(position.x + xx, position.y + yy)
AttributeError: 'NoneType' object has no attribute 'x'

I haven't been able to reproduce it.

@njustesen njustesen changed the title No player position during quick snap No player position during quick snap without pathfinding Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant