Game_state.find_path_to_edge() outputs wrong path

[(10, 3), [10, 4], [11, 4], [11, 5], [12, 5], [12, 6], [13, 6], [13, 7], [13, 8], [13, 9], [13, 10], [13, 11], [13, 12], [13, 13], [13, 14], [13, 15], [14, 15], [14, 16], [14, 17], [14, 18], [14, 19], [14, 20], [14, 21], [14, 22], [14, 23], [14, 24], [14, 25], [14, 26], [14, 27]]
is the output I get when invoking game_state.find_path_to_edge((10,3),game_state.game_map.TOP_RIGHT)
(The map is completely empty)
which is not the path the unit really takes

game_state.find_path_to_edge takes the current game_state (from the start of your current turn/end of last turn) and calculates a path from it. This may or may not take into account your own firewalls that you have deployed on that turn (depending on whether you called the function before or after placing units) but it will not take into account enemy firewalls that may be placed on that turn. Hence, the path you calculated may be different from the path taken after firewalls have been placed.

1 Like

None of the two players placed anything

Hmm, could you show us what the actual path taken by the unit was? (picture of board may be useful as well). It could be a case of buggy targeting algorithms, as discussed in another thread.

Edit: I didn’t see the ‘map is completely empty’ statement. In that case, it looks like a buggy targeting algorithm

1 Like


The Path outputted by game_state.find_path_to_edge() is red
The Path the unit takes is blue

Definitely a bugged pathing algorithm. Big discussion about it here: Pathing / targeting bug?

But that discussion is about the bugged pathing algorithm of the engine. This discussion is about the bugged pathing algorithm of the starter algorithm

Is this using the online engine or the downloaded engine?

The online engine produces the blue path

It might be the case that the downloaded engine is also bugged. Interesting that the online and downloaded engines are different though.

So game_state.find_path_to_edge() uses the downloaded engine?

game_state.find_path_to_edge() is not the method the engine use, is just here to help the player to produce a strategy

1 Like

Sorry, meant pathing algorithm. btw I tested what you described, and nothing buggy appeared for me.

Do you think it could have to do with version diffrences?
Because i’m using a 2.5 weeks old starter algorithm

It’s definitely worth cloning the repo again and seeing if the problem goes away. There have been new versions of the starter kit released since then.

2 Likes

Ok using the newest version fixed the problem.
Thank you!

It looks likely that there is an issue with pathfinding in the starterkit. We tested that it was the same as the engine by running it using 10k random board states, and the logic used in the starterkit is much simpler than what is used in the engine (The engine is very efficient).

I am pretty suprised to see an issue in the starterkit for these reasons, but it is certainly possible especially if another change touched it somehow. If anyone else has issues with starterkit pathing, post them here.

@C1Ryan
I have a question, When I do game_state.find_path_to_edge(10, 3, game_map.TOP_RIGHT)
I get an error that says game_map is not defined what am I doing wrong?

@DuckyQuack236
You have no variable named game_map.
Probably game_state.find_path_to_edge(10, 3, game_state.game_map.TOP_RIGHT) will work better.

1 Like

Do I do game_state.advanced to get advanced game_state functions?
@C1Ryan
When I try to do advanced_game_state.get_attackers(location, 0) it says advanced_game_state is not defined, what is the right prefix?