The Bug
The game crashes after entering combat on a new game.
Reproduction Instructions
Detail the steps to reproduce the bug.
- Create a new game
- Select any character
- Move to a combat location on the map
- The game crashes
Expected behaviour
No crash.
Screenshots
Not necessary.
Platform
- OS: Manjaro 21.2.1(Gnome)
- Python Version: 3.9.9
- NQP Version: 0.1.0 (develop branch)
Log Output/Stack Trace
Stack Trace:
Traceback (most recent call last):
File "/home/douglas/Python Projects/nqp2/scripts/__main__.py", line 26, in main
game_loop(game)
File "/home/douglas/Python Projects/nqp2/scripts/__main__.py", line 58, in game_loop
game.run()
File "/home/douglas/Python Projects/nqp2/scripts/core/game.py", line 96, in run
self.update()
File "/home/douglas/Python Projects/nqp2/scripts/core/game.py", line 87, in update
self.active_scene.update(delta_time)
File "/home/douglas/Python Projects/nqp2/scripts/scenes/overworld/scene.py", line 46, in update
self.node_container.update(delta_time)
File "/home/douglas/Python Projects/nqp2/scripts/scenes/overworld/elements/rings.py", line 50, in update
self._transition_to_new_node(delta_time)
File "/home/douglas/Python Projects/nqp2/scripts/core/base_classes/node_container.py", line 174, in _transition_to_new_node
self.trigger_current_node()
File "/home/douglas/Python Projects/nqp2/scripts/core/base_classes/node_container.py", line 208, in trigger_current_node
self.game.change_scene(scene)
File "/home/douglas/Python Projects/nqp2/scripts/core/game.py", line 126, in change_scene
self.combat.generate_combat()
File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/scene.py", line 205, in generate_combat
self.terrain.generate(biome)
File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/elements/terrain.py", line 141, in generate
self.gen_pathfinding_map()
File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/elements/terrain.py", line 87, in gen_pathfinding_map
self.pathfinder.set_map(self.pathfinding_array)
File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/elements/pathfinder.py", line 13, in set_map
self.tcod_map = tcod.path.AStar(map_data, diagonal=0)
File "/home/douglas/.cache/pypoetry/virtualenvs/notquiteparadise2-u2fdlzlx-py3.9/lib/python3.9/site-packages/tcod/path.py", line 188, in __init__
) = self.cost.get_tcod_path_ffi()
File "/home/douglas/.cache/pypoetry/virtualenvs/notquiteparadise2-u2fdlzlx-py3.9/lib/python3.9/site-packages/tcod/path.py", line 151, in get_tcod_path_ffi
raise ValueError("dtype must be one of %r, dtype is %r" % (self._C_ARRAY_CALLBACKS.keys(), self.dtype.type))
ValueError: dtype must be one of dict_keys([<class 'numpy.float32'>, <class 'numpy.bool_'>, <class 'numpy.int8'>, <class 'numpy.uint8'>, <class 'numpy.int16'>, <class 'numpy.uint16'>, <class 'numpy.int32'>, <class 'numpy.uint32'>]), dtype is <class 'numpy.int64'>
The log file has pretty much the same output:
2022-01-06 22:27:50,100| DEBUG | Logging initialised.
2022-01-06 22:27:50,100| DEBUG | Debugger: initialised in 0.00s.
2022-01-06 22:27:50,110| DEBUG | Window: initialised in 0.01s.
2022-01-06 22:27:50,111| DEBUG | Data: All commanders data loaded.
2022-01-06 22:27:50,120| DEBUG | Data: All unit data loaded.
2022-01-06 22:27:50,125| DEBUG | Data: All tileset data loaded.
2022-01-06 22:27:50,126| DEBUG | Data: All event data loaded.
2022-01-06 22:27:50,127| DEBUG | Data: All upgrade data loaded.
2022-01-06 22:27:50,127| DEBUG | Data: All combats data loaded.
2022-01-06 22:27:50,127| DEBUG | Data: All bosses data loaded.
2022-01-06 22:27:50,127| DEBUG | Data: All skills data loaded.
2022-01-06 22:27:50,128| DEBUG | Data: Config data loaded.
2022-01-06 22:27:50,128| DEBUG | Data: Options data loaded.
2022-01-06 22:27:50,128| DEBUG | Data: initialised in 0.02s.
2022-01-06 22:27:50,128| INFO | Memory: initialised in 0.00s.
2022-01-06 22:27:50,134| INFO | Assets: All images loaded.
2022-01-06 22:27:50,616| DEBUG | Assets: initialised in 0.49s.
2022-01-06 22:27:50,616| DEBUG | Input: initialised in 0.00s.
2022-01-06 22:27:50,616| DEBUG | RNG: initialised in 0.00s.
2022-01-06 22:27:50,616| DEBUG | MainMenuScene: initialised in 0.00s.
2022-01-06 22:27:50,616| DEBUG | RunSetupScene: initialised in 0.00s.
2022-01-06 22:27:50,617| DEBUG | OverworldScene: initialised in 0.00s.
2022-01-06 22:27:50,617| DEBUG | CombatScene: initialised in 0.00s.
2022-01-06 22:27:50,617| DEBUG | RewardScene: initialised in 0.00s.
2022-01-06 22:27:50,617| DEBUG | EventScene: initialised in 0.00s.
2022-01-06 22:27:50,617| DEBUG | TrainingScene: initialised in 0.00s.
2022-01-06 22:27:50,617| DEBUG | InnScene: initialised in 0.00s.
2022-01-06 22:27:50,617| DEBUG | ViewTroupeScene: initialised in 0.00s.
2022-01-06 22:27:50,636| DEBUG | UnitDataScene: initialised in 0.02s.
2022-01-06 22:27:50,636| DEBUG | GalleryScene: initialised in 0.00s.
2022-01-06 22:27:50,645| DEBUG | Game initialised in 1.34s.
2022-01-06 22:27:52,050| INFO | Active scene changed to RUN_SETUP.
2022-01-06 22:27:52,750| INFO | Seed set to 20220106192750.
2022-01-06 22:27:52,750| INFO | Player chose ralnath as their commander.
2022-01-06 22:27:52,751| DEBUG | Unit harpy(1) created and added to player's troupe.
2022-01-06 22:27:52,751| DEBUG | Unit caveborn(2) created and added to player's troupe.
2022-01-06 22:27:52,751| INFO | Generating overworld...
2022-01-06 22:27:52,751| DEBUG | -> Ring 1 has 3 nodes; ['INN', 'COMBAT'].
2022-01-06 22:27:52,752| DEBUG | -> Ring 2 has 5 nodes; ['TRAINING', 'BLANK', 'TRAINING', 'INN', 'BLANK'].
2022-01-06 22:27:52,752| DEBUG | -> Ring 3 has 6 nodes; ['BLANK', 'COMBAT', 'COMBAT', 'TRAINING', 'INN', 'INN'].
2022-01-06 22:27:52,753| DEBUG | -> Ring 4 has 10 nodes; ['INN', 'COMBAT', 'INN', 'COMBAT', 'COMBAT', 'COMBAT', 'TRAINING', 'COMBAT', 'BLANK', 'COMBAT'].
2022-01-06 22:27:52,754| DEBUG | -> Ring 5 has 14 nodes; ['COMBAT', 'BLANK', 'COMBAT', 'BLANK', 'COMBAT', 'COMBAT', 'COMBAT', 'COMBAT', 'COMBAT', 'COMBAT', 'BLANK', 'COMBAT', 'COMBAT', 'BLANK'].
2022-01-06 22:27:52,754| INFO | -> Map generated. Rings: 6 | Nodes: filled:36, blank:8 | Connections: 10
2022-01-06 22:27:52,754| INFO | Run starting now!
2022-01-06 22:27:52,763| INFO | Active scene changed to OVERWORLD.
2022-01-06 22:27:56,660| INFO | Next node, COMBAT, selected.
2022-01-06 22:28:03,943| CRITICAL| Something went wrong and killed the game loop!
2022-01-06 22:28:03,946| CRITICAL| Traceback (most recent call last):
2022-01-06 22:28:03,946| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/__main__.py", line 26, in main game_loop(game)
2022-01-06 22:28:03,946| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/__main__.py", line 58, in game_loop game.run()
2022-01-06 22:28:03,946| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/core/game.py", line 96, in run self.update()
2022-01-06 22:28:03,946| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/core/game.py", line 87, in update self.active_scene.update(delta_time)
2022-01-06 22:28:03,946| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/scenes/overworld/scene.py", line 46, in update self.node_container.update(delta_time)
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/scenes/overworld/elements/rings.py", line 50, in update self._transition_to_new_node(delta_time)
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/core/base_classes/node_container.py", line 174, in _transition_to_new_node self.trigger_current_node()
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/core/base_classes/node_container.py", line 208, in trigger_current_node self.game.change_scene(scene)
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/core/game.py", line 126, in change_scene self.combat.generate_combat()
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/scene.py", line 205, in generate_combat self.terrain.generate(biome)
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/elements/terrain.py", line 141, in generate self.gen_pathfinding_map()
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/elements/terrain.py", line 87, in gen_pathfinding_map self.pathfinder.set_map(self.pathfinding_array)
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/Python Projects/nqp2/scripts/scenes/combat/elements/pathfinder.py", line 13, in set_map self.tcod_map = tcod.path.AStar(map_data, diagonal=0)
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/.cache/pypoetry/virtualenvs/notquiteparadise2-u2fdlzlx-py3.9/lib/python3.9/site-packages/tcod/path.py", line 188, in __init__ ) = self.cost.get_tcod_path_ffi()
2022-01-06 22:28:03,947| CRITICAL| File "/home/douglas/.cache/pypoetry/virtualenvs/notquiteparadise2-u2fdlzlx-py3.9/lib/python3.9/site-packages/tcod/path.py", line 151, in get_tcod_path_ffi raise ValueError("dtype must be one of %r, dtype is %r" % (self._C_ARRAY_CALLBACKS.keys(), self.dtype.type))
2022-01-06 22:28:03,948| CRITICAL| ValueError: dtype must be one of dict_keys([<class 'numpy.float32'>, <class 'numpy.bool_'>, <class 'numpy.int8'>, <class 'numpy.uint8'>, <class 'numpy.int16'>, <class 'numpy.uint16'>, <class 'numpy.int32'>, <class 'numpy.uint32'>]), dtype is <class 'numpy.int64'>
bug