Author Topic: Additive Weapon Velocity + Missiles... problems.  (Read 2911 times)

0 Members and 1 Guest are viewing this topic.

Offline Sushi

  • Art Critic
  • 211
Additive Weapon Velocity + Missiles... problems.
When the $use additive weapon velocity: flag (in AI_Profiles) is set, it kind of breaks most missiles right now (or at least makes them "feel" wrong, see below).

Missiles maximum speed is affected by the motion of the firing ship, instead of just their initial speed. This means that if you fire a missile while gliding backwards, it will move agonizingly slowly and be pretty much useless as a weapon. Although this behavior makes some amount of sense for "rocket" style missiles, it feels very wrong for any type of homing missile.

The problem is made more complicated by the fact that missiles do not accelerate. Some of them have a "Free flight" stage where they move at (firing ship speed + 1/4 missile speed) for however long the stage is, but that's it. The result is that the additive velocity given to missiles affects their maximum speed, which is what feels so wrong. The idea that a missile can turn but can't accelerate even to its specified maximum speed just seems silly IMO.

So what can/should we do about it?

1). Add an optional "Acceleration" parameter for missiles. If specified, missiles always start at 0 (or inherited momentum if additive weapon velocity) and accelerate up to their top speed. If they somehow start over top speed, they would decelerate to that speed using the same factor (alternately, a separate "Deceleration" parameter could be provided). This would be generally useful whether or not additive weapon velocity was in use. Most importantly (for this discussion :p) it would provide a way for missiles to accelerate/decelerate to their desired speed, no matter at what speed they were launched.

2. Disable additive velocity for homing missiles. They would still inherit momentum during the "free flight" stage (if specified for the missile) but would then instantly switch to normal flight characteristics after that.

3. Leave things how they are. Maybe I'm the only one who thinks this needs changing. :)

4. Other? (Your idea here)

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Additive Weapon Velocity + Missiles... problems.
You silly Diaspora guys and your backwards flying stunts...
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Additive Weapon Velocity + Missiles... problems.
I've always wanted a
Code: [Select]
+Acceleration: parameter, but the problem is the guidance code would need to be modified.

Actually, I'm currently stuck trying to figure out guidance for missiles in my non-FreeSpace game (in which the missiles are subject to the laws of Newtonian Relativity). It's not as easy as people would like to think.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Additive Weapon Velocity + Missiles... problems.
If we can give them a very short free flight time, 2 would solve most of the problems with this. Does anyone actually use this flag apart from Diaspora?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Sushi

  • Art Critic
  • 211
Re: Additive Weapon Velocity + Missiles... problems.
I've always wanted a
Code: [Select]
+Acceleration: parameter, but the problem is the guidance code would need to be modified.

What about it, exactly? Just that the guidance code makes assumptions about missile speed that break when that speed is changing?

If we can give them a very short free flight time, 2 would solve most of the problems with this. Does anyone actually use this flag apart from Diaspora?

That's my thought too... #2 is the quick & dirty solution that solves immediate problems, while #1 is theoretically more elegant but practically more complicated to implement.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Additive Weapon Velocity + Missiles... problems.
I turned it on for FotG but it won't affect us since we always fly forwards.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Sushi

  • Art Critic
  • 211
Re: Additive Weapon Velocity + Missiles... problems.
I turned it on for FotG but it won't affect us since we always fly forwards.

Actually, it will. For better or for worse, if you fire a homing missile while moving forward it will travel faster and further than one fired from a standstill.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Additive Weapon Velocity + Missiles... problems.
That's how I thought it was supposed to work.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Sushi

  • Art Critic
  • 211
Re: Additive Weapon Velocity + Missiles... problems.
That's how I thought it was supposed to work.

Well, that's why I wanted to bring this up for discussion. You can definitely make the case that having homing missiles traveling different speeds is what you want. Myself, I think it causes more problems than it solves and results in missiles behaving counterintuitively.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
Re: Additive Weapon Velocity + Missiles... problems.
My general solution, in cases like this (in my own games) is to gradually bring the missile's speed closer to its maximum [cruising] speed. If it starts too slow, it accelerates. If it starts too fast, it decelerates. But if instead you give it an initial (relative) velocity of zero, then it won't [generally] start too fast.

This, however, won't work well if you have uncapped ship speeds.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Additive Weapon Velocity + Missiles... problems.
Missiles should probably accelerate to an optimal speed relative to their target.  So they should have an acceleration factor, and then, if they start with forward velocity, they probably won't have to acccelerate as much, and if they start with negative forward velocity, they will just have to accelerate for a longer period of time.  Really though, how do those missiles work in space?  I don't see any maneuvering thrusters.  Fins are only any use in atmosphere.  Still, we'll pretend steering is affected by the fins and not thrusters, the acceleration thing would definitely make them seem 'smarter'.  They just attempt to reach a velocity where they're programmed to believe is ideal for making sure they hit their mark.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: Additive Weapon Velocity + Missiles... problems.
You silly Diaspora guys and your backwards flying stunts...

Tachyon did it before BTRL... FS will do it again.  :P
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Additive Weapon Velocity + Missiles... problems.
Well as for maneuvering they could be internal gyroscopic directional thrusters.  That would explain the need for them to burn fuel constantly. 

Is the also going to address the problem of them flying backwards at first then doing a u-turn?  Additive velocity helped that problem but didn't fix it.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline darkdaej

  • 27
  • Wingmen: Useless buggers
Re: Additive Weapon Velocity + Missiles... problems.
You silly Diaspora guys and your backwards flying stunts...

Tachyon did it before BTRL... FS will do it again.  :P

not to mention the X series.

on X3 i cannot LIVE without WASD strafing and backwards piloting

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Additive Weapon Velocity + Missiles... problems.
On X-Series lateral maneuvering is the only way to survive combat. :P

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Additive Weapon Velocity + Missiles... problems.
frontier ftw!

i have attempted to do accelerating newtonian missiles as part of my atmospherics script. it essentially throws out the existing missile velocity and uses one derived from a thrust value and its life time. it causes an assertion in vecmat.cpp. i think it has something to do with the ai launching countermeasures but im not entirely sure. its an intermittant crash, hard to make happen every time.

but what i would do is keep the existing free flight time, but then add a catchup phase to the missiles flight in which the missile matches speed with the target and/or closes to its optimal firing range. missile starts out at its free flight speed from the point of view of the ship firing it. then fires a catchup burn at a rate derived from $velocity/($lifetime-$freeflighttime)*some factor > 1 (squared i think), to match speeds with the target. once this is done then it would act like a normal missile, it could either accelerate from there to its $velocity, or just pop off whats left of its fuel in one instant acceleration. it would only have the remaining life left in which to hit the target (hence the need for some factor and why in needs to be greater than one).
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline darkdaej

  • 27
  • Wingmen: Useless buggers
Re: Additive Weapon Velocity + Missiles... problems.
On X-Series lateral maneuvering is the only way to survive combat. :P

understandable when the weakest weapons have ranges upwards to 2 clicks and one can get killed in a fighter-sized craft in only a couple of grazes from heavy fighter weapons (I'm thinking AHEPT's here, for those who know what i'm talking about  :beamz:)

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: Additive Weapon Velocity + Missiles... problems.
Weakest? Plasma Throwers are the most powerful non-projectile-based weapon fighters can carry, the weakest weapons have a range of 800 meters.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Additive Weapon Velocity + Missiles... problems.
Back on topic guys.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: Additive Weapon Velocity + Missiles... problems.
Ok as a preliminary for much abuse and adjustment

Variables

Launcher Speed         LS   - Firing ships speed
Initial launch velocity      ILV   - the velocity of the missile when leaving a launcher ( could be set as Weapons table or assumed to be the same for any missile)
Total Launch Velocity      TLV   - adding of above
Increase of velocity      IOV   - the amount the missile increases speed per amount of time
Rate of acceleration      ROA   - the rate the missile increases speed
Target velocity         TV   - The speed the missile is attempting to reach (set either by Weapons.tbl or set in relation to target)
Maximum acceleration duration   MAD   - the amount of time the missile can accelerate - simulate management of fuel consumption rates to achieve desired balance between range and speed)
Missile Velocity      MV   - The missiles speed at that instance

   
MAD = 10         (Missile acceleration time limit in this example 10 seconds)
LS = (the name of the variable holding the launching ships speed)
ILV = (whatever we are pulling this velocity from)
TLV = LS + ILV   -      Now we have the speed the missile is launching at
IOV = 10         in this example the missile increases speed by 10 meters per second per second
ROA = 0.5         in this example we increase the missiles speed at a rate of half a second to simulate continual acceleration
TV = (weapons.tbl entry)
MAD = 10         the missile accelerates for a maximum of 10 seconds


while OR((MV<TV),(MAD=0)   Establish the repeat
then
   MV=MV+IOV      set the missiles velocity  to itself + the increased ammount
   MAD=MAD-ROA      reduce the MAD
   delay(ROA seconds)   Delay the cycle for the interval amount
   IF (MAD<0 then MAD=0)
repeat
end 
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art