EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
[SCR] Missile Defense Mk2 (v2.28 - 17.12.11)
Post new topic Reply to topic Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
View previous topic :: View next topic
Author Message
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
modified
PostPosted: Fri, 6. Mar 09, 21:41    Post subject: [SCR] Missile Defense Mk2 (v2.28 - 17.12.11) Reply with quote Print

English / Deutsch (contains no text so works with every language)

MD Mk2 is not compatible with X3: Albion Prelude.
That is probably because an improved version or it is already included in vanilla AP.



Turret Missile Defense Mk2

  • This script improves several Egosoft turret scripts.

    Missile Defense (Player)
    Missile Defense (AI)
    Missile Defense Only (Player)
    Attack Enemies (AI)
    Attack Enemies (Player)

    "Protect Ship" is not covered because it never shoots at missiles so there would not be any real advantage over the ES script.

  • All ships in the game will use those instead of the original versions.

    On player owned ships you will have to restart the turret script if you used the original Egosoft scripts before. Version updates from MD Mk2 v2.00+ to the current version do not require a restart.

  • Obviously it uses more CPU power than the default scripts but the difference is very small. (for a change)

  • The default missile defense scripts were painfully inadequate when more than one missile was incoming.
    In fact, all MD turrets of a ship were concentrating on the closest missile even if it was on the other side of the ship.
    They never attempted to target the second closest missile instead - the one they could have hit.

    Especially the engagement of multiple incoming missiles is massively improved.

  • Target priorities

    Missiles always and without exception take priority.

    With "Missiles Only" the priorities stop right here.

    The turret will fire back at ships it was attacked by.

    The turret can also attack the current (script) target of it's ship if it's executing one of these orders:
    • Kill all enemies
    • Kill all enemies and land
    • Kill enemies in range


Turret Attack Enemies Mk2
  • This is the other default script that AI ships' turrets use and it aggressively targets anything... hostile.

  • The target priorities have undergone slight tweaking as well.
    (1, 5, and 6 are changes compared to the original Egosoft script)

    1. If the turret can fire capital ship lasers like PPC it at least attempts to find a worthy target instead of toying with the fighter drone that happens to be the closest target.
      On player ships it does not check if the turret can load big guns but if there is one in the first slot of the turret. This check is repeated every 2 minutes and when the script is restarted.

    2. the turret fires back at ships that have caused damage

    3. it fires at the target that it's ship is attacking (under autopilot control)

    4. it fires at any enemy within it's firing arc.

    5. If no enemy target is found, it does missile defense.

    6. Only if a massive missile attack is incoming, the turret assigns priority 1 to missile defense until the situation is under control.
      No ship can afford to ignore an M7M's missile barrage and an M6 can't ignore even a single Firestorm Torpedo...


Rate of Fire
  • Egosoft Missile Defense generally fires all lasers at a low rate, other ES turret scripts at a mediocre rate.

  • MD Mk2 always uses a low rate of fire when firing at missiles.

    When firing at ships, it automatically adjusts it to the installed lasers.
    PRG/PBE are fired at a high rate and even the ROF of heavy lasers like PPC can be slightly improved because the script tries to find the optimal "wait"... that is when all lasers have recycled.

    It's actually a very simple system. If "fire" is successful, lower the delay. If not (lasers not ready, yet), it must have been too short so increase it. A "calculation" like that isn't costly.

    This is very different to the approach of some other turret scripts, that just reduce the script's "wait" in general. The whole script would then always run at the fastest possible pace, whether that's useful or not.


Automatic Weapon Switching
  • The script includes an "Artificial Life Plugin".
    Using this you can adjust which ships should automatically switch lasers depending on the range / enemy.

  • Available modes:
    • OFFLINE. Your ships as well as the AI will use vanilla scripts.
    • Vanilla mode. Player ships never switch weapons. AI ships do.
    • Player big ships. M6, M1, etc. will switch automatically.
    • Player big ships + TL. Same + TL.
    • All ships switch weapons automatically. Not recommended but it's your game. =)

  • Changes will take effect after the next save / reload and then possibly after one more sector change.


Download: ZIP


Installation
Copy the contents of the zip into \TC\ so that the scripts end up in the \scripts\ folder.

Deinstallation
Delete setup.plugin.gz.missile.def.mk2.xml.

Tech Stuff
Scripts can detect if Missile Defense Mk2 is currently active in the game:
Code:
$Dummy1 =  last load time
$Msl.Def.Mk2 = get global variable: name='GZ.MSL.DEF.MK2'
skip if $Dummy1 == $Msl.Def.Mk2
|$Msl.Def.Mk2 = null

This returns an accurate and current value even after setup script has been deleted.

Added for scripters and personal laziness:
plugin.gz.missile.load.auto
This script can be started without any arguments on any turret and then automatically runs with "intelligent defaults", like doing Attack Enemies on PPC turrets but preferring Missile Defense on small laser turrets.

Incompatibilities
Roger's EES / Changeling.
MD Mk2 voluntarily ceases to function if these are detected.

Resources used:
none


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.


Last edited by Gazz on Sat, 17. Dec 11, 16:08; edited 42 times in total
Back to top
View user's profile Send private message Visit poster's website
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
modified
PostPosted: Fri, 6. Mar 09, 21:41    Post subject: Reply with quote Print

For comparison: what Egosoft Missile Defense does
  • Frequency:
    If the ship is not attacking something (using a script!) then always wait for 5-8 sec until acquiring a new target.

  • Look for targets in this order:
    • the closest missile (to the ship, not the turret)
    • some ship that has hit me
    • the target my ship is attacking (using a script)
    • If my ship is executing "Kill all enemies", search for any enemy ship within this turret arc

  • If the found target is the closest missile, all "Missile Defense" turrets of my ship will lock onto this exact missile the next time they are looking for a new target.
    If a turret can not fire at it, it will still do nothing else until the missile is destroyed.
    Since MD turrets are typically opposed (up/down), 50 % of a ships anti-missile capacity is usually shut down by design.

  • If non-missile target: keep firing until target is destroyed or leaves this turret's arc.
    Does not switch if a missile happens to show up during this.

  • If no target, wait and start over.

  • If ship is docked, wait for up to 80 sec.
    That means that if the ship launches from somewhere, it's missile defense turrets are (individually) dead for up to 80 seconds.


Known problems:

Frequency:
If the ship is not actively attacking something - like when you board a neutral ship and "apologise" - the enforced delay between any 2 missiles is 5-8 seconds. Regardless of missiles incoming or not.
During that time a Hammer torpedo moves 1650 m.
Vanilla capital ships only ever run the Missile Defense script on turrets with short range lasers so they have maybe 2500 m laser range.
Due to that timer the turret has to be very lucky to be able to even look at a 2nd missile in the incoming swarm.

Most likely that is the reason why "ships never react when missiles are fired from far away".
Technically they do try to defend but they only get one chance to target the first missile if it's within range after the current 5-8 sec "tick".
When the waiting time is up and the script is looking for the next missile, the whole missile swarm has used this time to cross Flak range and it's over.
At this point the "Minimum range" condition may already apply. See below.

This is one of the reasons why boarding is such a laughably trivial affair with M7M.
Fire measured barrage, apologise, fire boarding pods. Transfer jumpdrive and send new ship to homebase. Next, please.


Minimum range:
If a ship is attacked with numerous small missiles like Flail, one of them is bound to get close to the ship.
If that happens, the closest missile (the only one turret scripts can target) has gotten behind the turret camera.
No turret can just turn 180° and "look behind".
Now all turrets target this missile. And they can not see it. So they wait.
Once it impacts (which will be soon), they look for a new missile.
However, since they were not doing anything while waiting for this one missile to be destroyed, another few missiles have gone into below minimum range.
So the turrets wait until this missile, too, is destroyed or enters their firing arc. (fat chance)
Since they were not doing anything while... umm... do you see a pattern here...?

So once the first missile of a swarm hits, there is a high chance that all Missile Defense turrets of the ship will "freeze" and oscillate between waiting and starting to turn towards the next missile - which they will not have time to complete.


Turret arcs:
On the average capital ship (like an M2), the front turret is running "Attack enemies".
This turret script never ever fires at missiles.
If a player-controlled M7M tags this M2 with a few Flails then the ship eventually starts chasing the M7M.
This means that there is no missile defense whatsoever in a slim corridor straight ahead.
Remember the chasing part? That slim corridor is the exact path that every missile fired from the M7M will take to travel to this target.

So there is an exactly 0 % chance that an M2 can shoot down any of your missiles or boarding pods while it's chasing you.



And some people still consider M7M balanced.
Cost: Maybe 1.5 MCr in ammo plus (reusable) marines
- a few Flail to aggro the ship and fine tune the shield level
- maybe 20 Hammers to drop the shields
- 1-4 boarding pods
Profit: Maybe 90 MCr
- One M2 with possibly some equipment leftover.

That's an interest rate of 5000 % on your... investment.
Not bad for a few minute's work, considering that there is no risk to you or your marines whatsoever (except for the fighting on board of the target ship) and no chance of failure once you have a handfull of decent marines.



Last edited by Gazz on Thu, 9. Jun 11, 20:38; edited 10 times in total
Back to top
View user's profile Send private message Visit poster's website
StormMagi



MEDALMEDALMEDAL

Joined: 17 Mar 2007
Posts: 1155 on topic
Location: California, USA
Thank you for registering your game
PostPosted: Fri, 6. Mar 09, 21:51    Post subject: Reply with quote Print

How well does this work with MARS?


_________________
MOD XR Show Skills

Flying spaceships since 1993.
Back to top
View user's profile Send private message
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
modified
PostPosted: Fri, 6. Mar 09, 22:11    Post subject: Reply with quote Print

Not at all.
It's a completely separate script. They have nothing to do with each other.

For a transport with some peashooter turret it should work perfectly fine where MARS is monstrous overkill - in terms of CPU cost for what that little turret could possibly do. But it's your CPU so... *shrug*

There are no controls and no configuration and there won't be any.
Other than possibly small tweaks I don't expect that I'll improve it any more.

An M7 with 3 Missile Defense turrets (2 or which were Gauss, so no classic anti-missile lasers) was able to fend off 60 hammer torpedoes before any reached the ship.
They arrived near simultaneous, too, being fired from 4 M7M at once.
Compare that to the original. (But don't be in the target ship when you do)


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.


Last edited by Gazz on Sat, 7. Mar 09, 14:06; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
StormMagi



MEDALMEDALMEDAL

Joined: 17 Mar 2007
Posts: 1155 on topic
Location: California, USA
Thank you for registering your game
PostPosted: Fri, 6. Mar 09, 22:59    Post subject: Reply with quote Print

Ok, Btw the download link just links to the gif for downloading


_________________
MOD XR Show Skills

Flying spaceships since 1993.
Back to top
View user's profile Send private message
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Fri, 6. Mar 09, 23:02    Post subject: Reply with quote Print

No.
It works fine with both MSIE and Firefox.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
StormMagi



MEDALMEDALMEDAL

Joined: 17 Mar 2007
Posts: 1155 on topic
Location: California, USA
Thank you for registering your game
PostPosted: Fri, 6. Mar 09, 23:06    Post subject: Reply with quote Print

my bad looks like my copy of FF doesnt like it


_________________
MOD XR Show Skills

Flying spaceships since 1993.
Back to top
View user's profile Send private message
Ook





Joined: 28 Dec 2003
Posts: 39 on topic

Thank you for registering your game
PostPosted: Fri, 6. Mar 09, 23:51    Post subject: Reply with quote Print

I have the same problem with MSIE 7, using `View Source` shows faulty html code is the reason.

The download image is an <a></a> tag instead of an <img /> tag as it should be.

Back to top
View user's profile Send private message
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Fri, 6. Mar 09, 23:58    Post subject: Reply with quote Print

There are no HTML tags in that post. It's all BB Code.

Apparently your browser or the browser / forum combination messes up somewhere in the conversion.
Or it's time to sacrifice another chicken.

Maybe you have some creative settings in your forum config?


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
someone else





Joined: 18 Jun 2006
Posts: 2970 on topic
Location: Italy
Thank you for registering your game
PostPosted: Fri, 3. Apr 09, 18:08    Post subject: Reply with quote Print

mmmh... I downloaded it and it is just fine, Very Happy I don't want all AI bigships to use MARS (It will be madness) and still I don't want to be on the only ship in the universe who can shoot down missiles Laughing (I feel it's like cheating). Good thing Gazz!

I have an idea on the "downloading problem":
maybe some disorienting comes from the fact that your download link links to the download page of your site (where a wealth of life-saving scripts/mods are listed). If the others right clicked on it and selected "save with name" they saved the page of your site, not the "missile defence mk2".

Back to top
View user's profile Send private message
semiliterate





Joined: 13 Dec 2008



PostPosted: Fri, 3. Apr 09, 23:54    Post subject: Reply with quote Print

um, if this is the only thing in the ship script debug thing in the SE, and i have a constant ping of some kind (i can't tell which pinging noise it is because it's about ten a second), could it be this?

if not, do you know what instruction in a script would play a pinging sound, so i can search for it?

Back to top
View user's profile Send private message
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Sat, 4. Apr 09, 00:13    Post subject: Reply with quote Print

play sample

or using the simple explorer file search,

play sample 



I'm pretty certain it's not from Missile Defense Mk2, though.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Sat, 4. Apr 09, 00:14    Post subject: Reply with quote Print

play sample

or using the simple explorer file search,

play &# 160;sample &# 160;
(remove all spaces)


I'm pretty certain the pingadingaling is not from Missile Defense Mk2, though.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
semiliterate





Joined: 13 Dec 2008



PostPosted: Sat, 4. Apr 09, 02:28    Post subject: Reply with quote Print

oh woops

um, i should have posted that in the Missile Safety thread. but thanks, i'll have a look.

Back to top
View user's profile Send private message
Hieronymos





Joined: 30 Dec 2005
Posts: 829 on topic
Location: California--A State of Mind
Thank you for registering your game
PostPosted: Thu, 16. Apr 09, 03:28    Post subject: Reply with quote Print

Finally blundered to your thread Gazz. Thanks for creating this! It's perfect for both player & ai M4+/M3/M3+, and even M6's that don't rate MARS--and its cpu needs.

So the script just targets missle nearest each turret?
Meaning it doesn't have any threat evaluation/weighting abilities like MARS for different missle types?

Will it target enemy fighters in range if no missles are present (if said fighter(s) haven't (yet) attacked ship?

Thanks Gazz, you're a lifesaver.
............

It just occurred that this script would be an amazing foundation for a slightly more sophisticated "Point Defense" script, that would prioritize missle targettting, but then switch to heavier weapons (like FAA,CFA) for firing on closest fighter.

I'm assuming here (displaying my ignorance probably) that the uber-high muzzle velocity weapons like PBE and kyons are the best anti-missle weapons, right? And that Flaks are perhaps not as good, and much much more power hungry? So if script would choose 'best (available) anti-missle wpn' when firing on missles, and then 'best (available) anti-fighter wpn' when firing on fighters..then a low-cpu PD product!

This all assumes that your research with MARS has created tables of 'best' weapons for each target type: BigShips, fighters, missles..right?


_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Thu, 14. Dec 17, 00:32

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.17117 seconds, sql queries = 29