OpenXcom Forum

OpenXcom => Suggestions => Topic started by: x60mmx on March 23, 2015, 07:54:10 am

Title: Base Defense Mechanics
Post by: x60mmx on March 23, 2015, 07:54:10 am
I really enjoyed the fact that base defenses in Xenonauts reduced the number of attackers according to how much base defense you had, if it failed to repulse the attack.  Made having some investment in base defense a good idea.  In 20 years of playing X-Com I have never bothered with anything beyond a mind shield and some soldiers waiting around with proximity grenades and blast launchers because I valued other facilities more.  If defenses could reduce the number of attackers, I could see myself actually using them.

Possible?
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: Warboy1982 on March 23, 2015, 09:43:52 am
possible, sure, but i don't really want to pinch things from xenonauts. they have their own thing going on, and i respect that. if we start trying to "ape the competition" then we might give the impression that we're actually trying to compete. i say get both and enjoy them for their differences. xcom, the original series, and xenonauts, the next generation.
(i guess enforcer would be DS9, trying to keep up with modern trends, interceptor would be voyager, flying forever in empty space, and going nowhere, and enemy unknown would be enterprise... no explanation needed.)
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: hellrazor on March 23, 2015, 03:49:28 pm
We already had the idea of adding a crashsite if the Base Defenses were successful in shooting down the Battleship.
I guess that Base defenses weren't really thought completly throu in the original game concept.
But they actually make sense in case you trigger the random Retaliations from Ethereals, by researching The Martian Solution and you do not have the means to deal with an Base Attack vs Ehtereals & Sectopods.
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: Hobbes on March 23, 2015, 04:52:51 pm
I really enjoyed the fact that base defenses in Xenonauts reduced the number of attackers according to how much base defense you had, if it failed to repulse the attack.  Made having some investment in base defense a good idea.  In 20 years of playing X-Com I have never bothered with anything beyond a mind shield and some soldiers waiting around with proximity grenades and blast launchers because I valued other facilities more.  If defenses could reduce the number of attackers, I could see myself actually using them.

Possible?

Xenonauts didn't invent this idea, XCom players did.

The idea of base defenses caused a reduction on the number according to the number of hits scored on attacking UFOs has existed in the XCom community since the game came out.

Quoting from Kasey Chang's Unofficial Strategy Guide (https://www.gamefaqs.com/pc/199362-x-com-ufo-defense-1993/faqs/1825) (published in 2002, my italics): "During a hectic month, total of twelve battleships came after my base. Only one made it through my 3500 pt defense (with grav shield, of course), and its remaining landing parties are easy to wipe out with only HWPs and a few defenders.""

 I think this was proven later to be a fallacy in observation or wishful thinking by XCom players because to my knowledge there isn't any coding for this. Xenonauts took this false impression and implemented it.
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: Warboy1982 on March 24, 2015, 03:43:31 am
yeah, a base with only an access lift and one or no hangars would get a very small invasion party due to the limited number of spawn nodes available. even with three hangars you wouldn't get the full crew spawning on superhuman. in openxcom, however, you will get the full crew on superhuman, regardless.
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: x60mmx on March 24, 2015, 11:28:31 pm
I don't think it would be encroaching on Xenoanuts at all, merely fixing a problem with the game's design.  As it currently stands, there really is no reason to build any defense facilities, besides maybe a mind shield, because it's more effective to defend your base with a small squad equipped for the job.  In the 20 years I have been playing, never once have I thought to myself, "Defense facilities would have been a good idea".

It's not about taking ideas from other games, it's about tweaking things to reduce redundancy in X-Com, which has always been it's largest fault, by a long shot, in my mind.  I'd love for defense facilities to be worth considering.  As it stands, they aren't even worth taking up space in my base for, which is a shame.
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: Solarius Scorch on March 24, 2015, 11:32:20 pm
Wasn't it an option in XComUtil?
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: x60mmx on March 24, 2015, 11:43:35 pm
Not that I remember or according to UFOpaedia.
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: x60mmx on March 27, 2015, 08:57:07 am
Another major note I forgot to mention on why I never use base defenses.  Let's say they work and blow up the battleship.  The aliens just send another, the another, etc.  To get them to stop you still have to fight a base defense, so what's the point?  Might as well just leave a defense party at base and use the facility space for other stuff.

If base defenses causing casualties to the raiding party is being frowned upon for being lifted from Xenonauts, how about some other mechanic for defenses to aid in the inevitable base defense mission?  Perhaps injuring portions of the raiding party so they are easier to kill or causing lowered morale?
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: Jstank on March 27, 2015, 10:57:03 pm
I like this idea A lot. But what if a successful shoot down of a incoming battle ship netted a crashed battleship to clean up right outside  your base location. Would that give you incentive to make some room for the defenses?
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: x60mmx on March 27, 2015, 11:40:06 pm
Personally? No.  A crashed Battleship means a lot of well equipped aliens for an average of 50 elerium, I'd let them repair and leave.

Having crashed battleships from base defenses would also just drop a steady supply of stuff at your doorstep and would be easily exploitable.  Build enough defense to render you impervious and that battleships will keep coming indefinitely and piling up crash sites without ever endangering your crafts.  You'd never have to leave your front yard, and even if you only got 50 elerium at each site, who cares when you had to fly 5 meters to the site?

Until base defenses have an effect on base defense missions, there will only be 2 ways of going about base defense.  First is to not build any and leave a defense party to deal with raiders and stop the attacks. Second is to build plenty of defense and try not to be annoyed by the constant parade of Battleships knocking on your door. 

Speaking of, the whole assault-your-base flag not getting turned off when a battleship is destroyed by base defenses is pretty lame in how it works.  I get that the aliens still want to destroy your base, but why send one battleship again, when the last got blosn out of the sky before landing?  Shouldn't they send two the next time around?  It would only make sense to me that aliens should increase their assault efforts (inevitably rendering your defenses pointless) or that blowing up an attacking battleship should re.ove the assault-your-base flag, in which case defenses become a tax to avoid a mission.  Hardly satisfying.

Also, with base defenses only mattering if they can shoot down Battleships, what's up with missile and laser defenses?  Without effecting base defense missions they are entirely useless.  Is someone really going to dedicate enough of their base to missile defenses to make them  not totally useless?  Are they just there to trick newbies into wasting resources and facility space?
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: Solarius Scorch on March 28, 2015, 11:50:22 am
Speaking of, the whole assault-your-base flag not getting turned off when a battleship is destroyed by base defenses is pretty lame in how it works.  I get that the aliens still want to destroy your base, but why send one battleship again, when the last got blosn out of the sky before landing?  Shouldn't they send two the next time around?  It would only make sense to me that aliens should increase their assault efforts (inevitably rendering your defenses pointless) or that blowing up an attacking battleship should re.ove the assault-your-base flag, in which case defenses become a tax to avoid a mission.  Hardly satisfying.

Why hardly satisfying? They're there exactly to avoid the defence tactical mission, that's obviously their primary (and only) role. If you want to fight, why build them?

Also, with base defenses only mattering if they can shoot down Battleships, what's up with missile and laser defenses?  Without effecting base defense missions they are entirely useless.  Is someone really going to dedicate enough of their base to missile defenses to make them  not totally useless?  Are they just there to trick newbies into wasting resources and facility space?

That recent update with mission handling is the first step to giving us tools to enable other craft to assault the base. Hopefully.
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: x60mmx on March 28, 2015, 07:57:57 pm
Why hardly satisfying? They're there exactly to avoid the defence tactical mission, that's obviously their primary (and only) role. If you want to fight, why build them?

Touche.  Perhaps my bitterness with how base defenses currently play out was toying with my reasoning there :-P

I did consider other ufo types being able to assault your base an option.  If UFOs that could be repelled by lower level defenses actually attempted, they would suddenly prove useful.  This would add some complication to base building/management, which I am not really opposed to. 

What if base defenses could attack UFOs with a certain radius of your base?  Missile defenses at radar posts could suddenly prove useful for attacking small UFOs that pop up far from your main bases.
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: Solarius Scorch on March 29, 2015, 01:11:01 am
I did consider other ufo types being able to assault your base an option.  If UFOs that could be repelled by lower level defenses actually attempted, they would suddenly prove useful.  This would add some complication to base building/management, which I am not really opposed to.

Yeah.

What if base defenses could attack UFOs with a certain radius of your base?  Missile defenses at radar posts could suddenly prove useful for attacking small UFOs that pop up far from your main bases.

Maybe. That distance would be rather small, though - especially for direct beam weapons which require a straight line, so we're talking up to 20 km maybe (against very high altitude targets).
Title: Re: Base Defense Mechanics
Post by: x60mmx on March 29, 2015, 11:19:10 am
Beam weapons would be inherently limited in range, but missile defenses could easily have a greater range.  Though that would bring up far more issues with game balance in the air supremacy department than I think it would solve to be honest. :-/
Title: Re: Base Defense Mechanics
Post by: pilot00 on March 30, 2015, 11:53:11 pm
Call me silly but I cant understand the problem at hand?

If you want your base to be assulted leave it bare bones and with a security force.
If you want to get past that annoying mission you just build 5 plasma/fussion batteries and a grav shield and you are set. They are not gonna miss that much.
The mind shield depends on wheather they have scouted your base before hand as far as I know, because if they did and you built it afterwards its useless.

Laser and missile defenses seem to be useless either way and the mission itself is only supposed to be an annoyance than actuall danger (I cant remember ever losing a base).
Title: Re: Base Defense Mechanics
Post by: x60mmx on March 31, 2015, 01:45:11 am
It's just the way that the defense section of the game is implemented.  Build a bunch of the best research-able defenses to get any benefit.  Build any of the earlier defenses, or not enough higher defenses and you get nothing.

On a slightly different angle from different UFOs attacking bases option, what if early base attacks were conducted by small and very fast UFOs?  Early attacks could be one or two and carry a small party.  As the game progresses they progress into larger groups of larger UFOs.  Having the invading party split into multiple UFOs would also implement a way for defenses to reduce incoming assault parties.  Say 3 UFOs attack, each carrying 6 aliens and you shoot down one.  12 aliens land.  This way, early defenses like missiles could actually make a difference.   

This could be balanced by the higher defenses having higher build and maintenance costs.  Frugal players who don't mind occassional defense missions could choose to have a laser defense that costs far less than a fusion defense and lightens the attacks, which could save him the money he may lose in casualties from a full attack.  Players who do not want base assaults could pay up for full fusion defenses.  Players in the beginning of the game could build a missile defense and actually feel rewarded for his actions if a small UFO attacks early.  I think it could open up the base defense side of the game quite a bit, as well as base logistics.

This should obviously be an optional mod, but I do think it would be a fantastic one.  If the variables necessary to make it happen were available to edit, I would gladly make it.  Namely which UFOs do which missions.
Title: Re: Base Defense Mechanics
Post by: redv on March 31, 2015, 03:07:59 am
The best using of base defense is if it could be shoot down UFOs, flying nearby.
At least it will be funny:)
Title: Re: Base Defense Mechanics
Post by: Solarius Scorch on March 31, 2015, 11:29:21 am
On a slightly different angle from different UFOs attacking bases option, what if early base attacks were conducted by small and very fast UFOs?  Early attacks could be one or two and carry a small party. As the game progresses they progress into larger groups of larger UFOs.

Sure it would be best, but it's not feasible. You can assign the retaliation run to some other UFO, but the landing party will be the same - you can't define separate deployments for different UFOs.

Having the invading party split into multiple UFOs would also implement a way for defenses to reduce incoming assault parties.  Say 3 UFOs attack, each carrying 6 aliens and you shoot down one.  12 aliens land.  This way, early defenses like missiles could actually make a difference.

It'd be nice too.

This could be balanced by the higher defenses having higher build and maintenance costs.  Frugal players who don't mind occassional defense missions could choose to have a laser defense that costs far less than a fusion defense and lightens the attacks, which could save him the money he may lose in casualties from a full attack.  Players who do not want base assaults could pay up for full fusion defenses.  Players in the beginning of the game could build a missile defense and actually feel rewarded for his actions if a small UFO attacks early.  I think it could open up the base defense side of the game quite a bit, as well as base logistics.

This should obviously be an optional mod, but I do think it would be a fantastic one.  If the variables necessary to make it happen were available to edit, I would gladly make it.  Namely which UFOs do which missions.

As I said, you can assign retal to some other UFO (or a number of them, by making more retal missions), but nothing else.
(I haven't really tried doing this, but I assume it's possible judging from the ruleset.)
Title: Re: Base Defense Mechanics
Post by: x60mmx on March 31, 2015, 07:47:23 pm
So I guess defenses reducing assault parties would be the only viable option, and with Warboy not being into it I guess the defenses will stay as redundancy rich as have been.  Oh well.
Title: Re: Base Defense Mechanics
Post by: pilot00 on April 01, 2015, 02:23:39 am
It's just the way that the defense section of the game is implemented.  Build a bunch of the best research-able defenses to get any benefit.  Build any of the earlier defenses, or not enough higher defenses and you get nothing.

On a slightly different angle from different UFOs attacking bases option, what if early base attacks were conducted by small and very fast UFOs?  Early attacks could be one or two and carry a small party.  As the game progresses they progress into larger groups of larger UFOs.  Having the invading party split into multiple UFOs would also implement a way for defenses to reduce incoming assault parties.  Say 3 UFOs attack, each carrying 6 aliens and you shoot down one.  12 aliens land.  This way, early defenses like missiles could actually make a difference.   

This could be balanced by the higher defenses having higher build and maintenance costs.  Frugal players who don't mind occassional defense missions could choose to have a laser defense that costs far less than a fusion defense and lightens the attacks, which could save him the money he may lose in casualties from a full attack.  Players who do not want base assaults could pay up for full fusion defenses.  Players in the beginning of the game could build a missile defense and actually feel rewarded for his actions if a small UFO attacks early.  I think it could open up the base defense side of the game quite a bit, as well as base logistics.

This should obviously be an optional mod, but I do think it would be a fantastic one.  If the variables necessary to make it happen were available to edit, I would gladly make it.  Namely which UFOs do which missions.

I can understand that, but to be honest and assuming things are at least decent I cant see any ufos detecting the base with standing mechanics early on. Making things such as plasma defenses still top tierish (assuming you beeline plasma research). Which is a minor and not that all effective change IMHO.
Title: Re: Base Defense Mechanics
Post by: Jstank on April 01, 2015, 04:31:23 am
I'm going to go throwing wild donuts your way, just be prepared...

Is there some way to trigger the base defense sequence out of a true base attack. For instance. Lets say a small craft does fly over too close to your base, and you actually do have some missile defenses up and running. Now lets say for arguments sake that it will take 2 hits to bring down that UFO before it translates the location of the base to the battleship (it is successful). You are able to shoot this down so the retaliation mission ends up failing. However, if you don't have any defenses the UFO flies harmlessly by AND does succeed and does send a invasion fleet.

Sorry for the food fight, because I don't even know if this is technically feasible.
Title: Re: Base Defense Mechanics
Post by: x60mmx on April 01, 2015, 05:54:54 am
That could be cool.  Very similar to my idea of missile degenses being able to shoot at UFOs.  Only problem is it doesn't really solve the Laser, and to a smaller degree the plasma,  being pointless.
Title: Re: Base Defense Mechanics
Post by: moriarty on April 01, 2015, 12:11:25 pm
just to chime in with an idea I posted a while ago... it would be nice to generally have a mechanic to allow damage to "carry over" from geoscape to battlescape.

the game keeps track of the "damage a UFO takes" anyway, so that could be used to generate an arbitrary amount of damage that is randomly distributed among the aliens inside the UFO at the start of the battle. some would be injured, some would be stunned, some would be killed, depending on the amount of damage the UFO took. this would make base defense facilities useful and add some more believability to UFOs that land after being shot at.

(I'd also extend this to add structural damage to the UFO proportionally to the damage inflicted in the aerial battle, but that's just me...)
Title: Re: Base Defense Mechanics
Post by: Jstank on April 01, 2015, 09:52:50 pm
That could be cool.  Very similar to my idea of missile degenses being able to shoot at UFOs.  Only problem is it doesn't really solve the Laser, and to a smaller degree the plasma,  being pointless.

Nah If you could make it work like that then making all of the defenses useful would be issue of balancing. 2 missile batteries have a 50% chance of shooting down a retaliation mission on a small but one laser defense would take care of a small retaliation mission to 100 % and a large retaliation mission at 50%.

You know just make it so that the larger defenses have a really good chance at shooting smaller ones down and are equal footing with large ones.. scaling ect ect.
Title: Re: Base Defense Mechanics
Post by: redv on April 01, 2015, 10:42:59 pm
Something like that?

(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14633;image)

This button appears only if the base has base defense.
After activating, the defense trying to shoot down nearby UFOs.
If any UFOs will be shot down by the base defense, this base counted as uncovered by aliens and aliens will send a battleship.
Title: Re: Base Defense Mechanics
Post by: pilot00 on April 01, 2015, 11:27:40 pm
^That would be really cool but instead I would value it more if the base detection was based on a % chance that would equal the tottal damage deployed (not hit but activated) against the craft. That is a missile silo would be 5%, 4 silos would be 20%. But now that I think of this, its not perfect either cause, activating 10 missile defenses would equal the detection chance of activating a fusion defense (numbers are random dont take this into account) hm.... I need to think this a bit better.

Also it would make sense not to have the base chance at automatic detection or % detection. But if you use base defenses the game would launch (in a reasonable amount of time lets say 2-5 days?) the scouting part of a retaliation mission in the immediate area. If the UFOs are downed they would dispatch another wave with stronger escorts. And if that fails it should be a battleship squadron. OFC if that fails too then the flag would go down. The area is clearly off limits and the terrans have too strong a defence there. Back to the same old tactics.

Dont ask me though how all these can be made...I just brain storm in 5 minutes here.

Title: Re: Base Defense Mechanics
Post by: Align on April 01, 2015, 11:30:55 pm
If any UFOs will be shot down by the base defense, this base counted as uncovered by aliens and aliens will send a battleship.
That seems kind of harsh. I wouldn't use it myself.
Title: Re: Base Defense Mechanics
Post by: x60mmx on April 01, 2015, 11:40:41 pm
Something like that?

(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14633;image)

This button appears only if the base has base defense.
After activating, the defense trying to shoot down nearby UFOs.
If any UFOs will be shot down by the base defense, this base counted as uncovered by aliens and aliens will send a battleship.

Redv, would you mind linking the file for that mod so I could look at it?  I am thinking of making a defense mod and I could definitely incorporate that, assuming the author is fine with it.  I do think having it flag a retaliation is too harsh.  Assuming the defense ranges weren't too large, aliens scouting for retaliation would already be given a huge leg up in finding your base just by the UFOs getting shot down within a close proximity to your base, instead of wherever your interceptors shot them down which is often far from your base.  I think this alone could balance it out.
Title: Re: Base Defense Mechanics
Post by: redv on April 01, 2015, 11:57:07 pm
Actually it is not a mod. I wrote only 5 strings of code just for this screenshot :)
This is just an concept. At least at the moment ;)
Title: Re: Base Defense Mechanics
Post by: x60mmx on April 02, 2015, 01:27:02 am
Actually it is not a mod. I wrote only 5 strings of code just for this screenshot :)
This is just an concept. At least at the moment ;)

Would you be interested in collaborating?  I am not a coder, but I am really creative and can handle the numbers and graphics.
Title: Re: Base Defense Mechanics
Post by: Jstank on April 02, 2015, 06:33:23 am
The first step would be making it activate the base defense sequence against the specific UFO in the area. The key to making it work is making sure that that specific retaliation mission failed if it was shot down....

Throwing game donuts now duck!
(https://calwatchdog.com/wp-content/uploads/2013/02/belushi-food-fight.jpg)

Maybe make a super fast fighter, that has weapons similar to the calibre of base defense  that has a really really small range (fuel), and that also derives its base power from the number and type of base defense you have installed. Possible, that is not a question I can answer, but It might be simpler than messing with the current base defense mechanics.

You can now un-duck. Im done throwing donuts.
Title: Re: Base Defense Mechanics
Post by: NoelBuddy on April 02, 2015, 09:09:21 pm
Spit-ball Incoming!!

Reading through this I see some ideas I really like, and had a few of my own...

I like the idea of smaller ships being designated as assault craft, this seems the simplest suggestion and goes a long way to making earlier defenses more relevant.

As for the base defenses being able to target UFOs flying by:

Activate a flag that changes the trajectory of the UFO to fly over the base then orbit it; if it finishes that base is detected if not generate crash site.

The defenses should have very different ranges and rates of fire, Missiles(Fusion/conventional) would have long range and low rate of fire, Beams would have high rates of fire but short range... this would also lend to combo options where you fire a few missile to get their attention then when they come close to investigate hitting them with beams.

And if I could drop a completely out there suggestion, I would like base defense to activate a mini game like this

(https://upload.wikimedia.org/wikipedia/en/8/86/A5200_Missile_Command.png)

or this

(https://upload.wikimedia.org/wikipedia/en/8/80/Centipede_arcade.png)

except instead of missiles you are trying to shoot deployment craft and your weapons reflect what base defense facuilities you have
Title: Re: Base Defense Mechanics
Post by: Jstank on April 03, 2015, 04:59:48 am
Thats what I envisioned the first time I came on these forums.

Its one of those would be really cool if sort of things to think about. However we have to work within the confinements of the orginal code. Something way too drastic like that would be way too much work to accomplish. Ideally that would be what we all (I) want. Missile Command within xcom. But we have to deal with the reality that it just is too much of a departure of the original code.


The closet thing I can think of is maybe someone could make a map that looks like land and sky, with cyber disks at the top of the stage advancing south and modified stationary MWP tanks at the bottom shooting at those cyber discs. That seems really far out there though and although possible I don't think people would like it. It would probably look wonky as hell and tying it into the base defense mechanics would take alot of pushing.

Like I said cool to think about but probably out of the realm of open xcom.



Title: Re: Base Defense Mechanics
Post by: x60mmx on April 03, 2015, 05:42:14 am
I'm not interested in introducing minigames to X-Com, just reducing redundancy. 
Title: Re: Base Defense Mechanics
Post by: Solarius Scorch on April 03, 2015, 02:32:12 pm
I believe this minigame will be introduced along the tactical air combat minigame (the Xenonauts air combat model, but turn-based).









(Late April Fool.)
Title: Re: Base Defense Mechanics
Post by: NuclearStudent on April 06, 2015, 08:29:58 am


Dude, can you share the code with us? This would be absolutely awesome to see in-game.
Title: Re: Base Defense Mechanics
Post by: pilot00 on April 09, 2015, 11:14:08 pm
Pfiu,...... At least I am a big sucker and I always forgets Aprils fools. I was scared there for a moment.
Title: Re: Base Defense Mechanics
Post by: redv on April 11, 2015, 10:14:30 pm
Active base defense ready to use :)

1. Activate defense:
(https://cloud.githubusercontent.com/assets/3616568/7102758/64984b8a-e093-11e4-8b20-606c80fa50cf.png)

2. Track down an UFO:
(https://cloud.githubusercontent.com/assets/3616568/7102759/6d384ec0-e093-11e4-992c-eca2edf546f5.png)

3. Shot down the UFO:
(https://cloud.githubusercontent.com/assets/3616568/7102760/741db3b0-e093-11e4-8883-3e742bf921ae.png)

The branch: https://github.com/redv/OpenXcom/tree/active_base_defense
Difference: https://github.com/SupSuper/OpenXcom/compare/master...redv:active_base_defense

The branch compatible with regular OpenXcom.
All settings moved to the ruleset: https://github.com/redv/OpenXcom/blob/active_base_defense/bin/data/Ruleset/Active_Base_Defense.rul
Therefore the mod can be easily reconfigured or disabled.
Code: [Select]
# X-COM 1 (UFO: Enemy Unknown) ruleset
defense:
  rechargeTime: 10      # minutes. If value == 0 then active defense will be disabled permanently.
  retaliationChance: 30 # 0..100 %. Chance to uncover the base by aliens after air battle.
#-----------------------------------
crafts:
  - type: STR_BASE
    requires:
      - STR_BASE_DEF
    sprite: 1  #26   # I need new icon
    damageMax: 100   # should be > 0. Actually not used.
    weapons: 2
#-----------------------------------
craftWeapons:
  - type: STR_MISSILE_DEFENSES
    sprite: 1
    sound: 5
    damage: 100     # the same as for launcher
    range: 40       # range in pixels: (range for facility)/4; i.e. 160/4 = 40
    accuracy: 50    # the same as for facility
#    reloadCautious: 96    # not used
    reloadStandard: 72
#    reloadAggressive: 48  # not used
    ammoMax: 100    # in fact, maximum is 6x6-1 = 35
    launcher: STR_AVALANCHE_LAUNCHER
    projectileType: 1
    projectileSpeed: 8
  - type: STR_LASER_DEFENSES
    sprite: 4
    sound: 8
    damage: 70
    range: 50       # 200/4 = 50
    accuracy: 60
#    reloadCautious: 24
    reloadStandard: 24
#    reloadAggressive: 24
    ammoMax: 100
    launcher: STR_LASER_CANNON
    projectileType: 4
  - type: STR_PLASMA_DEFENSES
    sprite: 5
    sound: 9
    damage: 140
    range: 60       # 240/4 = 60
    accuracy: 70
#    reloadCautious: 24
    reloadStandard: 24
#    reloadAggressive: 24
    ammoMax: 100
    launcher: STR_PLASMA_BEAM
    projectileType: 5
  - type: STR_FUSION_BALL_DEFENSES
    sprite: 3
    sound: 7
    damage: 230
    range: 70       # 280/4 = 70
    accuracy: 80
#    reloadCautious: 64
    reloadStandard: 48
#    reloadAggressive: 32
    ammoMax: 100
    launcher: STR_FUSION_BALL_LAUNCHER
    projectileType: 3
    projectileSpeed: 8
#-----------------------------------
facilities:
  - type: STR_MISSILE_DEFENSES
    defenseRange: 160    # maximum range is 280 miles (70*4 = 280)
  - type: STR_LASER_DEFENSES
    defenseRange: 200
  - type: STR_PLASMA_DEFENSES
    defenseRange: 240
  - type: STR_FUSION_BALL_DEFENSES
    defenseRange: 280
#-----------------------------------
#extraSprites:
#  - type: INTICON.PCK
#    width: 352
#    height: 80
#    subX: 32
#    subY: 40
#    files:
#      26: Resources/Base_Defense/bd_geoscape.png
#-----------------------------------
extraStrings:
  - type: en-US
    strings:
      STR_ACTIVATE_DEFENSE: Activate Base Defense
  - type: en-GB
    strings:
    strings:
      STR_ACTIVATE_DEFENSE: Activate Base Defence

Next I plan change icons of craft to something like a point defense turret:
(https://www.raytheon.com/capabilities/rtnwcm/groups/gallery/documents/digitalasset/rtn_204202.jpg)

And yes, active base defense it is lot of fun :)
Title: Re: Base Defense Mechanics
Post by: Ridаn on April 11, 2015, 10:19:29 pm
Aww yeah! Thats awesome.
What about multiply bases though?
Title: Re: Base Defense Mechanics
Post by: redv on April 11, 2015, 10:23:07 pm
Each base has own defenses.
Title: Re: Base Defense Mechanics
Post by: Jstank on April 12, 2015, 07:32:41 am
Nice work! That is really awesome  8)
Title: Re: Base Defense Mechanics
Post by: Dioxine on April 12, 2015, 08:00:33 am
Great stuff! Hope this will get pulled into Master or Extended branch!
Bonus points for a chance to trigger base discovery!

From the Interception screen I can see each defensive building is represented by a separate weapon. What if a base has more than 2 types of defensive buildings?
Title: Re: Base Defense Mechanics
Post by: Yankes on April 12, 2015, 12:15:32 pm
Great stuff! Hope this will get pulled into Master or Extended branch!
Bonus points for a chance to trigger base discovery!

From the Interception screen I can see each defensive building is represented by a separate weapon. What if a base has more than 2 types of defensive buildings?

Probably other way around :) This branch could benefice form Extended feature of 4 weapons. Even if you like alter heavily interceptor window you could squeeze 6 weapons but without ammo numbers.
Over all I think this is interesting idea but probably going too far form my extended version.
Title: Re: Base Defense Mechanics
Post by: redv on April 12, 2015, 01:00:51 pm
Actually this branch not ready yet for merging.

In first, active base defense never used before in Xcom series. Therefore I'm not sure, that it will be accepted to the master branch. For extended version need to rewrite code, i.e. add 2 more weapons (actually need much more changes).

Second, I see that this version less than perfect. The interface should be redesigned.
(https://cloud.githubusercontent.com/assets/3616568/7105145/693a3390-e112-11e4-93cb-abaf0a9fa52f.png)
1. Is it craft? Should be icons of defense turrets.
2. These buttons disabled. One can be repurposed to enable/disable base defense. But what to do with second one?
3. Need replace icon to point defense turret. It's easy.

I think about special build just for testing and feedback.

From the Interception screen I can see each defensive building is represented by a separate weapon. What if a base has more than 2 types of defensive buildings?

Even if you have three or four types of base defense facilities, will be chosen only two types. Which exactly types is not determined. Can be any. Actually this is a problem.

It is obvious, that blaster defense is best. But what will be best defense in general case? Is best defense that most powerful? Or best defense which has maximum range? Or best defense which can shoot rapidly? May be best accuracy should be taken into account? I think about maximum range.

In other hand, are you really will to use more than 2 types of base defense in one base? ;)
Title: Re: Base Defense Mechanics
Post by: Dioxine on April 12, 2015, 07:13:24 pm
It is obvious, that blaster defense is best. But what will be best defense in general case? Is best defense that most powerful? Or best defense which has maximum range? Or best defense which can shoot rapidly? May be best accuracy should be taken into account? I think about maximum range.

In other hand, are you really will to use more than 2 types of base defense in one base? ;)

True, true, with this mod, you will have more statistics to weigh against one another... Which is what I love :)

About the last question though... Umm... what if I do without even thinking I shouldn't? :) I think it's highly likely (build a missile, then a laser, then 2 plasmas, bolstering progressively, for example - especially if a mod which allows non-battleships to attack base is enabled - sure missiles are old but why should I dismantle them? I have lots of space left :) ) Even 4 craft weapons mod doesn't fix it - vanilla has 4 types of defences, but what about non-vanilla? :)
Title: Re: Base Defense Mechanics
Post by: Ridаn on April 12, 2015, 07:59:42 pm
May be make each defence building behave like 1 interceptor? If submenu is impossible, then just use the same Interception menu used by craft. Sure it might get cluttered, but I think people who desire such option can handle some micromanagement in exchange for new strategic options.
Title: Re: Base Defense Mechanics
Post by: Solarius Scorch on April 12, 2015, 08:20:15 pm
Does this mechanic make base defences easier?

Like, a Battleship is fired at twice - first on the Geoscape and then on the defence screen. Or is the base artillery defence part disabled?

I don't think it would be a problem if it is attacked twice, I just would like to know.
Title: Re: Base Defense Mechanics
Post by: redv on April 12, 2015, 09:38:27 pm
May be make each defence building behave like 1 interceptor? If submenu is impossible, then just use the same Interception menu used by craft. Sure it might get cluttered, but I think people who desire such option can handle some micromanagement in exchange for new strategic options.

Actually it's a lot of micromanagement.
Will be very annoying to manage an swarm of interceptors which can fly 5-10 sec on short distance, then will be the repair/refuel/rearm cycle at least 2 hours.

Does this mechanic make base defences easier?

Like, a Battleship is fired at twice - first on the Geoscape and then on the defence screen. Or is the base artillery defence part disabled?

I don't think it would be a problem if it is attacked twice, I just would like to know.

Even 3 times if you have a Grav shield. :)
But you not always can detect a battleship on Geoscape.
I'm not sure that need change something in vanilla base defense. At least need several tests to balance this behavior.
I will add one string to vanilla base defense mission: after shots of base defense will be start the recharge countdown.

In the other hand, in this mod first shot to a battleship can be at distance 280 m.
Velocity of a battleship can be up to 5000 mph.
Therefore base defense can have 280/5000*60 = 3.36 min to recharge.
So, if you set rechargeTime to 3 or 4 min then this behavior will be looks good :)
I think, the Grav shield also can give you 3-4 min of time to the second attack and second shot.
Title: Re: Base Defense Mechanics
Post by: Dioxine on April 13, 2015, 08:43:19 am
I think I have one solution - why not bypass the interception screen completely? Only add option for bases (or R-click for each defensive facility?) to either "fire at will" or "cease fire" and do the firing proper through the "base defensive fire screen" which is activated as an interrupt whenever "fire at will" is enabled and any UFO is detected & within range of any defences which are ready to fire atm.
Might seem primitive but has 4 advantages:
- No awkward "interception without interceptor" screen, uses familiar base defence screen instead (only with changed text and color, I'd suggest);
- Hence, no new gfx needed!
- No multiple defence building/type problems;
- Very little in the way of micromanagement, even if each building has to be activated/deactivated separately (which I'd prefer).
Title: Re: Base Defense Mechanics
Post by: redv on April 13, 2015, 10:43:32 pm
Of course this solution is very easy to implement.
But where is the fun? ;)

btw, new interface for active base defense:
Title: Re: Base Defense Mechanics
Post by: Dioxine on April 13, 2015, 10:47:46 pm
Of course this solution is very easy to implement.
But where is the fun? ;)

btw, new interface for active base defense:

Hehehe, I like it.
So it seems you have around 2 unused buttons - maybe use them as <next building> <prev building> buttons?
Title: Re: Base Defense Mechanics
Post by: pilot00 on April 14, 2015, 03:09:25 pm
I have a.... radical way of doing this. Though I dont know if its possible code wise. So as Jstank said I am throwing wild donuts:

Seen as the 4 buttons concide with our four available defense types (plasma, missiles,lazer, fusion) why not hard code each one to be "linked" durring the "interception" screen to one of them? Effectively switching which one will fire (as oposed to all of them firing together). Each one should have a number of shots according to how much you have of each.

And we can cram the X-Com logo in place of our interceptor status screen.
Title: Re: Base Defense Mechanics
Post by: redv on April 14, 2015, 05:25:59 pm
The interface has one free button. Possible to choose weapons in cycle (as suggested @Dioxine).
For example the base has 4 types of defense facilities: A, B, C and D.
When the dogfight window loaded, shows types A and B.
One click - then shows B and C.
Second click - shows C and D.
Next click - D and A. etc.

It is not a big problem to implement. But will be problem with support in future.
This feature better to implement after TFTD to avoid compatibility issues.
Title: Re: Base Defense Mechanics
Post by: redv on April 14, 2015, 06:16:39 pm
Final version of Active base defense is ready.

The button "Activate base defense" will be shown only if ruleset "Active_Base_Defense.rul" loaded and the base has at least one defense facility.
In other cases will be shown the standard intercept window.
Each base can be activated separately.
(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14800;image)

If the defense was activated and found a suitable target then starts a dogfight window.
Will be chosen 2 most long-range weapons. Quantity of ammo = Quantity of facilities of this type  x  Maximum quantity of ammo for this facility.
Possible modes: not shoot / shoot / disable defense / allow disengage for UFO
One base can track only one target.
(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14802;image)

The window can be minimized if you not began an air battle.
After each use of base defense starts a recharge countdown (even after vanilla use of base defense).
(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14804;image)

Behaviour can be tuned via ruleset:
Code: [Select]
# X-COM 1 (UFO: Enemy Unknown) ruleset
defense:
  rechargeTime: 10      # minutes. If value == 0 then active defence will be disabled permanently.
  retaliationChance: 30 # 0..100 %. Chance to uncover the base by aliens after air battle.
#-----------------------------------
crafts:
  - type: STR_BASE
    requires:
      - STR_BASE_DEF
    sprite: 30
    damageMax: 100      # should be > 0. Actually not used.
    weapons: 2
#-----------------------------------
craftWeapons:
  - type: STR_MISSILE_DEFENSES
    sprite: 1
    sound: 5
    damage: 100         # the same as for launcher
    range: 40           # range in pixels: (range for facility)/4; i.e. 160/4 = 40
    accuracy: 50        # the same as for defence facility
    reloadStandard: 72
    ammoMax: 5          # maximum ammo for each defence facility
    launcher: STR_AVALANCHE_LAUNCHER
    projectileType: 1
    projectileSpeed: 8
  - type: STR_LASER_DEFENSES
    sprite: 4
    sound: 8
    damage: 70
    range: 50           # 200/4 = 50
    accuracy: 60
    reloadStandard: 24
    ammoMax: 5
    launcher: STR_LASER_CANNON
    projectileType: 4
  - type: STR_PLASMA_DEFENSES
    sprite: 5
    sound: 9
    damage: 140
    range: 60           # 240/4 = 60
    accuracy: 70
    reloadStandard: 24
    ammoMax: 5
    launcher: STR_PLASMA_BEAM
    projectileType: 5
  - type: STR_FUSION_BALL_DEFENSES
    sprite: 3
    sound: 7
    damage: 230
    range: 70           # 280/4 = 70
    accuracy: 80
    reloadStandard: 48
    ammoMax: 4
    launcher: STR_FUSION_BALL_LAUNCHER
    projectileType: 3
    projectileSpeed: 8
#-----------------------------------
facilities:
  - type: STR_MISSILE_DEFENSES
    defenseRange: 160   # maximum range is 280 miles (70*4 = 280)
  - type: STR_LASER_DEFENSES
    defenseRange: 200
  - type: STR_PLASMA_DEFENSES
    defenseRange: 240
  - type: STR_FUSION_BALL_DEFENSES
    defenseRange: 280
#-----------------------------------
extraSprites:
  - type: INTICON.PCK
    width: 352
    height: 80
    subX: 32
    subY: 40
    files:
      27: Resources/ActiveBaseDefense/abd_geoscape.png
  - type: INTERWIN2.DAT
    width: 160
    height: 556
    singleImage: true
    files:
      0: Resources/ActiveBaseDefense/abd_interwin2.png
#-----------------------------------
extraStrings:
  - type: en-US
    strings:
      STR_ACTIVATE_DEFENSE: Activate Base Defense
      STR_CANT_MINIMIZE_DURING_BATTLE: Can't minimize during battle
  - type: en-GB
    strings:
      STR_ACTIVATE_DEFENSE: Activate Base Defence
      STR_CANT_MINIMIZE_DURING_BATTLE: Can't minimize during battle

The code: https://github.com/SupSuper/OpenXcom/compare/master...redv:active_base_defense
The code compatible with latest nightlies.

If you have an interest I'll try to build an standalone exe (I never did it before:)
Title: Re: Base Defense Mechanics
Post by: yrizoud on April 14, 2015, 08:45:25 pm
I think I'd prefer without the intercept window, mostly for balance : Aircrafts give you the flexibility of changing targets, delaying your attack (over sea) or guard a landed UFO.
If a "missile defense" building can be used as a ICBM, it already has the advantage of being four times smaller than a hangar, no 600k$ renting fee per month, no storage of the cumbursome missiles. So it would be a balanced alternative if the missiles were shot in a fire-and-forget way : If the missile reaches the UFO while it's landed, it's a miss (no bombing Earth). If it reaches the UFO while over a lake, "ploof", no crash site.
Title: Re: Base Defense Mechanics
Post by: redv on April 15, 2015, 01:18:33 am
If you not use base defense, then you need only interceptors.
But if you use base defense, then you need and interceptors and base defense.
Therefore economic calculations is not the point.

Balance in this case will be determined by quantity of downed UFOs by the base defense.
How many could be as maximum? 5%? May be 10%? Who know. Need tests.
Quantity of downed UFOs (by the base defense) can be easily adjusted by distance (defenseRange).
Title: Re: Base Defense Mechanics
Post by: pilot00 on April 15, 2015, 02:44:25 am
Should also take into consideration amunition problems though I dont know if it is possible to link it somehow. Perhaps the power building module that was suggested in another thread could be used as a balancing factor to counter spamming defenses?
Title: Re: Base Defense Mechanics
Post by: NuclearStudent on April 15, 2015, 03:52:44 am
Should also take into consideration amunition problems though I dont know if it is possible to link it somehow. Perhaps the power building module that was suggested in another thread could be used as a balancing factor to counter spamming defenses?

Only two base defense facilities can be used for active defense. As well, each module has limited ammo.
Title: Re: Base Defense Mechanics
Post by: yrizoud on April 15, 2015, 12:08:23 pm
But if you use base defense, then you need interceptors and base defense.
Why? because of risk of discovery ? Interceptors won't stop a retaliation battleship anyway.
Should also take into consideration amunition problems though I dont know if it is possible to link it somehow.
If you mean ammo as a way to incur a cost every time the facility is used, you can make the facility consume missiles that you simply store in general stores.
Title: Re: Base Defense Mechanics
Post by: redv on April 15, 2015, 12:43:17 pm
Why? because of risk of discovery ? Interceptors won't stop a retaliation battleship anyway.

Because you anyways need interceptors. Have you ever played without interceptors? ;)
Title: Re: Base Defense Mechanics
Post by: yrizoud on April 15, 2015, 03:45:51 pm
If missile facilities had a chance to shoot down a UFO in radar range, there are some bases where I wouldn't put a hangar at all.
If the aliens detect and attack it, they can only enter through the access lift, so a pair of grandmothers armed brooms can hold them off.
Title: Re: Base Defense Mechanics
Post by: redv on April 15, 2015, 04:27:32 pm
You misunderstood the ruleset.

Small radar has radar range 1695. Large radar has radar range 2577. Even interceptor has radar range 672.
But the missile defense has defense range 160 (of course you can change it).

Therefore defense facilities can secure area around a base but this is very little area.
For example this area in (2577/160)^2=259.4 times less than area covered by large radar system.

Therefore interceptors need anyways, even if you want to use base defense.
Title: Re: Base Defense Mechanics
Post by: yrizoud on April 15, 2015, 05:28:53 pm
Ah sorry I hadn't looked at the numbers you had in mind.
I was thinking of something more like ICBM bases, able to protect a whole continent. So this capability would apply to missiles (efficient only against the small UFOs) and fusion balls, not lasers or plasma.
A tiny range would make it very unlikely to make a difference in the game.
I envisioned the missiles in flight as fast/slow as an interceptor, so it's a challenge to decide when to launch : too early and the missile runs out of fuel while chasing a UFO which hasn't found its target area, too late and the UFO can move out of range or lands.
(https://airminded.org/wp-content/img/film/wargames-1.jpg)
Title: Re: Base Defense Mechanics
Post by: animal310 on October 14, 2017, 01:45:55 pm
I’m sorry to bump old threads but I’ve been away for a while and have been searching through the threads. This looks like another fantastic peace of work but can anyone explain how I can add it to my game? It is possible to be used like a mod?
Base defence is one area where the game needed work and this looks very good!
Title: Re: Base Defense Mechanics Ala Xenonauts
Post by: The Reaver of Darkness on December 01, 2017, 05:22:10 am
I am aware this is a late response. I wish I had seen the post sooner, so I could have given my input.


I really enjoyed the fact that base defenses in Xenonauts reduced the number of attackers according to how much base defense you had, if it failed to repulse the attack. [snip] If defenses could reduce the number of attackers, I could see myself actually using them.

Possible?
if we start trying to "ape the competition" then we might give the impression that we're actually trying to compete.

I came up with this exact idea independently of xenonauts and posted it on these forums here (https://openxcom.org/forum/index.php/topic,2919.msg31756.html#msg31756). Excerpt from my post:

"4.) The damage done to the craft by the base defenses should have some impact on the aliens making it to the ground. A heavily-damaged ship would have multiple hull breaches and several aliens would have been killed or injured, and more may be hurt or killed in a hasty landing with structural integrity already failing. Heavily-damaged ships should drop fewer aliens, some of which would be already hurt. That way it's less of an all or nothing mentality on base defense."

It's a very basic idea that anyone could come up with independently. I don't see any reason to avoid adding the feature just because somebody else used it. Also, OpenXcom itself isn't in much of any competitive position. It's just here to make the game more moddable. You can add the capability for modders to make use of such a feature, and have it off by default. If Xenonauts feels competition pressure, it'll be from a specific mod. I don't think that'll happen, however. If anything, the two communities should be sharing ideas, and either one of us is probably an advertiser for the other.
Title: Re: Base Defense Mechanics
Post by: Dwarmin on December 06, 2017, 09:46:30 pm
Someone should really code this in. Not sure how hard it would be, but...wouldn't it be like making each defense a separate 'craft'? Only it's more or less just the targeting system tracking and locking on, with the weapons being fired from the base. It wouldn't stretch the imagination for UFO's to be able to fight at super long ranges, i.e, they bomb your defenses back.

Also, I've always guessed that crashed alien ships take damage that (somehow? I don't know if this is a thing as I understand it) scales with the amount of damage you did to it in the air. At least, weaker guns seems to knock medium scouts down intact, and plasma launchers make them a flat piece at the ground. Engineer Aliens and soldiers usually die when the power cores rupture-there's a reason the commanders are usually seated far away from them. :P But this damage scaling seems to me like it could be applied to landing/attacking ships.
Title: Re: Base Defense Mechanics
Post by: ohartenstein23 on December 06, 2017, 10:16:13 pm
Someone should really code this in. Not sure how hard it would be, but...wouldn't it be like making each defense a separate 'craft'? Only it's more or less just the targeting system tracking and locking on, with the weapons being fired from the base. It wouldn't stretch the imagination for UFO's to be able to fight at super long ranges, i.e, they bomb your defenses back.

Also, I've always guessed that crashed alien ships take damage that (somehow? I don't know if this is a thing as I understand it) scales with the amount of damage you did to it in the air. At least, weaker guns seems to knock medium scouts down intact, and plasma launchers make them a flat piece at the ground. Engineer Aliens and soldiers usually die when the power cores rupture-there's a reason the commanders are usually seated far away from them. :P But this damage scaling seems to me like it could be applied to landing/attacking ships.

There is no scaling of dogfight damage done to the battlescape on a crash site.  The UFO either gets a status of crashed or destroyed if you do too much dogfight damage. Once on the ground, each power source has a 75% chance of exploding before the mission - this is how damage appears in the battlescape.

Edit: This can't apply to base defense missions, since no UFO is spawned on the map. Perhaps bombardment of a landing site could be added, but likely it would only change the UFO's status to either crashed or destroyed, and you'd be back to the situation above.
Title: Re: Base Defense Mechanics
Post by: bloodman123726 on October 28, 2019, 12:56:13 pm
Final version of Active base defense is ready.

The button "Activate base defense" will be shown only if ruleset "Active_Base_Defense.rul" loaded and the base has at least one defense facility.
In other cases will be shown the standard intercept window.
Each base can be activated separately.
(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14800;image)

If the defense was activated and found a suitable target then starts a dogfight window.
Will be chosen 2 most long-range weapons. Quantity of ammo = Quantity of facilities of this type  x  Maximum quantity of ammo for this facility.
Possible modes: not shoot / shoot / disable defense / allow disengage for UFO
One base can track only one target.
(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14802;image)

The window can be minimized if you not began an air battle.
After each use of base defense starts a recharge countdown (even after vanilla use of base defense).
(https://openxcom.org/forum/index.php?action=dlattach;topic=3513.0;attach=14804;image)

Behaviour can be tuned via ruleset:
Code: [Select]
# X-COM 1 (UFO: Enemy Unknown) ruleset
defense:
  rechargeTime: 10      # minutes. If value == 0 then active defence will be disabled permanently.
  retaliationChance: 30 # 0..100 %. Chance to uncover the base by aliens after air battle.
#-----------------------------------
crafts:
  - type: STR_BASE
    requires:
      - STR_BASE_DEF
    sprite: 30
    damageMax: 100      # should be > 0. Actually not used.
    weapons: 2
#-----------------------------------
craftWeapons:
  - type: STR_MISSILE_DEFENSES
    sprite: 1
    sound: 5
    damage: 100         # the same as for launcher
    range: 40           # range in pixels: (range for facility)/4; i.e. 160/4 = 40
    accuracy: 50        # the same as for defence facility
    reloadStandard: 72
    ammoMax: 5          # maximum ammo for each defence facility
    launcher: STR_AVALANCHE_LAUNCHER
    projectileType: 1
    projectileSpeed: 8
  - type: STR_LASER_DEFENSES
    sprite: 4
    sound: 8
    damage: 70
    range: 50           # 200/4 = 50
    accuracy: 60
    reloadStandard: 24
    ammoMax: 5
    launcher: STR_LASER_CANNON
    projectileType: 4
  - type: STR_PLASMA_DEFENSES
    sprite: 5
    sound: 9
    damage: 140
    range: 60           # 240/4 = 60
    accuracy: 70
    reloadStandard: 24
    ammoMax: 5
    launcher: STR_PLASMA_BEAM
    projectileType: 5
  - type: STR_FUSION_BALL_DEFENSES
    sprite: 3
    sound: 7
    damage: 230
    range: 70           # 280/4 = 70
    accuracy: 80
    reloadStandard: 48
    ammoMax: 4
    launcher: STR_FUSION_BALL_LAUNCHER
    projectileType: 3
    projectileSpeed: 8
#-----------------------------------
facilities:
  - type: STR_MISSILE_DEFENSES
    defenseRange: 160   # maximum range is 280 miles (70*4 = 280)
  - type: STR_LASER_DEFENSES
    defenseRange: 200
  - type: STR_PLASMA_DEFENSES
    defenseRange: 240
  - type: STR_FUSION_BALL_DEFENSES
    defenseRange: 280
#-----------------------------------
extraSprites:
  - type: INTICON.PCK
    width: 352
    height: 80
    subX: 32
    subY: 40
    files:
      27: Resources/ActiveBaseDefense/abd_geoscape.png
  - type: INTERWIN2.DAT
    width: 160
    height: 556
    singleImage: true
    files:
      0: Resources/ActiveBaseDefense/abd_interwin2.png
#-----------------------------------
extraStrings:
  - type: en-US
    strings:
      STR_ACTIVATE_DEFENSE: Activate Base Defense
      STR_CANT_MINIMIZE_DURING_BATTLE: Can't minimize during battle
  - type: en-GB
    strings:
      STR_ACTIVATE_DEFENSE: Activate Base Defence
      STR_CANT_MINIMIZE_DURING_BATTLE: Can't minimize during battle

The code: https://github.com/SupSuper/OpenXcom/compare/master...redv:active_base_defense
The code compatible with latest nightlies.

If you have an interest I'll try to build an standalone exe (I never did it before:)

Could someone please take a look at this if they have the time to compile this into the aforemention standalone mod? I tried to do such but it does not seem to work at all with the latest nightly. Thanks.
Title: Re: Base Defense Mechanics
Post by: Meridian on October 28, 2019, 01:02:20 pm
Could someone please take a look at this if they have the time to compile this into the aforementioned standalone mod? I tried to do such but it does not seem to work at all with the latest nightly. Thanks.

This feature request was never added to OpenXcom.
Thus you can't use the aforementioned ruleset to make a mod.
Title: Re: Base Defense Mechanics
Post by: bloodman123726 on October 28, 2019, 01:09:19 pm
This feature request was never added to OpenXcom.
Thus you can't use the aforementioned ruleset to make a mod.

So it is not possible at all to make a standalone mod that can manage a similar result?
Title: Re: Base Defense Mechanics
Post by: Meridian on October 28, 2019, 01:32:57 pm
So it is not possible at all to make a standalone mod that can manage a similar result?

Mods can only add features that are supported by the engine.

And this one is not supported by the engine.

If you want this, you'd need to change the engine.
Title: Re: Base Defense Mechanics
Post by: wcho035 on October 28, 2019, 03:44:14 pm
I don't know why you guys are moaning about base defense missions. I personally find base defense missions are most fun part in the game.

First, you need to design your base smartly. Always separate the airlocks and the hangers away from the other base structures.

Have choke points where the Aliens has to get through. Usually I have the airlock as a choke point between the hangers and the other base facilities.

Always position your soldiers near the choke point at the first turn of the battle, and then fight your way to win.
 
Title: Re: Base Defense Mechanics
Post by: The Reaver of Darkness on October 28, 2019, 04:45:23 pm
I don't know why you guys are moaning about base defense missions. I personally find base defense missions are most fun part in the game.

First, you need to design your base smartly...

A lot of people know all that and still dislike base defense missions, probably because they get stale really fast when the aliens send one battleship after the other. But this thread is more dedicated to peoples' dislike of weak base defense facilities (laser and missile defense) because there's no use for them in the game.

Also, there have been some updates to base defense facility code since this discussion took place in 2015 and some in 2017:
 * Base facilities can now launch projectiles onto the geoscape, and aliens can spawn projectiles onto the geoscape which can hit player bases and damage or destroy facilities. Tech Comm (https://openxcom.mod.io/tech-comm)
 * Base facilities can cost any type of item to build, and can refund some or all of that item (or other items) when they are removed. (buildCostItems)
 * A global variable can be set which will make UFOs drop less aliens based on their remaining hit points. (lessAliensDuringBaseDefense: true)
Ruleset Reference Nightly (OpenXcom) (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom))

Keep in mind all of these are options for mods, and none of them affect the unmodded game.
Title: Re: Base Defense Mechanics
Post by: SIMON BAILIE on October 28, 2019, 04:46:33 pm
I would agree with that. So long as you design your base right these missions should be easier than alien bases which need to be done at some point. Only if your troops are being mind-controlled all the time should base defence missions turn into a nightmare. Also if you avoid shooting down every ufo/uso that comes along you should keep these missions to a minimum.