Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: 0rph3u5 on December 03, 2013, 03:21:07 pm

Title: EMP and the AI (especially non-fighters)
Post by: 0rph3u5 on December 03, 2013, 03:21:07 pm
Hey,

I'm currently working on a mission (still drawing-board stage) but for the mission it is important to know exactly which effects EMP weapons have on the AI, esspecially when it comes to non-fighter craft and how important the "$EMP Intensity:"-value assigned to the weapon is.

Wiki has no answers, except for the pointer that AI IS affected by EMP, and search isn't turning up anything useful either.
Title: Re: EMP and the AI (especially non-fighters)
Post by: Bullhorn on December 03, 2013, 06:00:55 pm
Bump.
I find this interesting also.

My guess is it affects targeting,  ie accuracy.

BH
Title: Re: EMP and the AI (especially non-fighters)
Post by: Rodo on December 04, 2013, 07:21:09 am
I think it does not, if you order a ship to attack and it's emp'd it will still fire. The difference is that the lock-warheads will not home in I guess?
Title: Re: EMP and the AI (especially non-fighters)
Post by: Fury on December 04, 2013, 08:49:44 am
I have always been under impression that EMP does not affect AI in any way.
Title: Re: EMP and the AI (especially non-fighters)
Post by: MatthTheGeek on December 04, 2013, 09:56:54 am
Pretty sure it makes them switch target just like players, which means they'll go after random targets. Which may be useful to make bombers, FREDed to attack a friendly capship, get busy with fighters instead.
Title: Re: EMP and the AI (especially non-fighters)
Post by: 0rph3u5 on December 04, 2013, 02:50:44 pm
I have always been under impression that EMP does not affect AI in any way.

I was too ... but then I stumpled over the following pointer in the Wiki:
Quote from: Wiki, http://www.hard-light.net/wiki/index.php/General_hints_%28FRED%29
Believe it or not, the EMP effect also works on AI-controlled ships. Bear this in mind while creating nebula missions.

In the Veteran Comments of the EMP- and EMP Adv-Missiles I also found refernces to them scrambling the targeting of bomber (since all bombs in FS are aspect seekers there might be a rule in there)

But what I'm most concerned is what it does to turrets...
Title: Re: EMP and the AI (especially non-fighters)
Post by: niffiwan on December 08, 2013, 08:40:51 pm
I have had a look at the code, and if I've read & interpreted it all correctly, EMP weapons should have the following effects:

1) Any weapons (with hitpoints and without WIF2_NO_EMP_KILL flag) within 0.25 * EMP weapons outer radius should stop moving.  It kinda looks permanent, I guess weapons auto-detonate when their lifetime runs out?  (As an aside; the kill-within-distance doesn't match what the comments say, I guessing it should have maybe been 0.75 * outer radius.  Regardless, IMO that hard-coded value would be a good candidate to add a weapons table entry for).

2) For ships that have these flags (SIF_BIG_SHIP or SIF_HUGE_SHIP), their turrets within the outer radius will stop firing while they are disrupted. The default time is 7.5 secs, this can be overridden by a weapons "$EMP Intensity:" IF the weapon flag "same emp time for capships" is also set.  The EMP duration is also scaled as a proportion of the distance between the inner & outer radius.  Ships can also have an "$EMP Resistance Modifier:" which also affects the time.

3) For other ships, it's pretty much the same except set of calculations/values except:
a) the flag "same emp time for capships" is irrelevant
b) EMP target loses their current target and reacquires targets randomly until the effect wears off
c) AI aim suffers a penalty (if I'm reading this right, it's a fairly big penalty)

Hope that helps everyone who had questions.  If it's useful and you can verify these behaviours in game, it'd be good to update the wiki :)