FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.69k stars 394 forks source link

AI affliction tag targeting errors #8051

Closed washedAwry closed 2 years ago

washedAwry commented 2 years ago

Description AI has trouble targeting affliction tags, at least when ordered to only attack those with that tag.

Steps To Reproduce Test creature with target tag="human" set to be excluded just as humanhusk excludes the huskinfected tag, and a test affliction that gives a tag which this test creature has a high-priority to attack. The creature will not attack the person with the tag. There is a good chance that I am doing something wrong, I'll attach the relevant affliction and AI parameters. When "human" was excluded from all parameters, it would still get angry when attacked only once, instead of getting hostile to those nearby when attacked twice as intended. attackwhenprovoked is set to false.

Version Latest release build, Windows 10 64-bit

Additional information Think SCP-096 or the Witch from Left 4 Dead. relevantxml.txt

Regalis11 commented 2 years ago

This seems to happen because the AI requires that the damage done by the target is higher than the "threshold" defined for that type of target. And if the threshold isn't defined, it defaults to 0. This is admittedly pretty unintuitive, so I think we'll change it, but for the time being it should be possible to work around this by changing the targeting params to something like this:

<target tag="fn_clownwitchtarget2" state="Attack" priority="650" reactdistance="1000" ignoreincapacitated="False" attackdistance="0" timer="0" ignorecontained="False" ignoreinside="False" ignoreoutside="False" ignoreifnotinsamesub="False" damagethreshold="0" attackpattern="Straight" sweepdistance="0" sweepstrength="10" sweepspeed="1" circlestartdistance="5000" circlerotationspeed="1" circlestrikedistancemultiplier="5" circlemaxrandomoffset="0" threshold="-1" />
<target tag="fn_clownwitchtarget1" state="Attack" priority="500" reactdistance="1000" ignoreincapacitated="True" attackdistance="0" timer="0" ignorecontained="False" ignoreinside="False" ignoreoutside="False" ignoreifnotinsamesub="False" damagethreshold="0" attackpattern="Straight" sweepdistance="0" sweepstrength="10" sweepspeed="1" circlestartdistance="5000" circlerotationspeed="1" circlestrikedistancemultiplier="5" circlemaxrandomoffset="0" threshold="-1"/>
Regalis11 commented 2 years ago

Fixed in https://github.com/Regalis11/Barotrauma-development/commit/10c5615a40a4773b0fd0c50a392205f5bb639e06

washedAwry commented 2 years ago

Thank you.

ekqvist commented 2 years ago

@mcbanekenney Thanks for taking the time to close this. However, we'll keep the issues open until they've been reviewed and confirmed to be fixed by our QA.

Rokvach commented 2 years ago

This hasn't caused any issues to the vanilla gameplay, I think I'm just going to close it. We can always re-open this ticket if it still does happen once the patch is out. Closing.