Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Scuddie on June 17, 2006, 03:06:02 pm

Title: Missile defense system
Post by: Scuddie on June 17, 2006, 03:06:02 pm
Would it be relatively easy to implement a missile defense system against bombs?  Kind of like a point defense system?  Right now, I never see any AI behavior to intercept bombs using missiles.  I think it would be nice to see a "point defense" weapon flag, so that capital ships have an intercept system.  I think this would work exceptionally well with gunships or escort ships that have orders to protect a target.  It would work in the same sense as the "Bomber+" flag, except targetting bombs, and only bombs.  Thoughts?
Title: Re: Missile defense system
Post by: Mars on June 17, 2006, 03:10:37 pm
I second that, that's an excellent idea.

(Provided of course it won't be hell to implement)
Title: Re: Missile defense system
Post by: Nuke on June 17, 2006, 04:13:55 pm
thirded
Title: Re: Missile defense system
Post by: Wanderer on June 17, 2006, 11:50:05 pm
AFAIK AI does (or rather tries to) intercept bombs with missiles... I have seen it trying to intercept approaching helios by firing another helios at it :P. And that was attempt to save another modified fenris.
Title: Re: Missile defense system
Post by: Goober5000 on June 18, 2006, 12:54:18 am
Yes, the AI already fires missiles at bombs.
Title: Re: Missile defense system
Post by: Mars on June 18, 2006, 12:58:00 am
Um... I don't suppose it would be easy to make a flag for weapons.tbl like "AI_fire_at_bomb"?
Title: Re: Missile defense system
Post by: karajorma on June 18, 2006, 01:40:57 am
I think the point was to have missiles that only fired at bombs.
Title: Re: Missile defense system
Post by: jr2 on June 18, 2006, 01:49:23 am
...a bomb-killing missile.  Great idea.  There should be a version for Intercept fighters, too; I've always wanted to just lock on to and kiss a bomb good-bye, instead of riding up its butt and getting my front shields creamed when the lasers finally hit.

On the flip side, then there'd probably be bombs that split into multiple sub-bombs & decoys, like they have in ICBMs now.
Title: Re: Missile defense system
Post by: Wanderer on June 18, 2006, 02:10:22 am
I think the point was to have missiles that only fired at bombs.

That would be kinda odd... AFAIK even these days there arent any of those. All are more or less dual purpose missiles with capability to engage both missiles and aircrafts.
Title: Re: Missile defense system
Post by: WMCoolmon on June 18, 2006, 02:35:57 am
The best method would be a SEXP that allows you to set the object priority of turrets "weapon" "ship" "asteroid" and so forth (I don't think turrets shoot anything else though :p)

At least IMHO. AFAIK, it hasn't been implemented, though.

Or maybe it has. Now this is embarassing...I actually implemented the SEXP(s), but forgot about it.

There are two SEXPs - turret-set-target-order, and ship-turret-target-order. The default is, bombs, ships, asteroids. So given that, what you could do, is use this:
Code: [Select]
turret-set-target-order
--(ship)
--(turret)
--"bombs"

That will cause the turret to target bombs only. For the rest of the turrets, you could throw out
Code: [Select]
turret-set-target-order
--(ship)
--(turret)
--"ships"
--"asteroids"

And if you only had a few point-defense-turrets, you could use ship-turret-target-order:
Code: [Select]
ship-turret-target-order
--(ship)
--"ships"
--"asteroids"

turret-set-target-order
--(ship)
--(point-defense turret 1)
--"bombs"

turret-set-target-order
--(ship)
--(point-defense turret 2)
--"bombs"

turret-set-target-order
--(ship)
--(point-defense turret ...)
--"bombs"
Title: Re: Missile defense system
Post by: Scuddie on June 18, 2006, 02:48:10 am
The issue is not with the missiles, but with the AI.  I have never seen a missile take out a bomb, primarily because the AI almost never targets bombs exclusively.  With programming a point defense system, there can be ways for the AI to not worry about all the fighters, ships, and everything else before a bomb is targeted.  This introduces a factor of game balance to the equation, but that's where the missile specs come in.  Since AI cannot determine relative threat like people can, it seems logical to create this special case solution to fit the needs.

POST EDIT:  WMC, if you can do that for an SEXP, you should be able to do that for a weapon flag, no?
Title: Re: Missile defense system
Post by: WMCoolmon on June 18, 2006, 02:54:08 am
That'd actually be a whole nother ballgame, unless you just wanted limited auto-application of the targeting order for turrets. Plus it raises the question of what to do if weapons on a turret have conflicting target orders.

So, yes it is possible, but a weapon flag would only be useful on fighters and for dual-purpose turrets, although the latter don't generally make a whole lot of sense. I can't say how hard it would be - it depends on how the AI goes about picking which weapon to us, and which target to pick, and how convoluted that path is.
Title: Re: Missile defense system
Post by: Scuddie on June 18, 2006, 03:02:43 am
Well, as I said, the application would most likely be for point-defense on gunships and escort ships.  If you're saying it's controlled by turret, is it possible or feasable to have a ship flag, or even a turret flag that would put bomb precedence as top or only priority for the missiles?  For dedicated turrets, it should be no problem if I understand you correctly.
Title: Re: Missile defense system
Post by: Nuke on June 18, 2006, 03:05:50 am
ive been wanting to make a small long range missile with a light warhead to kill bombs. interceptors could carry a lot of them and it would allow them to cover a wider area. id just want to make it so the ai wouldnt chew em up on ships, which it would totally be useless against. perhaps put a target compatability flag in each weapon. the ai would check this when using its weapons. it would help it decide what weapons to use against a target, how many missiles to fire at once, and weather to group primary banks or fire just one weapon. it would probibly be best if it was a string list, where you put in a ship class or bomb (maybe shields as well to indiate the weapon is suited to attack shielded targets. make the ai smart enough to use its circie when shilds are up and maxim only when something's shields are down) or any other object, turret or subsystem for example. so if you list "bomb" "turret" "fighter", then the ai will only use that weapon for those items, so if its target is a bomb it will use that weapon, if its a fighter it knows that weapon is a poor choice and will use another. this idea wouldnt just make ams weapons possible, but it would make the ai smarter with weapon usage.
Title: Re: Missile defense system
Post by: NGTM-1R on June 18, 2006, 04:06:02 am
The issue is not with the missiles, but with the AI.  I have never seen a missile take out a bomb, primarily because the AI almost never targets bombs exclusively.  With programming a point defense system, there can be ways for the AI to not worry about all the fighters, ships, and everything else before a bomb is targeted.  This introduces a factor of game balance to the equation, but that's where the missile specs come in.  Since AI cannot determine relative threat like people can, it seems logical to create this special case solution to fit the needs.

The AI will engage targets with the bomb tag in preference to all others already. Including in some builds even firing anti-capital beams at them, which looks rather strange.
Title: Re: Missile defense system
Post by: Wanderer on June 18, 2006, 05:22:51 am
That beam thing should happen with all the builds... I once suggested fixing it by default but that was dropped to keep backwards compatibility. That particular problem and other such 'huge weapon targets bomb' can be fixed with proper ai_profiles.tbl usage.
Title: Re: Missile defense system
Post by: Scuddie on June 19, 2006, 12:22:23 am
If bombs are the first thing to be targetted, why do I never see a missile intercept a bomb?  I know that a capship will fire its gun turrets at incoming bombs, so why wont it fire its missile turrets at them?
Title: Re: Missile defense system
Post by: Prophet on June 19, 2006, 01:38:41 am
Perhaps you have just been unfortunate. Perhaps the turnents just haven't got a lock on the bomb. Perhaps the crew is changing a fresh magazine.

IRRELEVANT

Overhul the weapons to make them intercept blobs so we get interceptors on TBP. Now! I command you in the name of the allmight sweating bottle of cold beer!

(Interesting thing I realized... Why havent there been a space sim that has interceptors? Or anything similar?)
Title: Re: Missile defense system
Post by: NGTM-1R on June 19, 2006, 02:08:52 pm
Well...IFH might have them. Or, for that matter, the never-released official B5 flight sim might have.
Title: Re: Missile defense system
Post by: phreak on June 19, 2006, 04:29:23 pm
The ROF on missile turrets on capitals is often slow, so when its time to fire again, the bombs may have already been downed by fighter cover/blob turrets/flak/AAA beams

A way to test if missile turrets go for bombs is to modify a ship so all of its turrets are missiles.  Then you probably want to set the missile type to something more rapid fire, like Harpoons.  Create a test mission and have the target ship invulnerable and see if the missiles go for the bombs.

One thing to note is that if the Weapons subsystem has been destroyed, bombs won't be targeted by the turrets.  This behavior could probably be modified if we have a special "interceptor" weapon flag, so that bombs are still targeted by just "interceptor" weapons and not other things.
Title: Re: Missile defense system
Post by: Getter Robo G on July 10, 2006, 03:18:36 pm
Just bumping cause I've been offline, and now adding a bit of trivia.

I use to have a few screenies of accidently capturing shots of cap ship photon torpedoes by Omniscaper (using helios table). Detonating against each other when two opposing ships are firing at each other.

Should have kept them as I didn't think it significant at the time. Sorta neat to think that helios's can strike each other and detonate. Of course I don't  think they were targeting each other, just happened to be in the opposing bomb's flight path and that these weren't missiles, they were all bombs.
Title: Re: Missile defense system
Post by: WMCoolmon on July 11, 2006, 12:59:18 am
The ROF on missile turrets on capitals is often slow, so when its time to fire again, the bombs may have already been downed by fighter cover/blob turrets/flak/AAA beams

See "same turret cooldown" weapon class flag.
Title: Re: Missile defense system
Post by: Wanderer on July 11, 2006, 01:42:21 am
I use to have a few screenies of accidently capturing shots of cap ship photon torpedoes by Omniscaper (using helios table). Detonating against each other when two opposing ships are firing at each other.

Should have kept them as I didn't think it significant at the time. Sorta neat to think that helios's can strike each other and detonate. Of course I don't  think they were targeting each other, just happened to be in the opposing bomb's flight path and that these weren't missiles, they were all bombs.

Actually - unless ai_profiles.tbl table option $huge turret weapons ignore bombs: is used - bombs will target opposing bombs and attempt to intercept them. As will beam-freed capship beams too (aka beam jamming)
Title: Re: Missile defense system
Post by: Raptor on July 13, 2006, 01:38:13 am
So... how do you stop 'huge' weapons targeting bombs again?

Nice simple 1,2,3 plain english style please.  (99% of all this techy and codey talk flies right over my head)

As a related point, why not expand the targetting system, so that turrets have a prefered target, that given a choice, they will fire at.

I remember a couple of threads in this forum which I started about turrets and turret targetting, but the coders never seemed to take any notice... :(
Title: Re: Missile defense system
Post by: Wanderer on July 13, 2006, 03:29:59 am
Create ai_profiles.tbl (http://www.hard-light.net/wiki/index.php/Ai_profiles.tbl) or (perhaps better option) use xxx-aip.tbm to do that.

-aip.tbm
Code: [Select]
#AI Profiles

$Profile Name:                               FS2 RETAIL
$huge turret weapons ignore bombs:                       YES

#End

Untotally untested and everything but it should might do the trick. Or then you might also create totally new profiles and select the proper AI profile with fred for the given mission.
Title: Re: Missile defense system
Post by: Nuclear1 on July 13, 2006, 10:26:52 am
The AI doesn't need to expend missiles on a bomb when a few good shots from flak/AAA/fighters' primary weapons will do just fine. Missiles really are best as point-defense against fighters or, better yet, bombers.
Title: Re: Missile defense system
Post by: Goober5000 on July 13, 2006, 11:45:58 am
Or you could do this (with exactly the same results):

Code: [Select]
#AI Profiles

$Default Profile: MODIFIED FS2 RETAIL

$Profile Name: MODIFIED FS2 RETAIL

$huge turret weapons ignore bombs: YES

#End
Title: Re: Missile defense system
Post by: Bob-san on September 18, 2006, 08:17:06 am
I gotta idea for this...

Why not link importance of a ship with escort list priority?

For example, interseptors on the Enif Station mission will go after bombs+bombers before they take out fighters and the cato.

Anyways, someone should develop a missile for interceptors that is the size of a hornet, dumbfire, and has a wait of 3 seconds. Range of 1km or so, and speed of 400m/s.
Title: Re: Missile defense system
Post by: EAD_Agamemnon on September 18, 2006, 09:00:40 pm
Perhaps you have just been unfortunate. Perhaps the turnents just haven't got a lock on the bomb. Perhaps the crew is changing a fresh magazine.

IRRELEVANT

Overhul the weapons to make them intercept blobs so we get interceptors on TBP. Now! I command you in the name of the allmight sweating bottle of cold beer!

(Interesting thing I realized... Why havent there been a space sim that has interceptors? Or anything similar?)

That would have to mean that even cannon fire is interceptable.  You see the Hyperion intercepting incoming plasma cannon fire in that episode (cant think of the name at this time) where they discover the Great Machine on Eps Eri. This would indeed make things interesting. All weapons can target and counter all weapons (i.e. light cannons can kill ships/fighters and be used as interceptors for use against missiles and other cannon pulses....but leave the heaviest cannons for anti ship/fighter only...or something like that.....

Sounds like a headache, but one that would certainly make for some....interesting...battles to say the least.
Title: Re: Missile defense system
Post by: Trivial Psychic on September 18, 2006, 09:54:34 pm
Interceptable primaries had been under discussion, but I haven't heard it mentioned for at least a year.
Title: Re: Missile defense system
Post by: Raptor on September 19, 2006, 11:35:39 am
Don't suppose anyone has a copy of the AI Profiles.tbl they could send my way?

Without one, the tbm thiny doesn't work, and I don't what to have to script every 'huge' weapon in every mission...
Title: Re: Missile defense system
Post by: Bob-san on September 19, 2006, 01:16:59 pm
Look though your VP's in your root directory for FS2 retail... IDK about Open builds since i'm not a programmer.

You need a VP/VPP viewer if you dont have one already. The descent tools can be found in Kara's FAQ (link in siggy). It should be under tables in like the third VP or somethin...

if you dont have on in about 3 hours, ill look through my OEM build and my Open build, and hope its there...
Title: Re: Missile defense system
Post by: karajorma on September 19, 2006, 01:51:30 pm
You won't find AI Profiles in there. It's SCP only and AFAIK isn't used by the media VPs either since they are meant to give everything default AI behaviour.

The wiki is probably your best bet.
Title: Re: Missile defense system
Post by: Raptor on September 20, 2006, 01:07:54 am
so I have to build one from scratch, listing everything in the wiki page and hope I get it all perfect?  Oh man... :hopping:
Title: Re: Missile defense system
Post by: Wanderer on September 20, 2006, 03:03:47 am
Hmmm? All blank fields use stats that are found from the code so do not even add the entry unless you want to change the value on that entry.

If you havent got ai_profiles.tbl game uses the one embedded into the code. So to add new profiles you do not need ai_profiles.tbl but rather *-aip.tbm files. Do notice that new ai profile has to be selected in fred as old missions use by default a profile named FS2 RETAIL.

So if you use ai_profiles.tbl just define the new default profile that will be used for all the subsequent missions.  And/or change the profile of the existing missions... Or use *-aip.tbm to modify the FS2 RETAIL profile.
Title: Re: Missile defense system
Post by: Raptor on September 20, 2006, 06:30:00 am
Hmmm? All blank fields use stats that are found from the code so do not even add the entry unless you want to change the value on that entry.

If you havent got ai_profiles.tbl game uses the one embedded into the code. So to add new profiles you do not need ai_profiles.tbl but rather *-aip.tbm files. Do notice that new ai profile has to be selected in fred as old missions use by default a profile named FS2 RETAIL.

So if you use ai_profiles.tbl just define the new default profile that will be used for all the subsequent missions.  And/or change the profile of the existing missions... Or use *-aip.tbm to modify the FS2 RETAIL profile.

... :wtf:... Could you repeat that in simple english?

I don't have an AI_Profiles.tbl, and I've tried a tbl thingy but that didn't work... (mostly likely got it wrong, but I've never used the things before so not surprising that )

I've looked through the VPs and there's nothing there.  All I want is to stop 'huge' weapons shooting at bombs (which is just stupid, looks daft and is annoying)
Title: Re: Missile defense system
Post by: Wanderer on September 20, 2006, 06:45:41 am
1) Create an empty text file named whateveryoulike-aip.tbm in to your mod/data/tables directory

2) Open the file with notepad and toss following into it
Code: [Select]
#AI Profiles

$Default Profile: MODIFIED FS2 RETAIL
$Profile Name: MODIFIED FS2 RETAIL
$huge turret weapons ignore bombs: YES

#End

3  a) Now if you create a new mission it has by default the new ai profile in use.

    b) For existing missions you have to edit the mission files with FRED. Go to Mission Specs editor and select the proper AI behaviour from the pulldown list on the lower left section of the editor. Or do the same with notepad to mission files by adding line $AI Profile: FSAlt Default[/i] right before the #Command Briefing section.



You could also perhaps edit the FS2 RETAIL behaviour (= the one game normally uses) with following *-aip.tbm file
Code: [Select]
#AI Profiles
$Default Profile: FS2 RETAIL
$Profile Name: FS2 RETAIL
$huge turret weapons ignore bombs: YES
#End
It might function nicely without any fooling with the mission files but i cant give 100% on that.