Author Topic: [DONE][Suggestion] Instant xcom base defense  (Read 5381 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8974
    • View Profile
[DONE][Suggestion] Instant xcom base defense
« on: October 12, 2022, 08:59:49 pm »
This feature introduces a new mission objective type (similar to e.g. 1 = infiltration, 5 = alien base supply, etc.).

Syntax: An existing integer attribute on alien missions, new value 6 (OBJECTIVE_INSTANT_RETALIATION): `objective: 6`

It works similar to the vanilla Retaliation mission objective (id = 4), with the following differences:
1. It cannot spawn UFOs in regular mission waves
2. It can spawn a maximum of one retaliation UFO... after that the mission terminates
3. It spawns the UFO only if an xcom base is present in the given region... otherwise no spawn and mission terminates
4. The xcom base does not need to be detected by aliens
5. The UFO is spawned directly on top of the xcom base
6. The UFO is undetectable (also ignoring detection Y-scripts)
7. The mission does not count as standard Retaliation, i.e. is not triggered when shooting down UFOs; and is not limited to 1 per region
8. When the battle ends, the xcom base keeps its detection status (i.e. it doesn't interact with standard Retaliation logic)

Example:

Code: [Select]
missionScripts:
  - type: gameStartX
    targetBaseOdds: 100         # please spawn in a region with an xcom base
    missionWeights:
      0:
        STR_ALIEN_RETALIATION_INSTANT: 100
    startDelay: 120

Code: [Select]
alienMissions:
  - type: STR_ALIEN_RETALIATION_INSTANT
    points: 0
    objective: 6                # the new objective type
#    ignoreBaseDefenses: true
    spawnUfo: STR_BATTLESHIP    # this is the UFO that will be spawned
    waves:
      - ufo: STR_BATTLESHIP     # just put something here, doesn't matter
        count: 1
        trajectory: P8
        timer: 3000
    raceWeights:
      0:
        STR_SECTOID: 20
        STR_FLOATER: 20
« Last Edit: November 03, 2022, 10:05:45 am by Meridian »

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant retaliation
« Reply #1 on: October 29, 2022, 09:04:53 pm »
In simple words, this mission is a single strike on a previously discovered base that cannot be repelled by a UFO interception?
And a few questions:
1) Can bombardment be used?
2) Is it possible to do several of these missions with different ships (important for the strength of the necessary air defense)?
3) In the case of installing Mental Shields, is there any chance of avoiding such missions? How does this type of mission work with Mental Shield in general?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8974
    • View Profile
Re: [DONE][Suggestion] Instant retaliation
« Reply #2 on: October 29, 2022, 09:10:11 pm »
1/ yes
2/ yes
3/ Mind Shields have no effect

...and one correction to your statement: the xcom base doesn't need to be previously detected
« Last Edit: October 29, 2022, 09:12:52 pm by Meridian »

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant retaliation
« Reply #3 on: October 30, 2022, 02:21:05 am »
Hardcore! But I like. In the DOS TFTD ... and in the UFO too, it sometimes happened that the ships attacking the base spawned right above the target, making it impossible to intercept them on approach. I even missed this AI cheating. Thank you.

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant retaliation
« Reply #4 on: November 03, 2022, 09:54:39 am »
One more question - can such missions be divided into alien races via "retaliationMissionWeights"? If not, is it planned?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8974
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #5 on: November 03, 2022, 10:03:31 am »
These new missions are intentionally not treated as retaliations. They can't normally be generated after UFO is shot down during dogfight (EDIT: unless you force them to spawn using "retaliationMissionWeights").

Official support for this is not planned.

The "instant retaliation" name is probably confusing, I should have named it "instant xcom base defense".
« Last Edit: November 03, 2022, 11:35:41 am by Meridian »

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #6 on: November 03, 2022, 10:58:50 am »
I understand. And is it possible to use missions such as missions from alien bases within the limit of their detection? Ie in "huntMissionWeights"?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8974
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #7 on: November 03, 2022, 11:11:43 am »
Purely technically speaking, it is possible to put any mission into "retaliationMissionWeights".

You can try hunt missions, you can even try the instant retaliation missions...
... I just can't guarantee they will work properly.

They were never intended to be used this way and there will be situations, in which their functionality conflicts with functionality of other missions or the overall game itself.

Use at your own risk.

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #8 on: November 03, 2022, 12:14:56 pm »
How to conflict? The fact that the alien base will generate such missions is quite logical. And in the absence of alien bases on the map, the player is protected from such surprises. Isn't there?

In short - can "objective: 6" work with an alien race and only in a region defined alien base?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8974
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #9 on: November 03, 2022, 01:12:08 pm »
I have never tested such combinations, and I have also not considered them during design and implementation.
I simply don't know what could possibly happen.
Maybe I'm being too pessimistic...

I have followed the requirements in this thread: https://openxcom.org/forum/index.php/topic,8015.0.html
Nothing more, nothing less.

The only (official) feedback I can give is: give it a try, see what happens.

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #10 on: November 03, 2022, 02:09:20 pm »
Thank you. Let's try and experiment.

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #11 on: January 04, 2023, 01:45:58 am »
Happy New Year Meridian.
In general, this mission does not work with bases, that is, with the "operationType: 1" function. It generates normally in a region with an alien base and an X-COM base. But it is also generated in other regions with X-COM bases. In this case, in the absence of the "raceWeights" list, an error occurs. In short, "objective: 6" doesn't work with "operationType: 1". But it works great as a regular monthly mission. Moreover, in this format, a random X-COM base falls under attack, even those that were not detected by aliens.

Offline TBeholder

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #12 on: January 04, 2023, 02:03:53 pm »
Happy New Year!
The "instant retaliation" name is probably confusing, I should have named it "instant xcom base defense".
Like… “sneak attack”?

It would do well with those surface base level mods. And a supply truck placed as “UFO”.  :D
In general, this mission does not work with bases, that is, with the "operationType: 1" function. It generates normally in a region with an alien base and an X-COM base. But it is also generated in other regions with X-COM bases.
Maybe there should be some generic mechanism to tell them apart?..
I mean, they search for a base only as a part of retaliation mission, and then… just forget about it and this does not affect their other operations?
« Last Edit: January 04, 2023, 02:06:48 pm by TBeholder »

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #13 on: January 04, 2023, 06:39:33 pm »
Maybe there should be some generic mechanism to tell them apart?..
I mean, they search for a base only as a part of retaliation mission, and then… just forget about it and this does not affect their other operations?

Maybe I didn't understand the question, but the base-generated mission determines the alien race of the mission. This is exactly what doesn't work with "objective: 6" because if "raceWeights" is not set in "alienMissions" or in "missionScripts" then there will be an error.

Offline Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
Re: [DONE][Suggestion] Instant xcom base defense
« Reply #14 on: August 08, 2023, 04:29:20 pm »
A few suggestions for further development of this functionality:
1. Now the attacking UFO appears instantly and immediately on the player's base. I would like to be able to customize the trajectory of the UFO so that it flies to the player's base as it does the last UFO in the original retaliation mission (generated in "spawnUfo"): from a random point in a straight line to the player's base. This way, the player may have the possibility to intercept such a UFO before attacking the base.
For example, the "spawnOnPlayerBase" parameter: when it is in the "true" state, the UFO will be generated instantly at the player's base (as it works now). When it in "false" state, the UFO is generated away from the base and flies to the player's base.
Code: [Select]
alienMissions:
  - type: STR_ALIEN_RETALIATION_INSTANT
    points: 0
    objective: 6                # the new objective type
#    ignoreBaseDefenses: true
    spawnUfo: STR_BATTLESHIP    # this is the UFO that will be spawned
    spawnOnPlayerBase: false    # true by default
    waves:
      - ufo: STR_BATTLESHIP     # just put something here, doesn't matter
        count: 1
        trajectory: P8
        timer: 3000
    raceWeights:
      0:
        STR_SECTOID: 20
        STR_FLOATER: 20

2. I would like to specify the number of UFOs attacking the player's base, not just one.
For example, their number should be specified in the new parameter "spawnUfoCount", and the interval of their generation would be set in the parameter "spawnUfoTimer". This is true for both the regular retaliation mission and this new instant retaliation mission.
Code: [Select]
alienMissions:
  - type: STR_ALIEN_RETALIATION_INSTANT
    points: 0
    objective: 6                # the new objective type
#    ignoreBaseDefenses: true
    spawnUfo: STR_BATTLESHIP    # this is the UFO that will be spawned
    spawnUfoCount: 2            # 1 by default
    spawnUfoTimer: 320          # 0 by default. How long after the previous UFO should this UFO arrive? (in minutes)
    waves:
      - ufo: STR_BATTLESHIP     # just put something here, doesn't matter
        count: 1
        trajectory: P8
        timer: 3000
    raceWeights:
      0:
        STR_SECTOID: 20
        STR_FLOATER: 20

3. How about adding retaliation UFO generation to the "waves" section (in addition to "spawnUfo")?
For example, a wave that should generate UFOs to attack the player base could be labeled with "isRetaliationWave: true". UFOs from such a wave would not be generated if previous "normal" waves have not found the player's base. The "trajectory" parameter in this wave is ignored: UFOs fly in a straight trajectory to attack the base. This opens up the possibility to make several waves to attack the player's base, between which there can be normal waves searching for the player's base.
Code: [Select]
alienMissions:
  - type: STR_ALIEN_RETALIATION
    points: 0
    objective: 4
    spawnUfo: STR_BATTLESHIP
    waves:
      - ufo: STR_BATTLESHIP
        count: 1
        trajectory: P8
        timer: 3000
      - ufo: STR_BATTLESHIP
        count: 2
        isRetaliationWave: true        # false by default
        trajectory: P8
        timer: 3000
      - ufo: STR_BATTLESHIP
        count: 3
        trajectory: P8
        timer: 3000
      - ufo: STR_BATTLESHIP
        count: 1
        isRetaliationWave: true        # false by default
        trajectory: P8
        timer: 3000
    raceWeights:
      0:
        STR_SECTOID: 20
        STR_FLOATER: 20