Hi Admiral,
I'll send you the files separately in a DM. I made a lot more changes over the weekend. I wouldn't want any of this released in the wild without your permission / buyoff. If you'd rather I just publish here, that's fine, let me know.
I don't have a coding background. I'm also not an aerospace engineer or missile expert, so please take everything I am about to say with a grain of salt.
I'm not sure some variables in the coding actually mean what I think they mean, so I want to be transparent so I can figure out where I am wrong. This is the first time I really looked at weapons coding in DCS, this has been a learning experience.
Like I previously said - When I use the Styx/ P-15 missiles as currently coded, they can't be shot down by Ashleigh Burkes or Ticonderogas. The missiles don't seem to be detected till the last second and the ships don't fire SM-2's at them. I think it's a combination of 3, maybe 4 things - the mods cruise 6 meters off the surface, they cruise at just below 1k knots so almost always supersonic - mach 1.4 or 1.5, they have a low reflection / RCS, and they don't turn their own radars on till they are about a km from the target.
In the version I downloaded "line #39 v_mid in the OSA_Styx.lua file" was set to 470, I don't see a 704 milliseconds. I assumed the 470 is in km/h, and I think it might be correct or at least close enough. I don't think that variable is the cause of the high speed though, I think the high speed is due to the low weight in the fm and high impulse in the march code. I really struggled with those sections though - more on that later.
I did some research which was Wikipedia bounced against a few other websites that weren't just clones of Wikipedia.
As best I can tell, the original styx A/ P-15 Termit was used by the Osa 1 (project 205). It didn't have folding wings (I don't really care about that), was launched using a booster with 30 tons of thrust, popped up to maybe 300+ meters after launch then settled into a cruising altitude set before launch to either 100, 150, 200, 250, or 300 meters. A failure prone barometer was used to measure altitude, so the lower altitudes were not used often. Cruising speed is high subsonic using a liquid-propellant rocket with 10 tons of thrust. Range is about 40km although there is usually fuel left on impact. Finally, the terminal radar kicks on at about 11 km from the target, and the missile, once it finds a lock, starts descending in a direct line to the target. These are decent sized missiles and easy to find on radar, especially modern ones.
The P-15U was an upgrade with a better guidance system and folding wings allowing it to be carried in the cylindrical tubes used by the Osa II (project 205U). Range is still 40km.
The later Osa IIs (project 205mod) had longer tubes allowing them to carry the P-15M (Styx C), which was an upgrade with more fuel, additional length to carry the fuel, and an increased range to 80km. In addition, and probably more importantly, it replaced the barometer with a radar altimeter, allowing it to cruise at 25, 50, or 250 meters set before launch. The radar might also kick on significantly earlier (at 40km) and terminal guidance might work differently ( locked at 6 meters), but I couldn't get confirmation beyond what looked like anecdotes.
To align with these, I reworked the styx with the parameters for the base P-15. I created a second missile - the styx C, for the Osa II. They use the same model, (I copied it and renamed it, not sure if that was necessary) Not necessary so I removed it. I set the cruise altitude for the styx at 200 meters and the cruise altitude of the styx C at 50 meters. The only other difference is the 40km vs. 80km range. I thought this would give useful variation between the Osa 1 and Osa 2.
I reworked a lot of the variables based on the research I did and what ED coded for the HY-2 silkworm, which is a Chinese variant of the P-15. Since the HY-2 uses a different scheme than the styx and uses different variables for some things, I also used deka's coding for the YJ-62, which uses the same anti_ship_missile_tb scheme and same variables as this mod, as a guide.
I added notes to everything I updated with a rough source and a note as to why or if any calculations were involved. Please feel free to ask me any question or challenge any of them that may be wrong.
I'm pretty happy with the results, however there are a few issues I could not resolve -
1) The missile visually appears to fly with a high AoA. That's baked into the model itself though, it's not level along the Y axis, the front is significantly higher than the rear so I can't fix that by tweaking the lua. It's got to be done in the model. Not a huge deal though.
2) I could not figure out how to get a visual fire cone or smoke off the cruise motor.
3) The missile doesn't pop up as high as it should on launch before settling in the cruise altitude, because of this it goes briefly supersonic for the first few seconds. This is really minor.
My hunch is that that these last two have something to do with the use of anti_ship_missile_tb missile scheme. I wonder if we could use the anti_ship_missile_se scheme that the HY-2 uses if it would fix both of those, but I briefly tried and couldn't get it to work at all. that being said, both are minor issues.
4) It can be a little jittery on the terminal approach, not sure if there's a way to smooth that.
5) technically the styx c should be more accurate than the styx. They both seem pretty accurate, so i wonder if the correct approach would be to turn down the accuracy of the base styx somehow.
That's it for now. I didn't mean to write that much. Will send you a link to the files shortly. I also had to edit the Osa II lua to link it the styx c.