3D modeling question / Making missiles harder to hit

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

Well that sounds about right, the ISR isn't truly and anti-fighter weapon so if it has a bit of an issue hitting them it's not really much of an issue. Reason I ask is I was going to design fighter and anti-fighter weapons to be able to hit fighters due to speed and accuracy rather than large rapid box. That could result in desirable side effects like effective missiles, equally effective active countermeasures etc...

Not to mention fighters have a proper role instead of M2 killing machines the size of an annoying gnat :lol:
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

paulwheeler wrote:I have been testing bullet rapid box sizes down to about 0.002, but the more I test, the more I think that past a certain size (about 0.05) the rapid box doesn't really seem to make much difference.
You get dimnishing returns on the scaling if
bullet <<<>>> missile.

Simple geometry issue.

The area in which a hit will be scored is
A = ( r Missile + r Bullet )^2 * Pi

The father away from "equal" you get, the less further downscaling of the "small bit" will achieve. (see last column)

Code: Select all

r msl   r bullet          %      change from previous
100     100             100,0
100      95              95,1    4,9
100      90              90,3    4,8
100      85              85,6    4,7
100      80              81,0    4,6
100      75              76,6    4,4
100      70              72,3    4,3
100      65              68,1    4,2
100      60              64,0    4,1
100      55              60,1    3,9
100      50              56,3    3,8
100      45              52,6    3,7
100      40              49,0    3,6
100      35              45,6    3,4
100      30              42,3    3,3
100      25              39,1    3,2
100      20              36,0    3,1
100      15              33,1    2,9
100      10              30,3    2,8
100       5              27,6    2,7
100       0              25,0    2,6

 50      25              14,1    
 45      25              12.2
Given identical starting sizes, halving missile (or bullet) size once gets you a 44 % reduction in hit area but halving it again only gets you a 30 % reduction of the previous value.

Effectively that means that if you run into dimnishing returns, you need to downscale the bigger bit.


Luckily, this can easily be tested in-game.
Assign the missile model to a ship, then have a turret auto fire 10000 rounds on it.
Count hits.
Doesn't even take any tricky counting.
A ship without shields, 1.000.000 armor. Every laser hit does 1 armor damage. Substract.

Did that (manually) for my first tests but I'd write a test script to test all missile types vs all rapidbox sizes.

Using this data, the laser(s) can then be set to exactly the desired efficiency.



Gazz wrote:A lot easier that way than messing around with ship AI, jobs, default loadouts...
The loadouts would require some thought, though, because a ship would be unable to do missile defense without having at least a few PDL on board.
An idea to eliminate any messiness with ship loadouts:

Every turret that can use the PDL is automatically equipped with it.
The PDL is the "coax MG" of the big barrel.

That's not much of a freebie because this "flechette gun" is useless against anything armored... which includes any and all ships.

In game terms it's a laser with 0 credit value and 0 cargo requirement.
When a turret decides to engage a missile, the PDL is automatically added to the ship's cargo... and installed into the laser bay.

No mess with default loadouts are available cargo space, no fuss.
Every ship that is designed with missile defense turrets "automatically" comes with them preinstalled.

Larger ships (bigger ship and / or cargo class) will summon bigger PDL out of thin air, much like the missile compatibility mask works.
They need more range so the PDL can reach beyond the ship's own hull at all.
A Phoenix is 4700m long...
Last edited by Gazz on Tue, 24. May 11, 19:06, edited 3 times in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths »

Like the idea of the zero cargo/zero value PDL but I do have one question? What SG_LASER_... group would you plan to use?
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

Roger L.S. Griffiths wrote:Like the idea of the zero cargo/zero value PDL
Yah, it avoids a crapload of issues that I had back in the Racial Laser Mod.
(there were over 400 lasers in that mod)
Lots of AI ships spawn with full cargo holds or lopsided weapon loadouts. Then they'd have no space to add this PDL...

No way in hell I'd make that mistake twice. Been there, done that, lost the hair.


Neat side effect: You wouldn't have to arm freighters if all you want them to run is "missile defense only".
They'd come with the "coax MG" as factory default.
No need to fly across the universe trying to find the correct laser type when you don't even want them to have an actual weapon.
Putting "fighting" lasers on a freighter always seemed wrong to me but well... it was the way things worked.


Roger L.S. Griffiths wrote:What SG_LASER_... group would you plan to use?
IMO, trash the Cluster Flak.
Beyond the sparklies it's the single most redundant laser in the game.

It was a neat idea but it will never be especially useful given it's actual implementation and how turret scripts can use a laser.

Anyone have a better idea? Pretty much all other lasers are tied into a balancing matrix.
The CFAA compatibility can be changed to FAA with hardly any side effects.

Would have to deal with CFAA factories or ware entries on docks but they could just be changed over to Flak. No major hair-puller.


The PDL sharing an SG group with a "real" laser would only cause all kinds of trouble.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

Unless it was the something like the Repair Laser or one of the unused dummies. Taking the slot of a racial weapon isn't something I'd choose to do, but hey ;)

It's not like it'll get randomly equipped outside the script.
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths »

I would go with SG_LASER_SPECIAL for compatibility (Mining Laser, Repair Laser, Tractor Beam) and perhaps repurpose one (or both) of the SPARE LASER TLaser entries (SS_LASER_DUMMY1/SS_LASER_DUMMY2) and TBullet entries (SS_BULLET_DUMMY1/SS_BULLET_DUMMY2). Doing this would make merging with 99% of other mods a breeze.
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

I wouldn't want to use the DUMMY lasers because I think they are used for the Earth turret super lasers.
Wouldn't want random AI ships spawning with these. (which in turn would mean that the player could board them)

The "tool" lasers, well... having repair / tractor laser available for practically all ships is a balance issue.
Some mods actively use those and I wouldn't want to mess with them.

The CFAA is argueable, of course, but in vanilla X3 you wouldn't notice any difference if all occurrences were replaced with the FAA...

It's true that it means more "fixing" in game, whereas putting them in with the "tool" lasers does not.
*shrug* I don't think there's a right answer. Only a choice of handicaps.



Hmm... actually, I can do both!
A detection routine that I used in MARS which will find out if a certain modded laser exists... and on which laser ID.
A small setup script would find out WHERE the PDL was put by the modder and if it exists in the current mod at all.
The turret script just uses the detected ID.
Damn, I'm good.

If the modder disagrees with my choice of laser group - shove it into another.
Beautifully simple and makes no difference beyond 1 global variable query at the start of the turret script.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

I thought the Earth Super Lasers were script kills (never seen one fire). I haven't verified that the dummy's are used for them, though will be checking that out shortly.
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
paulwheeler
Posts: 8132
Joined: Tue, 19. Apr 05, 13:33
x3tc

Post by paulwheeler »

Yes, I believe the Torus weapons are not actual weapons too, but scripted.

Plus the Special subtype is one of those that has its AI spawning disabled (the others being all the beam subtypes and the spare subtype).

I agree putting it on the Special subtype is the best course of action. I certainly don't want to remove any weapons from the game to accommodate this.

However, I'm not entirely convinced this is the best idea as it means the AI will have no defence against missiles as the weapon will never spawn, unless the weapon spawning is going to be scripted... but aren't we trying to avoid complicated scripting methods? Adding a new weapon just to take out missiles seems to me to be a convoluted approach to this. Don't forget you'll have to add forges for the weapon, places to sell it, etc. I would rather go down the path of trying to balance weapon accuracy against missile size. It may take a bit of trial and error, but at least once its done its done.

Having done more testing with the missile mod I posted above, I do think its close to being what we are after. With that, I would say on average 50% of missiles hit their target with Missile Defence Mk2 installed, I don't suppose anyone else has tested it...? In the next day or so I will try and put together a version of the CMOD with weapon rapid boxes severely reduced.

By the way... are we sure that the missile/laser hit isnt scripted? I'm just saying this as even if you give a weapon zero hull damage, it still takes out missiles...
User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

Aren't missiles just s special case item that if you hit it it dies, with no hit point calculation?

Again I'd like to reiterate that I'm not sure making a new weapon is the solution. I still think that reducing rapidbox sizes (even weapon fx model sizes too) to a point where missiles are useful and fighters have a slight benefit from not being bullet magnets would be a better alternative coupled with the 50% size missile models.
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
User avatar
Sartorie
Posts: 389
Joined: Sat, 10. Apr 04, 13:05
x3tc

Post by Sartorie »

the Torus turrets are actually supposed to use both, real laser shooting at you and scripting direct damage ... but I think the real shooting is slightly bugged ;)

however you can just replace the vanilla !fight.torus.turret with an adjusted script which only deals fake damage and repurpose the laser group however you like

I like the idea of point defenses in general but with the limited turrets available the turn speed could become an issue with swapping weapons to fire one shot at a missile and then turn back (unless you skip the turning of course) ... as an alternative you could try using a special missile to shoot down other missiles, give it bullet graphics and make it real fast but short lived - perhaps making it pretty unmanouverable too so it is likely to miss a lot
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

paulwheeler wrote:but aren't we trying to avoid complicated scripting methods? Adding a new weapon just to take out missiles seems to me to be a convoluted approach to this. Don't forget you'll have to add forges for the weapon, places to sell it, etc. I would rather go down the path of trying to balance weapon accuracy against missile size. It may take a bit of trial and error, but at least once its done its done.
Explained in some posts on the previous page.
It's not nearly as problematic as you think.

Some scripting required but no permanently running, bulky, and universe-altering scripts.

A PDL could even be added to several lasers in the compatibility mask, such as IRE + FAA + CFAA.
That way all turrets that are supposed to do missile defense, can do so.
TCockpits.txt does not need to be modded at all, increasing compatibility.

The advantage of this is being able to stay with the cockpit's balance.
An IRE turret would automatically have a "light PDL", while the Flak turret gets a medium or heavy PDL. They'd just have more range because cap ships need a lot more bullet range than fighters so their turrets can even reach the missile before they hit the hull.

They may not use the same item but since they all have the same name and all do the same thing - who would complain?
It's not perfectly pretty because a ship would list multiple "PDL" as compatible but that makes it easier to adapt to other mods.

Dumping all PDL into one laser class means sweeping changes to TCockpits.txt, which is quite a bit of work.


Sartorie wrote:the Torus turrets are actually supposed to use both, real laser shooting at you and scripting direct damage ... but I think the real shooting is slightly bugged ;)
Regular turret instructions can only "aim" at objects that are within 10 km.
The laser has something like 100 km range.
It can shoot that far, it just cannot determine if it's properly aligned to the target... and therefore allowed to fire.
So it tracks the target,
then tracks it some more,
then tracks it some more,
then tracks it some more...

Guess the scripter just said "screw this" and scripted a "destroy target" instead of the entire aim/fire routine.
It's a sorry hack but if you're given a 20 min timeframe for fixing the issue, your options are limited.

MARS can aim / shoot beyond 10 km but it's not something you'd want to do in every "dumb" turret script that does the complete aiming routine every 80 ms.


Sartorie wrote:I like the idea of point defenses in general but with the limited turrets available the turn speed could become an issue with swapping weapons to fire one shot at a missile and then turn back
It's really not that bad if the laser has decent turning speed.
And I'd expect it to be rather swift because it's a "very light" weapon, doing insignificant damage to ships.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths »

Gazz wrote:A PDL could even be added to several lasers in the compatibility mask, such as IRE + FAA + CFAA.
That way all turrets that are supposed to do missile defense, can do so.
TCockpits.txt does not need to be modded at all, increasing compatibility.
The problem with that (if it works at all - not sure if the engine will behave as expected with multiple bits set in that flag) is that you could end up with the Vanilla MCSI equipment automatic selection equiping PDLs in cases when you really want the other weapons.

EDIT: Raw value of TLasers sub-type is a string not a bit-mask, so the multi-compatibility for a single laser will not work.
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”