OpenXcom Forum

Modding => OpenXcom Extended => OXCE Support => Topic started by: The Martian on January 20, 2023, 07:23:02 am

Title: [Solved] HK soft lock
Post by: The Martian on January 20, 2023, 07:23:02 am
2. HKs can instantly destroy defenseless craft when player presses the red self-destruct button.

Defenseless means:
- slower than the UFO
- has no more ammo left
- there are no more active (still flying) projectiles
(https://openxcom.org/forum/index.php?action=dlattach;topic=5717.0;attach=41108;image)

(OpenXcom Extended 7.8)

I'm softlocked in the interception screen.

While testing the hunter killer feature I threw an unarmed Triton at an unarmed alien UFO.

As as expected the only available option was to click the red button in the upper left corner to activate self-destruct.

However nothing happens no matter how long I wait. Pressing the button again displays the message Self-Destruct Cancelled.

Once self-destruct is activated what do I need to press to confirm it and destroy the X-Com craft?

I also could not escape by pressing ESC to bring up the menu to abandon the game or close the program.
(https://openxcom.org/forum/index.php?action=dlattach;topic=11044.0;attach=58885)
Title: Re: HK soft lock
Post by: Meridian on January 20, 2023, 09:34:20 am
As the description says "2. HKs can instantly destroy defenseless craft when player presses the red self-destruct button."

If HK doesn't have a weapon it cannot fire and cannot destroy the craft.
Title: Re: HK soft lock
Post by: The Martian on January 20, 2023, 11:22:03 am
Thank you that makes sense.

To prevent the softlock it is best not to make unarmed UFOs be hunter killers unless all of X-Com's craft have the option to out run such a HK or alternatively there is some scripting involved that would allow the interception to conclude.
Title: Re: HK soft lock
Post by: Meridian on January 20, 2023, 11:30:01 am
I think it doesn't make sense to make an unarmed UFO a HK at all.

Without a weapon it's not a hunter-killer, it's just a hunter.
Title: Re: HK soft lock
Post by: psavola on January 20, 2023, 12:38:30 pm
Doesn't this problem - and the softlock - at least theoretically also occur if a hunter-killer runs out of ammo? (Not sure whether alien UFOs always have unlimited ammo?) If so, shouldn't the hunter-killer code be improved so that the behavior would automatically change when that occurs?
Title: Re: HK soft lock
Post by: Meridian on January 20, 2023, 01:22:54 pm
UFOs always have unlimited ammo.
Title: Re: HK soft lock
Post by: karadoc on January 20, 2023, 02:37:07 pm
Although UFOs have unlimited ammo... I believe there is already code which tells hunter-killer AI to withdraw from combat after a certain time - which makes it look like they've run out of ammo. In fact, the entire reason that timed-withdraw exists in the code is to avoid this kind of softlock!  So... if you are being attacked by a hunter-killer with no weapons, you can just wait it out. (And it sounds like a mod-rules bug to have a hunter killer with no weapons.)
Title: Re: HK soft lock
Post by: Meridian on January 20, 2023, 03:18:59 pm
HK can withdraw if it's not a kamikaze and has sustained significant damage.
In this case it won't withdraw, because it cannot sustain any damage (craft doesn't have any weapons either).

HK can also withdraw if it fires enough shots (by default 100) and doesn't destroy xcom craft.
In this case it won't withdraw, because it cannot fire any shots.

Also, is it really SO hard to believe me?
How many more people want to tell me how I implemented this feature?
Title: Re: HK soft lock
Post by: karadoc on January 20, 2023, 03:56:13 pm
My mistake. I misremembered the withdrawal thing as a time counter when it is actually a shot counter. And I certainly wasn't trying to correct you about anything. I was just trying to contribute a snippet of info that I thought was interesting and relevant. Apparently I'd got the info wrong, and misinterpreted the mood of the thread too. Sorry.
Title: Re: HK soft lock
Post by: Meridian on January 20, 2023, 04:07:36 pm
extracted into a separate thread
Title: Re: HK soft lock
Post by: N7Kopper on January 27, 2023, 12:47:51 pm
This seems more like a "lol the game softlocks if I try to run it without any ufos or battlescape missions" kind of thing.

Kind of like how I can't win a deathmatch in Halo if I start one by myself. (even that's not technically true if I set the rules to gain points via suicide or add a time limit!) This problem is avoided, as was mentioned, by allowing your hunter-killers to... you know... kill stuff.
Title: Re: HK soft lock
Post by: The Martian on January 27, 2023, 04:47:29 pm
I don't disagree with you.

This was just my inexperience with the hunterKillerPercentage: setting.
Title: Re: [Solved] HK soft lock
Post by: TBeholder on January 28, 2023, 01:30:47 am
Why not just… you know, allow to disengage?
At which point the enemy craft could either follow and attack, follow to track or also disengage, depending on whether it can attack and set fallback behavior?
Title: Re: [Solved] HK soft lock
Post by: Meridian on January 28, 2023, 09:29:47 am
Because the HK is faster than you and doesn't allow you to disengage.

If you were faster, you could disengage at any time.