Author Topic: [DONE] [Suggestion] Alien missile strikes  (Read 12273 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8598
    • View Profile
[DONE] [Suggestion] Alien missile strikes
« on: October 12, 2018, 10:30:01 pm »
EDIT: topic split from: https://openxcom.org/forum/index.php/topic,6557.0.html


2) Retaliation UFOs can destroy XCom bases without any base defense taking place

As it says, once the final retaliation run begins there's no way to stop it short of defense facilities firing. If they fail, then the base is automatically destroyed.

This simulates a missile strike (or a saboteur/infiltrator) and if that sounds too extreme for some, it could be suggested to have a flag on base facilities that defines whether the facility will be destroyed or not by such a strike (underground facilities would survive, surface ones would not), but that would require a ton of more work and I only need the full destruction part at this point.

Destroying the whole base:

Code: [Select]
ufos:
  - type: STR_BATTLESHIP
    missilePower: -1                 # -1 means destroy everything

Destroying only a few random facilities:

Code: [Select]
ufos:
  - type: STR_BATTLESHIP
    missilePower: 5                 # N means destroy N 1x1 buildings or equivalent

This second part is a bit more complicated.
2x2 buildings count for 4, 3x3 buildings count for 9 and so on...

But missilePower 1 can destroy also 2x2 and 3x3 buildings... missilePower 2 however cannot destroy two 2x2 buildings.

Probably best to give example:

missilePower: 2 can destroy:
- two 1x1 buildings
- one 1x1 building and one 2x2 building
- one 2x2 building
- one 3x3 building... or 4x4, 5x5, 6x6 ... i.e. as soon as it "starts" destroying a building, it finishes destroying it

missilePower: 5 can destroy:
- 1, 1, 1, 1, 1
- 1, 1, 1, 1, 2
- 1, 1, 1, 2
- 1, 1, 2
- 1, 2
- 2, 1
- 2, 2
- 3 (or bigger)

Access lift cannot be destroyed (unless you destroy the whole base with missilePower: -1).
If a base has only 5 buildings, and missile power is 200... access lift still remains :)

Translations:

Code: [Select]
  STR_ALIEN_MISSILES_HAVE_DAMAGED_OUR_BASE: "Alien missiles have damaged our base {0}"
  STR_ALIEN_MISSILES_HAVE_DESTROYED_OUR_BASE: "Alien missiles have destroyed our base {0}"
« Last Edit: October 29, 2018, 07:46:05 pm by Meridian »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #1 on: October 15, 2018, 07:16:39 pm »
I've implemented all 3 new features in Tech-Comm yesterday and testing has gone smoothly so far.

"Destroying only a few random facilities" was a nice bonus added by Meridian since my initial suggestion was to completely remove the base. I've used this to implement enemy bombers that will attack and damage the player's bases, which allows to reduce the higher number of base defense missions, and makes defense facilities even more necessary.

I'm on the process of balancing the new features and there are two possible suggestions talked over the Discord channel:
1) Make optional the requirement that all facilities need to be connected to the Access Lift. This will affect both facility building (you can place facilities anywhere) and prevent their removal if something gets destroyed and they're not connected to the lift anymore. The caveat will be that the base defense terrain needs to be redesigned so that movement between all existing base modules is still possible with empty space between facilities (so this won't work with the vanilla base defense terrain)

2) Add a flag for impregnable facilities (that can't be damaged by enemy air attacks). This can be used with the vanilla base terrain (the Access Lift already can't be destroyed by aerial attack) or modders can also redesign their base facilities. In Tech-Comm I've designed the base facilities/terrain from the start so that there are both ground level and underground versions of most facilities (Living Quarters, Stores, etc.)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #2 on: October 16, 2018, 03:02:29 pm »
I agree it would be useful to be able to indicate buildings as impervious to bombardment, since the lift already is (if I'm not mistaken), and OXCE is about unhardcoding stuff.
The connectivity to the access lift issue would be worth pursuing, but I think only as part of a larger redesign.

Offline R1dO

  • Colonel
  • ****
  • Posts: 436
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #3 on: October 16, 2018, 05:25:04 pm »
Just a thought here.

Instead of destroying the facility. Why not convert it to "building-type" rubble.
Either 4-way connected or 2-3 side connected (like the corridors mod).

In that case you do away with the problem of connectivity.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #4 on: October 16, 2018, 06:09:49 pm »
Just a thought here.

Instead of destroying the facility. Why not convert it to "building-type" rubble.
Either 4-way connected or 2-3 side connected (like the corridors mod).

In that case you do away with the problem of connectivity.

That's a good idea to solve the connectivity issue, if there's a special 'rubble' facility that still allows connection with the other base modules (with corridors).

However, there are two separate issues that would need to be addressed:
1) limiting the damage to the single building that is hit (and not losing any connected ones)
2) ensuring that friendly units can reach any facility that has become isolated because of the missile strike. Tech-Comm base terrain is designed that it solves the 2nd issue (with a ground level) but on vanilla it will require some change.

With the current installment of Tech-Comm the first issue is minor because the damage has been implemented in a low setting for balance, so that the player will simply assume that the missile destroyed additional buildings with the strike. But other modders might find those two additions useful.
« Last Edit: October 16, 2018, 06:17:43 pm by Hobbes »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #5 on: October 19, 2018, 06:49:16 pm »
The connectivity to the access lift issue would be worth pursuing, but I think only as part of a larger redesign.

Been thinking about the whole connectivity issue and there's an aspect that I failed to consider with the connectivity, namely how it limits facility building - to build in a row from A to C, you need to build first facility A, then B, then C.

This is basically a road bump so that you can't build all 36 slots at the same time, and it's a necessary one for a number of reasons - as Solarius said, connectivity would be worth pursuing but only as a part of larger redesign, which I'm not interested at this point.

Offline R1dO

  • Colonel
  • ****
  • Posts: 436
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #6 on: October 20, 2018, 08:30:12 pm »
First of all a small disclaimer, since i am not that familiar with the capabilities of OXCE+ i might make some wrong assumptions.

Been thinking about the whole connectivity issue and there's an aspect that I failed to consider with the connectivity, namely how it limits facility building - to build in a row from A to C, you need to build first facility A, then B, then C.

This is basically a road bump so that you can't build all 36 slots at the same time, and it's a necessary one for a number of reasons - as Solarius said, connectivity would be worth pursuing but only as a part of larger redesign, which I'm not interested at this point.

I was under the impression OXCE+ allows replacing buildings, now if i assume the original tile stays available during the build phase of replacing why not use the following approach:

* When building a new base start with tiles that are of a building type that allows omnidirectional connectivity.
  - Either as default tile upon base construction or a building type with 0-day construction (like the access lift).
  - For instance "sewers" , "caves" or plain "ground level fields" (last one will require each facility to have some sort of access to the ground level, otherwise you risk having "disconnected" tiles during construction).
* Now the player can replace/upgrade those tiles as desired
* Optional: Let the player remove those tiles that are not needed for connectivity so it can still have "choke point" defensive base layout (although this might need a connectivity check when removing).

Could this work?

...
However, there are two separate issues that would need to be addressed:
1) limiting the damage to the single building that is hit (and not losing any connected ones)
2) ensuring that friendly units can reach any facility that has become isolated because of the missile strike. Tech-Comm base terrain is designed that it solves the 2nd issue (with a ground level) but on vanilla it will require some change.

Since it is sometimes hard to gets ones ideas clear using written text let's try to elaborate a bit.

1) I believe it is not so much part of the base building concept but a functionality of the missile strike routine. Hence the proposal to "convert" the targeted tile to the "rubble building", instead of removing it.
2) If using the "convert" routine this should not be a problem under the condition the mod provides a "rubble" facility with appropriate connectivity.

Hope i made myself a bit clear.


Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8598
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #7 on: October 28, 2018, 10:47:48 am »
Added 2 more features for missiles:

1. instead of destroying a facility (and disconnected facilities too)... we can just replace the facility with rubble... defined as a global parameter (a name of a 1x1 facility)

Code: [Select]
destroyedFacility: STR_RUBBLE

2. added weights to facilities (default 100), so you can affect which ones are more or less likely to be hit; or even which are protected (weight 0, or access lift)

Code: [Select]
facilities:
  - type: STR_HYPER_WAVE_DECODER
    missileAttraction: 500     # 5x more likely to be hit
  - type: STR_HANGAR
    missileAttraction: 25     # 4x less likely to be hit
  - type: STR_SUPEREXPENSIVE_HQ
    missileAttraction: 0     # cannot be hit

Is that OK so or are there more ideas and/or objections?

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #8 on: October 28, 2018, 11:09:29 am »
MissileAttraction -> AirStrikeRisk ?  :-[ :-X

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8598
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #9 on: October 28, 2018, 11:17:57 am »
MissileAttraction -> AirStrikeRisk ?  :-[ :-X

I don't understand the question.

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #10 on: October 28, 2018, 01:06:00 pm »
I apologize, but in my opinion the attribute could be renamed ;)

Offline Ethereal

  • Commander
  • *****
  • Posts: 619
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #11 on: October 28, 2018, 06:00:33 pm »
Is that OK so or are there more ideas and/or objections?

And if the base defense was disabled by the player intentionally, will the UFO bomb the base? The idea is that the UFO bombs the base precisely because of the fact that the UFO was shot from the base. Or did I misunderstand?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8598
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #12 on: October 28, 2018, 06:06:27 pm »
And if the base defense was disabled by the player intentionally, will the UFO bomb the base? The idea is that the UFO bombs the base precisely because of the fact that the UFO was shot from the base. Or did I misunderstand?

In this case, the player cannot disable base defense, it will start automatically.

Also, there is no UFO as such... this is meant to represent an intercontinental ballistic missile (or its alien equivalent).

So all options for such "UFO missile" are:
1. it gets shot down by base defenses
2. it doesn't get shot down and destroys some facilities on impact
3. it doesn't get shot down and destroys the whole base on impact

Battlescape base defense doesn't occur at all.

Offline Ethereal

  • Commander
  • *****
  • Posts: 619
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #13 on: October 28, 2018, 06:31:01 pm »
Understood. Specialized UFO-bomber, which can be shot down and make a ground mission, but the attack on the base, he does not make a landing mission, and bombs and flies back. Great idea! Thanks.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: [DONE] [Suggestion] Alien missile strikes
« Reply #14 on: October 28, 2018, 06:37:52 pm »
Understood. Specialized UFO-bomber, which can be shot down and make a ground mission, but the attack on the base, he does not make a landing mission, and bombs and flies back. Great idea! Thanks.

The UFO-bomber can be shot down by craft, if it is detected and intercepted on its way to the target, or it can be shot down down by base defenses before it performs the bombing. It can also be given an avoidBonus and/or high speeds to prevent craft/base defenses from destroying it, in order to replicate a missile rather than a bomber craft.

The UFO-bomber/missile doesn't fly back after the bombing, it simply disappears (like vanilla)

--- posts merged ---

@Meridian,

I was looking at the code dealing with alien missile strikes and I have a question: when selecting which facility will be hit, does the code favor larger (2x2) structures? Naturally 2x2 facilities have 4 times the odds of being hit than a 1x1 structure because they occupied a larger area, but from looking at the code it seemed to me that larger facilities will always be selected first for destruction. Did I misunderstood the code?
« Last Edit: October 29, 2018, 01:05:29 am by Solarius Scorch »