I work on the Biter Battles scenario. This uses custom scenario code to spawn biter attack waves, have the waves travel to a waypoint, and then attack the player after going to that waypoint.
We somewhat frequently have biter attack groups encounter a pathfinding error (defines.behavior_result.fail) when the location of the unit group happens to be on a water tile (my understanding is that the position of the unit group is the average of the members of the unit group, and so when biters path near water, it is not uncommon for the center of the unit group to overlap some water tiles. It is very much the case that each biter itself in these situations does have a valid path to the target (like, there are no islands involved or anything)
The most confusing this for me is that in this case, I am unable to get the unit group to do ~anything. I have tried doing unit_group.set_command(type=wander), or giving it commands to route to other locations, and they seem to just not do anything (they just stay still where they were). Calling unit_group.set_autonomous() does work (the biters seem to disperse and go back to nearby spawners), but that is not what I want.
Just to be explicit, my expectations for the behavior is that if I have a UnitGroup of a bunch of units that are close to one another, I would not get pathfinder errors when telling them to go to reachable targets.
I'm excited because I did not realize that the center-of-group-is-on-the-water was part of this behavior until very recently (when I finally added some more debug messages when this happens). This issue has been around in Biter Battles for a long long time (sometimes, groups of biters just become stranded).
I'm open to any sort of suggestions/feedback about how I could make progress (if there is more debugging info that would be helpful). Perhaps our algorithm for choosing waypoints could try harder to find a location farther away from water, for instance.
I guess maybe an option would be to destroy the unit group, and just give the command to each unit individually.
I've attached the opening portion of factorio-current.log. I don't want to include ip addresses of random users, so that is why this is just part of the log. If you want/need anything else from the log file, just ask.
[1.1.107] Biter group stuck after pathing near water
-
- Inserter
- Posts: 20
- Joined: Thu Dec 03, 2020 4:52 pm
- Contact:
[1.1.107] Biter group stuck after pathing near water
- Attachments
-
- factorio-current.log
- (3.02 KiB) Downloaded 28 times
Re: [1.1.107] Biter group stuck after pathing near water
Post a save and exact steps that let you reproduce this please, see 3638.
-
- Inserter
- Posts: 20
- Joined: Thu Dec 03, 2020 4:52 pm
- Contact:
Re: [1.1.107] Biter group stuck after pathing near water
I can reproduce the same error message by waiting for the code to run (including choosing waypoints), and then use /editor to add a bunch of water on/near the waypoint.
Here is a save that will reproduce the issue (game.print is called with the coordinates of the stuck unit group when it happens).
Here is a save that will reproduce the issue (game.print is called with the coordinates of the stuck unit group when it happens).
- Attachments
-
- bb-repro-pathing-failure2.zip
- (5.12 MiB) Downloaded 34 times