Author Topic: [Solved] HK soft lock  (Read 1625 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
[Solved] HK soft lock
« 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
Spoiler:

(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.
Spoiler:
« Last Edit: January 27, 2023, 04:45:20 pm by The Martian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8615
    • View Profile
Re: HK soft lock
« Reply #1 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.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: HK soft lock
« Reply #2 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.
« Last Edit: January 20, 2023, 11:23:37 am by The Martian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8615
    • View Profile
Re: HK soft lock
« Reply #3 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.

Offline psavola

  • Commander
  • *****
  • Posts: 627
    • View Profile
Re: HK soft lock
« Reply #4 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?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8615
    • View Profile
Re: HK soft lock
« Reply #5 on: January 20, 2023, 01:22:54 pm »
UFOs always have unlimited ammo.

Offline karadoc

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: HK soft lock
« Reply #6 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.)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8615
    • View Profile
Re: HK soft lock
« Reply #7 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?

Offline karadoc

  • Colonel
  • ****
  • Posts: 230
    • View Profile
Re: HK soft lock
« Reply #8 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.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8615
    • View Profile
Re: HK soft lock
« Reply #9 on: January 20, 2023, 04:07:36 pm »
extracted into a separate thread

Offline N7Kopper

  • Captain
  • ***
  • Posts: 59
    • View Profile
Re: HK soft lock
« Reply #10 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.
« Last Edit: January 27, 2023, 12:49:29 pm by N7Kopper »

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: HK soft lock
« Reply #11 on: January 27, 2023, 04:47:29 pm »
I don't disagree with you.

This was just my inexperience with the hunterKillerPercentage: setting.

Offline TBeholder

  • Sergeant
  • **
  • Posts: 40
    • View Profile
Re: [Solved] HK soft lock
« Reply #12 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?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8615
    • View Profile
Re: [Solved] HK soft lock
« Reply #13 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.