e-dog Posted July 8, 2013 Share Posted July 8, 2013 (edited) Fairings that automatically reshape for any attached payload: Download from GitHub Frequently Asked Questions How to use (Imgur album, somewhat obsolete) Licensed under CC BY terms (attribution) Source code Notes: In career mode, minimum and maximum size is limited by tech. You won't be able to resize bases far from 1.25m at first, but as you unlock new aerodynamics and construction tech larger (and smaller) sizes become available. Unlike KW Rocketry fairing bases, Procedural Fairings' fairing bases intentionally lack a decoupler, allowing docking nodes, structural parts, multiple payloads, etc. The fairing bases can be so modded as to include a decoupler. Compatible with FAR and KSP 1.0 aerodynamics. Bug reports, suggestions and any other feedback is welcome! Future plans: Simple procedural decoupler with shroud for engines that lack built-in fairings and engine clusters. Procedural nose cone. Stock-alike fairing bases with non-part side panels. Side fairing part with switchable textures and shapes. More side fairing styles, matching KW Rocketry, AIES, NovaPunch, etc. More complicated texture mapping schemes for less texture stretching etc. Documentation and tutorial for creating side fairings. Particle effects on jettison. If you want to support me, here's my Patreon. Change log: Spoiler 3.20 Added the following changes by KortexM: - Ready for KSP 1.2 (recompiled, small changes to configs) - Added Interstage Nodes (no trusses) to Fairings and Interstage Fairing, two connections possible on each node (up & down) - A few code cleanups (foreach mostly) - Fixed Fuel Crossfeed (be aware that flow to/from interstage nodes is affected too!) - Fixed ghost nodes appearing when adding a new fairing base in the VAB/SPH - Fixed blue ghost lines (invalid fairing outline) when having multiple fairing bases in VAB/SPH - Fixed interstage nodes positions for Interstage Adapter when resized - Some UI fixes - Code cleanups (de-Linqed etc.) - All other bugs/features untouched (hopefully..) 3.17 Rebuilt for KSP 1.1.2. Fixed thermal issues with FAR (patch by NathanKell). Fixed procedural mass issues (patch by NathanKell). Fixed auto-strut joint issue (connecting to the same rigid body). Improved payload auto-strut performance (strut heaviest part only). 3.16 Updated for KSP 1.1.0. 3.15 Updated for KSP 1.0.4. Merged pull request for Procedural Parts bug fix. Adjusted thermal parameters for KSP 1.0.4 (hopefully). 3.14 Updated for the new FAR. Reduced fairing shape update rate in the editor to 2 times per second. Adjusted default fairing decoupler value to avoid "vessel changed" messages spammed by bugged KSP sliders. 3.13 Updated for KSP 1.0.2. Rewrote automatic payload struts, strutting all shielded parts now. Fixed bug when it was impossible to revert sometimes. Fixed slowdown in the editor when tweaking fairing sides. Fixed thrust plate mass parameters. 3.12 Updated for KSP 1.0. Procedural fairings now use new stock airstream shielding and drag cube rendering. Inline fairings now check if the top is closed by a single big part of the same vessel. Make sure that's the case or the shielding won't work. Changed and rearranged tech limits for the new tech tree. Converted textures to DDS. Fixed manual shape UI issues. Number of shielded parts is now displayed in the right-click menu for the fairing base. It might be inaccurate in the editor. Removed old deprecated parts (non-resizable fairing bases etc). 3.11 Updated for KSP 0.90. Added optional manual fairing shape controls. Fixed tech restrictions checking in science mode (patch by Zwa333). 3.10 Updated KAE DLL for KSP 0.25. Payload auto-struts by marce155. 3.09 Updated KAE DLL. 3.08 Updated KAE DLL for KSP 0.24.2. 3.07 Added procedural costs for PF parts, KSP 0.24.1 is required. Added workaround for Win64 decoupler bug. Made "removed" node markers much less visible (they are still somewhere 10km from the VAB). Updated KAE DLL. 3.06 Updated for KSP 0.24. 3.05 Fixed collider bug introduced in 3.04. 3.04 Added fake parts to make tech upgrades visible in the tech tree. Restored TechRequired for old parts to avoid issues with loading old designs in career mode. Fixed bug that allowed to cheat tech limits in career mode. Reduced default fairing ejection torque. 3.03 Added "sandbox" tech to specify minimum and maximum sizes in sandbox mode (see common.cfg). Changed mass formula for all parts except side fairings. Generally, larger sizes are significantly lighter now. Part mass is now displayed when you right-click the part in VAB. Rebuilding side fairing mesh only when really needed (faster in VAB, especially with FAR). 3.02 Updated KSPAPIExtensions, should work with Procedural Parts now. A bit less restrictive tech, allowing sizes a bit larger and smaller than stock ones. Trying to avoid moving attached parts after loading design or saved game. Fixed wrong size of newly added side nodes. 3.01 Updated KSPAPIExtensions. Added size step parameters for RSS. 3.00 Moved files up to GameData folder (no Keramzit folder anymore). Make sure to delete old mod before installing (which is a good practice anyway). Added new resizable fairing bases with configurable number of side nodes. Old parts (bases and adapter) are deprecated. Launched vessels should be fine, but you might have trouble loading old designs in VAB/SPH in career mode. Added new part: Thrust Plate Multi-Adapter. Using KSPAPIExtensions by Swamp-Ig for better tweakables. Removed old keyboard-based tweaks - use new tweakables. Tweaking outer diameter (with fairings), instead of inner radius. Added fairing decoupler torque tweakable. Side nodes (for attaching fairings) get larger with the base size to make them more sturdy in KSP 0.23.5+ Tech limits are not checked in sandbox mode anymore. Extra payload radius is now zero by default. Fixed interstage adapter decoupling with fuselage fairings. 2.4.4 Added tweakables. Rearranged tech tree, added 3.75m and 5m parts. Interstage adapter is available earlier now, but its radius is limited by aerodynamics tech. Launch clamps are ignored in payload scanning now. Payload scanning doesn't follow surface attachment to the parent part anymore. Improved interstage fairing shape when its top is inside payload. Added base cone angle limit to make fairings look better. Part descriptions and readme text copy edited by Duxwing. 2.4.3 Improved payload scanning for interstage adapter. Recompiled for KSP 0.23. 2.4.2 Zero-radius payload is now used when no payload attached, so fairings will always reshape. Added parts to the tech tree (except 3 and 5m parts). Moved fuselage shrouds to Structural tab. Changing adapter attachment node size with radius. 2.4.1 Disabled fuel crossfeed on the interstage adapter because it confuses Engineer Redux So added stock decoupler module to the interstage adapter's topmost node as to ease delta-v calculations. Improved fairing shape for interstage adapter when fairing top is within payload. 2.4 Added procedural interstage fairing adapter that has adjustable radii and height and decouples from the top part when fairings are ejected. Added conic fuselage. Fixed another inline fairing shape bug. 2.3 Changed fuselage texture to distinguish it from fairings. Fairing and fuselages' shapes can now be locked by mousing over the side fairing/fuselage and pressing L. Reduced side nodes size for smaller base rings and 0.625m fairing base (for easier placement). Inline fairings no longer make a top cone when they should instead make a cylinder 2.2 Added experimental egg-shaped fuselage (a side fairing without decoupler). Moved fairing decoupler code to separate PartModule. Auto-struts are now created between the top inline base and side fairings as well: wobbly payloads might still wobble. Fixed bug with misplaced fairings on new ring bases. 2.1 Added low-profile fairing bases (base rings) intended for inline fairings. All of them have 4 side fairing attachment points. Replaced base model with a lighter-looking one. It has the same size etc., and therefore won't break your existing ships. Fuel crossfeed for fairing bases can now be toggled by mousing over them and pressing G in editor or using the right-click menu in flight. Automatic strut creation between side fairings can be toggled by mousing over a base and press T. Fixed inline fairings' not connecting with the top base sometimes. Fixed nested inline fairings' not connecting to the proper base. Fairing outline (blue lines) is not displayed now for inline fairings if sides are attached to any of the two bases. 2.0 Inline truncated fairings are now created between two bases (one must be flipped). It won't work properly for off-center bases. If you want it off-center, tell me what for and how it should look. Ejection force can now be changed by mousing over a side fairing and pressing F Fixed rapid unplanned disassembly of side fairings when going out of time warp sometimes. 1.3 Fixed ejection direction bug - how you place fairings now should not matter. 1.2 So added invisible automatically-placed struts between side fairings as to prevent wobble. So replaced ejectionNoseDv with ejectionTorque that all ejected fairings identically move regardless of shape. Improved payload scanning for better fitting of mesh and box colliders. Radius can now be adjusted by mousing over a base while holding R (the default key can be changed in part .cfg). Fixed 'recursion' bug that caused misplaced fairings to uncontrollably grow. (It's also a foundation for future inline fairings). Using a (hopefully) better method to offset side fairing center of mass. Using proportionally smaller part of texture for 1/3 (and smaller angles) side fairings to reduce texture stretching. Renamed "capsule-shaped" fairings to "egg-shaped" to be more Kerbal. 1.1 Fix for future FAR compatibility (needs FAR version 0.9.5.2 or later to actually work). Less rotation on eject to reduce collisions with payload and lower stages. Conic side fairings added, original ones are made a bit more capsule-shaped. 1.0 Initial release. Funding provided by FlexGunship. Edited November 8, 2016 by e-dog updated to 3.20 Link to comment Share on other sites More sharing options...
ajwojo1210 Posted July 8, 2013 Share Posted July 8, 2013 (edited) Now if this works. It may just be the best mod ever. I'll be back after testing it.EDIT: Yes most definitely the best plugin/mod ever. Edited July 9, 2013 by ajwojo1210 After use Link to comment Share on other sites More sharing options...
softweir Posted July 8, 2013 Share Posted July 8, 2013 Very nice! I'm going to have fun trying that out. A suggestion: perhaps you could move the source .cs file out to the upper level of the .zip file so it doesn't get copied into user's installations? That would also make it more obvious, and avoid people thinking you were withholding the source.Thanks for this, it looks great! Link to comment Share on other sites More sharing options...
gardocki Posted July 8, 2013 Share Posted July 8, 2013 This is awesome, great work! I assume this works with Ferram Aerospace? Link to comment Share on other sites More sharing options...
stupid_chris Posted July 8, 2013 Share Posted July 8, 2013 Oh my god I love you. I really have no words. Link to comment Share on other sites More sharing options...
Mekan1k Posted July 8, 2013 Share Posted July 8, 2013 No-one will include fairings in their mods again after this! Link to comment Share on other sites More sharing options...
m4ti140 Posted July 8, 2013 Share Posted July 8, 2013 (edited) You have just made the last thing this game realy lacked. Procedural fairings + procedural wings + part generator + FAR = all mods needed to support development-from-scratchYou have just won the KSP Edited July 9, 2013 by m4ti140 Link to comment Share on other sites More sharing options...
e-dog Posted July 8, 2013 Author Share Posted July 8, 2013 I didn't test it with FAR, but I'd like to fix it to work with it, if there are any problems. Link to comment Share on other sites More sharing options...
Deadpangod3 Posted July 9, 2013 Share Posted July 9, 2013 oh my god, thank you sorry ksp, but your going to have to deal with one more mod...*hopes ksp doesnt crash* Link to comment Share on other sites More sharing options...
KhaosCorp Posted July 9, 2013 Share Posted July 9, 2013 These are brilliant. After a short test in game they seem to work flawless. There is no longer a need for fairings other than these. Awesome work, thank you! Link to comment Share on other sites More sharing options...
Moon Goddess Posted July 9, 2013 Share Posted July 9, 2013 Do these work with FAR?If so then this is what I finally need to actually use FAR Link to comment Share on other sites More sharing options...
e-dog Posted July 9, 2013 Author Share Posted July 9, 2013 A suggestion: perhaps you could move the source .cs file out to the upper level of the .zip file so it doesn't get copied into user's installations? That would also make it more obvious, and avoid people thinking you were withholding the source.I fixed that and updated SpacePort download. Link to comment Share on other sites More sharing options...
CaptainArbitrary Posted July 9, 2013 Share Posted July 9, 2013 Huhblahmalah. Muhmamaluh. Gah!Downloading. Right now. Link to comment Share on other sites More sharing options...
Fyrem Posted July 9, 2013 Share Posted July 9, 2013 now this, I have to try Link to comment Share on other sites More sharing options...
Pigbear Posted July 9, 2013 Share Posted July 9, 2013 (edited) Uhh, Where did the download go?Edit: Nevermind, The OP was not there for some reason. Don't mind KSP Forum derps! Edited July 9, 2013 by Pigbear OP gone? Link to comment Share on other sites More sharing options...
CaptainArbitrary Posted July 9, 2013 Share Posted July 9, 2013 I didn't test it with FAR, but I'd like to fix it to work with it, if there are any problems.A very quick-and-dirty test with FAR suggests that they don't work, and I'm not sure why. Here's the snippet of FAR source code that tries to identify fairings: else if (title.Contains("fairing") || title.Contains("payload") || title.Contains("shroud")) { if (!p.Modules.Contains("FARPayloadFairingModule")) { p.AddModule("FARPayloadFairingModule"); p.Modules["FARPayloadFairingModule"].OnStart(PartModule.StartState.Editor); FARAeroUtil.AddBasicDragModule(p); p.Modules["FARBasicDragModel"].OnStart(PartModule.StartState.Editor); returnValue = true; } }And here's the part of FARPayloadFairingModule that computes the geometry of fairings and shields the parts under them: private void CalculateFairingBounds() { foreach (Transform t in part.FindModelComponents<Transform>()) { MeshFilter mf = t.GetComponent<MeshFilter>(); if (mf == null) continue; Mesh m = mf.mesh; if (m == null) continue; foreach (Vector3 vertex in m.vertices) { Vector3 v = t.localToWorldMatrix.MultiplyPoint(vertex) - t.position; v = part.transform.worldToLocalMatrix.MultiplyVector(v); maxBounds.x = Mathf.Max(maxBounds.x, v.x); minBounds.x = Mathf.Min(minBounds.x, v.x); maxBounds.y = Mathf.Max(maxBounds.y, v.y); minBounds.y = Mathf.Min(minBounds.y, v.y); maxBounds.z = Mathf.Max(maxBounds.z, v.z); minBounds.z = Mathf.Min(minBounds.z, v.z); } } minBounds.x *= 1.05f; maxBounds.x *= 1.05f; minBounds.z *= 1.05f; maxBounds.z *= 1.05f; } private void FindShieldedParts() { foreach (Part p in FARShieldedParts) { FARBaseAerodynamics b = null; b = p.GetComponent<FARBaseAerodynamics>(); if (b == null) continue; b.isShielded = false; } FARShieldedParts.Clear(); foreach (Part p in VesselPartList) { if (FARShieldedParts.Contains(p) || p == null || p == part) continue; FARBaseAerodynamics b = null; b = p.GetComponent<FARBaseAerodynamics>(); if (b == null) continue; if (p.GetComponent<FARPayloadFairingModule>() != null) continue; Vector3 relPos = p.transform.position - this.part.transform.position; relPos = this.part.transform.worldToLocalMatrix.MultiplyVector(relPos); if (relPos.x < maxBounds.x && relPos.y < maxBounds.y && relPos.z < maxBounds.z && relPos.x > minBounds.x && relPos.y > minBounds.y && relPos.z > minBounds.z) { FARShieldedParts.Add(p); if ( { b.isShielded = true; //print("Shielded: " + p.partInfo.title); } foreach (Part q in p.symmetryCounterparts) { if (q == null) continue; FARShieldedParts.Add(q); b = q.GetComponent<FARBaseAerodynamics>(); if ( { b.isShielded = true; //print("Shielded: " + p.partInfo.title); } } } } partsShielded = FARShieldedParts.Count; } }} Exploring exactly why it isn't working is beyond what I'm up for tonight, I'm afraid, but maybe something there jumps out at you? Link to comment Share on other sites More sharing options...
NoMrBond Posted July 9, 2013 Share Posted July 9, 2013 Definitely need to try this, no more ugo tech nests on top of the rockets at launchWould inter-stage fairings (between a lower and upper fairing piece) for things like underslung rovers etc be possible? Link to comment Share on other sites More sharing options...
e-dog Posted July 9, 2013 Author Share Posted July 9, 2013 A very quick-and-dirty test with FAR suggests that they don't work, and I'm not sure why. Here's the snippet of FAR source code that tries to identify fairings:...If it adds FARPayloadFairingModule (which it should because title contains "fairing"), it might not work because it's computing bounds of side part which is only half (or third) of full fairings.I wonder if there are any other fairing mods that actually work with FAR? I'd like to look at what they do to make it work. Link to comment Share on other sites More sharing options...
e-dog Posted July 9, 2013 Author Share Posted July 9, 2013 Would inter-stage fairings (between a lower and upper fairing piece) for things like underslung rovers etc be possible?It won't work in this version, but it's an interesting idea.Could you make some picture of what you want it to be? Like a screenshot of some vessel and something to show where the fairings should be. Link to comment Share on other sites More sharing options...
NoMrBond Posted July 9, 2013 Share Posted July 9, 2013 It won't work in this version, but it's an interesting idea.Could you make some picture of what you want it to be? Like a screenshot of some vessel and something to show where the fairings should be.Was thinking about the SLA fairings around the LM on the Saturn-VI'll try and get some in-game shots for this Link to comment Share on other sites More sharing options...
mushroomman Posted July 9, 2013 Share Posted July 9, 2013 If it adds FARPayloadFairingModule (which it should because title contains "fairing"), it might not work because it's computing bounds of side part which is only half (or third) of full fairings.I wonder if there are any other fairing mods that actually work with FAR? I'd like to look at what they do to make it work.KW rocketry fairings, AIES fairings, and (I think) NP fairings all work with FAR.Too bad this doesn't work with FAR yet. I'd love to give it a try. But it's just not worth it yet. Link to comment Share on other sites More sharing options...
gardocki Posted July 9, 2013 Share Posted July 9, 2013 If it adds FARPayloadFairingModule (which it should because title contains "fairing"), it might not work because it's computing bounds of side part which is only half (or third) of full fairings.I wonder if there are any other fairing mods that actually work with FAR? I'd like to look at what they do to make it work.I believe KW rocket pack works with FAR, and their fairings are similar to yours (2 or 3 sections to make a full fairing). Link to comment Share on other sites More sharing options...
MOARdV Posted July 9, 2013 Share Posted July 9, 2013 Wow. I wanted to find a weird scenario to break these, but the ones I came up with didn't totally break. I applied the procedural fairing module to the NP 2.5m Plate, and I was able to add fairings that covered the upper part of a stage (like a bunch of parts on the top of a space station module). As long as I removed the _connect3 and _connect4 nodes (which overlapped with with 1 & 2 nodes), it works reasonably well. And, if I just do a "normal" design, it works very well. I'll have to keep playing with this one. Link to comment Share on other sites More sharing options...
e-dog Posted July 9, 2013 Author Share Posted July 9, 2013 Was thinking about the SLA fairings around the LM on the Saturn-VI'll try and get some in-game shots for thisI get the idea. It would need another part (a thin ring or something) to set the upper limit for the fairings. Link to comment Share on other sites More sharing options...
viperwolf Posted July 9, 2013 Share Posted July 9, 2013 this is a perfect fairing solution. great work Link to comment Share on other sites More sharing options...
Recommended Posts