[1.1.107] Biter group stuck after pathing near water
Posted: Thu Jun 20, 2024 5:05 am
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.
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.