aliens

Author Topic: Retaliation missions are spawning with unexpected results?  (Read 1970 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Retaliation missions are spawning with unexpected results?
« on: February 02, 2023, 12:00:13 am »
(OXCE V7.8 - Increased Alien Randomization TFTD V0.3 mod)

I have encountered something unexpected involving the 'Retaliation / Floating Base Attack' missions.

Crafts that should spawn with the a placeholder race of "High Threat" are instead being crewed by "Low Threat" race.

Spoiler:

In that battlescape it spawned as a Lobster which confirms it really was the "High Threat" and the wrong race had been assigned.

Spoiler:

All UFOs & Mission types should match with the 'threat level' placeholder race matching either the normal, advanced or elite UFO. I've temporarily placed an 'A' after the name for all advanced Sub Type / Mission and an 'E' for the elites to make debugging easier using a Transmission Resolver.

My guess was that the UFO was inheriting the race of the base that was launching it so I added the following code to all alienDeployments: entries:
Code: [Select]
    genMissionRaceFromAlienBase: false    # true (default) = take race from base (vanilla behavior); false = take from mission 'raceWeights' if not empty (if empty take from base)
    huntMissionRaceFromAlienBase: false
And that did clear up a similar problem with other UFOs but unfortunately the retaliation UFOs continued to be crewed by the wrong race.

I have the elite retaliation missions in alienMissions: setup to only have the "High Threat" race in its raceWeights: so I'm not sure how it is assigning any race outside of that list.
Code: [Select]
alienMissions:

# [=] Alien Retaliation [=] <Elite>
  - type: STR_ALIEN_RETALIATION_ELITE
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_HIGH_THREAT: 100
    waves:
      - ufo: STR_SURVEY_SHIP_ELITE
        count: 1
        trajectory: P8
        timer: 3000
      - ufo: STR_ESCORT_ELITE
        count: 2
        trajectory: P8
        timer: 3000
      - ufo: STR_CRUISER_ELITE
        count: 3
        trajectory: P8
        timer: 3000
      - ufo: STR_DREADNOUGHT_ELITE
        count: 2
        trajectory: P8
        timer: 3000

Are 'Alien Retaliation / Floating Base Attack' missions configured differently than the rest since they can be spawned as a result to X-Com's activity?

There hadn't been any alien craft shot down when I was debugging so I was not expecting to see retaliation missions yet and I don't think enough time had passed to trip any of the difficulty retaliation mission scripts. It is possible that using Debug mode turned on the researchRetaliation mission script due to granting all research, but that entry should also have spawned an elite ship with the matching placeholder 'High Threat' race.

I'm stepping through the code to see if I've accidently misconfigured one the retaliation missions but so far everything seems to have the right race assigned. Does huntMissionRaceFromAlienBase: & genMissionRaceFromAlienBase: not effect retaliation missions?


For convenience an updated version of the mod and a save file with the Alien Sub-30 from the screenshot is attached to this post.
« Last Edit: February 02, 2023, 01:46:32 am by The Martian »

Offline Buscher

  • Colonel
  • ****
  • Posts: 168
    • View Profile
Re: Retaliation missions are spawning with unexpected results?
« Reply #1 on: February 02, 2023, 08:42:30 am »
Two, maybe three notes:
- When shooting down USOs, the used retaliation is part of alienRaces: retaliationMission/retaliationMissionWeights (see reference). Without any settings they will pick any alienMission with objective: 4
- Debug mode sets all research to true. This also includes STR_THE_ULTIMATE_THREAT.
- For debugging purposes you are best of to provide a savegame on the last day of the month. When savescum (advanced settings) is not enabled, the next month shouuuuullld.... be the same, maybe.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Retaliation missions are spawning with unexpected results?
« Reply #2 on: February 04, 2023, 02:28:44 am »
In alienRaces: I added the retaliationMission: variable to each entry.

Spoiler:
Code: [Select]
# [=] Low Threat [=]
  - id: STR_IAR_LOW_THREAT
    retaliationMission: STR_ALIEN_RETALIATION

# [=] Intermediate Threat [=]
  - id: STR_IAR_INTERMEDIATE_THREAT
    retaliationMission: STR_ALIEN_RETALIATION_ADVANCED

# [=] High Threat [=]
  - id: STR_IAR_HIGH_THREAT
    retaliationMission: STR_ALIEN_RETALIATION_ELITE

Unfortunately the retaliation UFO with the wrong race is still appearing.

I've attached a new version of the mod and also a save game that is at the end of the month. At the start of the next month (Should be February) two UFOs will spawn, the 2nd one will be the retaliation UFO with the incorrect race.

Oddly the saved game only spawns the UFO (Alien Sub-10) with the wrong race if I load the saved game and then activate debug mode before the next month begins. (Advanced Options: Save scumming = NO)

If the saved game is loaded and debug is re-activated on Jan 31 2040.
Spoiler:

If the saved game is loaded and debug is NOT re-activated before February starts.
Spoiler:

If it is the debug unlocking STR_THE_ULTIMATE_THREAT research and starting the researchRetaliation mission script shouldn't that be spawning STR_ALIEN_RETALIATION_ELITE which is configured to always spawn the "High Threat" race.
Spoiler:
Code: [Select]
missionScripts:

# [=] Alien Retaliation - Research [=] <Elite>
  - type: researchRetaliation
    missionWeights:
      0:
        STR_ALIEN_RETALIATION_ELITE: 100
    researchTriggers:
      STR_THE_ULTIMATE_THREAT: true
    startDelay: 150
    targetBaseOdds: 100
    useTable: false
    label: 3

Code: [Select]
missionScripts:

# [=] Alien Retaliation [=] <Elite>
  - type: STR_ALIEN_RETALIATION_ELITE
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_HIGH_THREAT: 100
    waves:
      - ufo: STR_SURVEY_SHIP_ELITE
        count: 1
        trajectory: P8
        timer: 3000
      - ufo: STR_ESCORT_ELITE
        count: 2
        trajectory: P8
        timer: 3000
      - ufo: STR_CRUISER_ELITE
        count: 3
        trajectory: P8
        timer: 3000
      - ufo: STR_DREADNOUGHT_ELITE
        count: 2
        trajectory: P8
        timer: 3000

Could it be the anchor and refNode: is duplicating the "STR_IAR_LOW_THREAT: 100" raceWeights: in both the Advanced & Elite versions causing the lists to unintentionally read like this:
Spoiler:
Code: [Select]
# [=] Alien Retaliation [=]
  - &STR_ALIEN_RETALIATION
    type: STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 100


# [=] Alien Retaliation [=] <Advanced>
  - type: STR_ALIEN_RETALIATION_ADVANCED
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 100 # <====== Potential unexpected duplication
          STR_IAR_INTERMEDIATE_THREAT: 100


# [=] Alien Retaliation [=] <Elite>
  - type: STR_ALIEN_RETALIATION_ELITE
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 100 # <====== Potential unexpected duplication
          STR_IAR_HIGH_THREAT: 100

Instead of this?
Spoiler:
Code: [Select]
# [=] Alien Retaliation [=] <Advanced>
  - type: STR_ALIEN_RETALIATION_ADVANCED
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_INTERMEDIATE_THREAT: 100


# [=] Alien Retaliation [=] <Elite>
  - type: STR_ALIEN_RETALIATION_ELITE
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_HIGH_THREAT: 100
« Last Edit: February 04, 2023, 03:04:54 am by The Martian »

Offline Buscher

  • Colonel
  • ****
  • Posts: 168
    • View Profile
Re: Retaliation missions are spawning with unexpected results?
« Reply #3 on: February 04, 2023, 10:55:56 am »
Quote
Could it be the anchor and refNode: is duplicating the "STR_IAR_LOW_THREAT: 100" raceWeights: in both the Advanced & Elite versions causing the lists to unintentionally read like this:
Spoiler:
Code: [Select]
# [=] Alien Retaliation [=]
# [=] Alien Retaliation [=] <Elite>
  - type: STR_ALIEN_RETALIATION_ELITE
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 100 # <====== Potential unexpected duplication
          STR_IAR_HIGH_THREAT: 100


This is exactly what happens (see attached screenshot).

You will need to set
Code: [Select]
# [=] Alien Retaliation [=] <Elite>
  - type: STR_ALIEN_RETALIATION_ELITE
    refNode: *STR_ALIEN_RETALIATION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 0 # <--------------
          STR_IAR_HIGH_THREAT: 100

You will also need to do that if you ever want to disable missions created by regions.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Retaliation missions are spawning with unexpected results?
« Reply #4 on: February 05, 2023, 02:41:54 am »
I added raceWeights: STR_IAR_LOW_THREAT: 0 to all Advanced & Elite entries in the alienMissions: section.
Code: [Select]
alienMissions:

# [=] Alien Probe Mission [=]
  - &STR_ALIEN_PROBE_MISSION
    type: STR_ALIEN_PROBE_MISSION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 100

# [=] Alien Probe Mission [=] <Advanced>
  - type: STR_ALIEN_PROBE_MISSION_ADVANCED
    refNode: *STR_ALIEN_PROBE_MISSION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 0
          STR_IAR_INTERMEDIATE_THREAT: 100


# [=] Alien Probe Mission [=] <Elite>
  - type: STR_ALIEN_PROBE_MISSION_ELITE
    refNode: *STR_ALIEN_PROBE_MISSION
    raceWeights:
      0:
          STR_IAR_LOW_THREAT: 0
          STR_IAR_HIGH_THREAT: 100

Reloaded the saved game and turned on debug mod... Alien Sub-10 spawned and:
Spoiler:

It works!


Thank you for the help. ^_^