[Oxyd] [0.16.51] Cease-fire unit groups attack on move order
Posted: Mon Jun 18, 2018 12:55 pm
I'm working on a mod which adds mostly non-aggressive units (which will retaliate though) and wanted to order groups of them to move around player's base.
But that does not work as units bump into infrastructure and randomly start attacking it, even though both their and player's force are on cease fire.
Same happens with rocks if they happen to be in the way, which is already reported, but not a concern here (unlike random impossible-to-disable aggression), just a side-note.
Specific command that mod runs for a group:
Force of the group and all units belonging to it have cease-fire with the player and vice-versa.
Expected result:
Group units move to specified position without attacking any of player's infrastructure.
Actual result:
Group units always start attacking player's stuff as soon as they bump into them.
This includes entities which don't seem to hinder movement, like belts.
Why is it unexpected:
As far as I understand the meaning of "cease fire", and as it is documented - "Stop attacking members of a given force." - random aggression is not what is supposed to happen during "move" command.
How to reproduce:
- Install/add Will-o-the-Wisps updated version 0.0.41+ to any existing game with plenty of buildings and pollution, as well as trees on the map.
- Wait until it is dark or set darkness value via mods/console.
- Run following console commands in sequence: "/wisp zone update", "/wisp congregate".
- Open map, newly created group and their move destination should be marked there, see how it's impossible to have this group not attack stuff on the way.
- Run "/wisp stats" command, note how it enumerates all attacking units as belonging to "peaceful" force, which has cease-fire with player (that never changes).
Will attach log and a savegame (where these commands produce such result, 14M).
Latter is rather heavily modded, but pretty sure there should be no mods which come anywhere close to touching that kind of behavior.
What sounds like a good fix:
Make units never attack forces they encounter that they have cease-fire with.
What sounds like a second-best fix:
Add e.g. distraction=no-pathing-attacks option/flag (or a separate move-only command) that'd tell units to not attack non-hostile stuff they bump into.
And document "cease fire" option as "more of a guideline than a rule", saying explicitly there that units can and will still attack everything in their way, disregarding cease-fire, unless ordered not to via command.
Attempted workaround:
Setting distraction= for commands above to all documented values, including "none" - no effect.
Possible workaround:
Replace all entities in group with ones without attack capability for the duration of command.
This seems very suboptimal wrt how it'd work and requires a bunch of special-case lua code to handle.
Thanks!
But that does not work as units bump into infrastructure and randomly start attacking it, even though both their and player's force are on cease fire.
Same happens with rocks if they happen to be in the way, which is already reported, but not a concern here (unlike random impossible-to-disable aggression), just a side-note.
Specific command that mod runs for a group:
Code: Select all
group.set_command{
type=defines.command.compound,
structure_type=defines.compound_command.return_last,
commands={
{type=defines.command.go_to_location, destination=pos},
{type=defines.command.wander} } }
Expected result:
Group units move to specified position without attacking any of player's infrastructure.
Actual result:
Group units always start attacking player's stuff as soon as they bump into them.
This includes entities which don't seem to hinder movement, like belts.
Why is it unexpected:
As far as I understand the meaning of "cease fire", and as it is documented - "Stop attacking members of a given force." - random aggression is not what is supposed to happen during "move" command.
How to reproduce:
- Install/add Will-o-the-Wisps updated version 0.0.41+ to any existing game with plenty of buildings and pollution, as well as trees on the map.
- Wait until it is dark or set darkness value via mods/console.
- Run following console commands in sequence: "/wisp zone update", "/wisp congregate".
- Open map, newly created group and their move destination should be marked there, see how it's impossible to have this group not attack stuff on the way.
- Run "/wisp stats" command, note how it enumerates all attacking units as belonging to "peaceful" force, which has cease-fire with player (that never changes).
Will attach log and a savegame (where these commands produce such result, 14M).
Latter is rather heavily modded, but pretty sure there should be no mods which come anywhere close to touching that kind of behavior.
What sounds like a good fix:
Make units never attack forces they encounter that they have cease-fire with.
What sounds like a second-best fix:
Add e.g. distraction=no-pathing-attacks option/flag (or a separate move-only command) that'd tell units to not attack non-hostile stuff they bump into.
And document "cease fire" option as "more of a guideline than a rule", saying explicitly there that units can and will still attack everything in their way, disregarding cease-fire, unless ordered not to via command.
Attempted workaround:
Setting distraction= for commands above to all documented values, including "none" - no effect.
Possible workaround:
Replace all entities in group with ones without attack capability for the duration of command.
This seems very suboptimal wrt how it'd work and requires a bunch of special-case lua code to handle.
Thanks!