Print_map() is not working

Dear community,

i am calling this in the onturn or starter strategy method:

game_state._shortest_path_finder.print_map()

and it is not working can anyone tell me what i am doing wrong?

Does it give an error, or just do nothing? Are other things printing fine?

SAPlayer 1 : AttributeError: ‘ShortestPathFinder’ object has no attribute ‘game_map’ :confused:

This looks like a bug in gamelib, where ShortestPathFinder doesn’t initialize its game_map until it tries to find a path. As a workaround, try running
game_state.find_path_to_edge([13,0],game_state.game_map.BOTTOM_LEFT)
before you run print_map(). This finds a path from [13,0] to the edge that it started on, so it doesn’t really do anything.

1 Like

Thanks for pointing this out. Ill see if its an easy fix

thank you very much, this helped :slight_smile:

I setup a solution for this. Thanks for bringing it to our attention.