segabl / pd2-useful-bots

A lightweight bot overhaul
GNU General Public License v3.0
7 stars 5 forks source link

Revive Issue (can't reproduce) #15

Closed ghost closed 1 year ago

ghost commented 1 year ago

Currently, the bots will attempt to kill Cloakers and Tazers before attempting a revive. While this is a very useful feature, I think it needs failsafes if it doesn't already have any. I had an issue where the bot was trying to shoot one of them across the map due to the long sightline and so failed to revive me in time before something else killed it.

The two failsafes I was thinking of are a distance check that equals the unit's respective ranges for their special attack and a time check for how long the revive has remaining, having the bot ignore everything if there are only a few seconds left.

segabl commented 1 year ago

The following checks are already in place. Bots will ignore cloakers and tasers when going to revive if

these seem to work fine for me, however if you think some of these conditions aren't followed properly let me know

ghost commented 1 year ago

Looking back at the footage it seems what happened is the check was triggered because there was a Cloaker on me, but that caused Hoxton to keep attempting to shoot any Tazer and Cloaker in his line of sight no matter how far away. He started moving without killing anything just before dying, I assume because the units he saw broke line of sight.

These checks should probably be activated again once the bot reaches the player and after each kill to ensure they don't start trying to snipe enemies that aren't even a problem.

ghost commented 1 year ago

Actually, talking about it with a friend, I think the only check that worked as intended there was the "health is below half" one. I was definitely more than 5m away, the revive timer went below 10 seconds, and he continued to stay in his shoot-interrupt-units phase despite none of those units being within 10 meters from him. He only attempted to revive me once the swat turret shot him to pieces.

segabl commented 1 year ago

I'll check this again but this seemed to be working fine for me

ghost commented 1 year ago

Note: This wasn't on version 2.3.0. I have now re-enabled automatic updates.

segabl commented 1 year ago

Checked again on a test level and all the conditions worked fine on my end

ghost commented 1 year ago

I assumed the conditions work fine in a controlled environment. I'll see about recreating it on San Martín Bank the same way I did in the footage. Gonna need to find a mod that lets me disable normal spawns and place my own units, though. Either that or hope I get the right conditions using a mutator.

ghost commented 1 year ago

From my own testing, I got the same results. Tested if distance mattered, line of sight checks, multiple units nearby causing distance to be forgotten, but everything worked as intended. No problems. I guess I was just unlucky. Got no idea how to explain what happened with the bot in my recording, but I now doubt that it's a result of these checks.