Author Topic: A base defense system  (Read 4542 times)

Offline TrickyTriscene

  • Sergeant
  • **
  • Posts: 21
    • View Profile
A base defense system
« on: August 08, 2021, 03:44:43 pm »
At the moment it is all or nothing, you need 2x4 PWT or it is pointless.
Some new principles I had in mind:
- If you have no defenses at all you are punished, invading ships will first fire some missiles, damaging some facils. If you have some defenses (more needed as time progresses, aliens get more aggressive), they will be in a hurry and not shoot before fight.
- Defenses damage like dogfight weapons and use their ammo too, but alien ships only need to be damaged for 50% before they flee or go down.
- Torpedo def uses Ajax or Dup torpedos. So two types of torp defenses.
- Gauss def uses no ammo (I elimed gauss cann ammo from the game) and Sonics use 1 Zrb per shot (like my modded Sonic oscs).
- Similar defenses (Beam or Torpedo) can be upgraded to one another in just a few days. So it makes sense to make Torp defs first.
- Bomb shield doesn't double firepower. It helps intercept missiles (60% intercepts).
- Damaging the invading ship kills aliens; for this to be more fun, you have to see a log. Therefore if a trans resolver covers the base site, you get to see what was killed (the aliens radio it back to base don't they).
- You get to prearrange your aquanauts exactly by pressing some button in base screen. It looks like the defense mission but without aliens. You must either have defenses or have the invader on radar to get your men on their positions, or they will be scattered.
- If aliens fail twice approaching your base they stop sending single ships. After a long time planning they will send a group of three, two bombard missions trying to damage your turrets and then the invader. If this fails to reach you, they leave the base alone, most of the time.
- Bombards should damage things like defenses, Bomb shield, Sonar and Resolver, MC generator, Alien containment (losing some captives), sub pen (losing sub ammo). So not the living quarters losing the men or stores losing your items.

Defenses should be faster to build, like Ajax 16, Dup 18, PWT 20, Gauss 20 and Sonic 24. PWT should be cheaper because it's less powerful. (and not that different from other torps). Like 500k.
An upgrade could be 4 days, and not full price of new type.

PWTs have an EMP effect, I was thinking of translating that into a spell effect. 40% per PWT chance for the effect Slow and 20% Disable missiles.
Each defense type has its number of shots per invasion, like PWT 1, Dup 2, Ajax 3, Gauss and Sonic 4.
The effect of the slow spell is that you get extra shots on all other weaps except PWT: one on torps and 2 on beams.
Obviously, you should combine things, not just have PWTs nor have no PWTs at all.
Gauss should have better stats than its ship counterpart or its too weak compared to Sonic. (After all it's easier to hit base to ship than ship to ship.)

If they flee you could chase them and shoot down with little because they are already close to 50% hp.
It could be diffy level dependent how much damage they take before they flee. But also game month dependent, aliens get frustrated with time.
If you down a ship with your defenses, you shouldn't get loot right away, you should just get a crash site close to base, that you can raid.

If aliens shoot if you don't shoot, you can't just choose "let them in". That option would be replaced by "shoot 50% fire rate".
If aliens also attack with lesser ships than Dreadnought, or attack in groups with different missions (bombard/invade), we might need options which weapon types to fire per attacking sub. Like use only the ammo-free Gauss defs on smaller attackers.
« Last Edit: August 23, 2021, 02:17:47 am by TrickyTriscene »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: A base defense system
« Reply #1 on: August 08, 2021, 10:27:49 pm »
My megamod Reaver's Harmony has a solution to this, though it's a bit complicated. The simplest thing you can do is to use
Code: [Select]
lessAliensDuringBaseDefense: true (not nested).
- - - - -
This makes it so that if base defense facilities deal, say, 43% damage to the ship, it will have about 43% less aliens dropping into the base. I'm not sure how all of the math works and how granular it really is, but I definitely have experienced it working. However, there is a minimum of one alien of each rank available on the ship, so a ship that already had exactly one of each of its ranks would not lose any units. You could experience this with the vanilla Small Scout if you had a defense facility which dealt partial damage to it, it would always drop 1 soldier into your base regardless how many hit points it lost. A vanilla Battleship will always drop 1 commander, even if most of the soldiers don't make it in.

My megamod goes several steps further. Several different sizes of alien craft may attack the player's base. I have shields on various alien craft, with bigger and more advanced craft having a higher fraction of their hit points in shields. Each next larger UFO has a bit more hull hit points and a lot more shields. Base defenses ignore 90% of shields, so while a small UFO and a very large UFO have radically different total hit points in a dogfight, against base defenses their hit points are much less distant from each other. I've actually made base defenses less able to fully obliterate incoming craft, because instead they help mitigate the number of aliens coming in. A single missile defense may or may not destroy a Large Scout even if it hits, while scoring just 2 missile defense hits against a terror ship will usually take off somewhere in the ballpark of half of the aliens.

So there are a lot of ways to tweak it, but getting the results you want may take a lot of work. Or if you want a simple solution, just do "lessAliensDuringBaseDefense: true". And if you're interested, maybe give my megamod a go and tell me what you think. I am seeking feedback on my base defenses and I appreciate how well you seem to understand them.

- - - - -

You can have alien bases shoot at X-Com bases, and you might be able to make craft do that. I don't know how to do all that. Tech-comm megamod (indev I think, possibly abandoned) has some stuff like that. You could take a peek inside that mod or contact its dev(s). Also ask on the Openxcom discord, in the modding channel, and there are lots of people there who can offer tips and advice.

You can have base defense facilities use ammo in OpenXcom Extended (OXCE). My megamod does this, and plenty of others do as well.

Some of those other things might be doable with scripting, but I don't know scripting very well.
« Last Edit: August 09, 2021, 09:12:25 am by The Reaver of Darkness »

Offline Kissaki

  • Sergeant
  • **
  • Posts: 27
    • View Profile
Re: A base defense system
« Reply #2 on: November 14, 2021, 12:48:31 am »
My megamod Reaver's Harmony has a solution to this, though it's a bit complicated. The simplest thing you can do is to use
Code: [Select]
lessAliensDuringBaseDefense: true (not nested).
- - - - -
This makes it so that if base defense facilities deal, say, 43% damage to the ship, it will have about 43% less aliens dropping into the base.
Wait a minute... I thought this is how it was originally? So when I have been playing vanilla, all the damage I've inflicted which has fallen short of downing the UFOs, has amounted to a bag of beans?

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: A base defense system
« Reply #3 on: November 14, 2021, 01:39:46 am »
yep, you either destroy UFO or not. That makes weak defense practically useless

Offline TrickyTriscene

  • Sergeant
  • **
  • Posts: 21
    • View Profile
Re: A base defense system
« Reply #4 on: November 14, 2021, 02:20:35 pm »
This is a classic example why vanilla shouldn't be sacred. Some tweaking can make it a deeper game. Same with the research tree.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: A base defense system
« Reply #5 on: November 17, 2021, 07:32:01 pm »
Wait a minute... I thought this is how it was originally? So when I have been playing vanilla, all the damage I've inflicted which has fallen short of downing the UFOs, has amounted to a bag of beans?
Yep. I used to think that if you shot stuff down with cannons, the ship wouldn't be destroyed. It had happened to me multiple times in a row without fail after my "discovery", but empirical testing on original versions reveals it to have been sheer coincidence. And at 25% odds for medium and large scouts, the odds aren't even that low. I thought I had a memory of having used it successfully against a supply ship (1/64 intact), but deeper memory digging reminded me I had gotten a stack overflow before the ship went down. Apophenia, lack of sufficient data, lots of incorrect conclusions. We all do it!