Jump to content

[1.3] Procedural Wings


Crzyrndm

Recommended Posts

 

Procedural Dynamics - Procedural Wing (Download)

Spoiler

pWingsPromo.png

A continuation of DYJ's Procedural Wings. At this stage, Taniwha, myself (and probably NathanKell if he ever has time) will be jointly maintaining the mod as per discussion here

Download - Source

Plugin is licensed as All Rights Reserved
Assets are Public Domain

Introduction
The procedural dynamics procedural wing (pWing for short) is a wing piece that the user can procedurally manipulate, the wing automatically generates colliders and set its .cfg parameters accordingly.

Instructions / key commands:
Once a wing-section is placed mouse movement + the following commands changes the shape of the wing.

  • Root scale : Mouseover + B
  • Tip scale : Mouseover + T
  • Tip position : Mouseover + G

Additional log information can be generated using : Mouseover + O

Autosnapping:
When a section is attached to another it snaps into place on its parent part to allow for "seamless" joints, this doesn't affect rotation so you can use WASDQE to angle stuff like normal.
Autosnapping can be disabled by holding down the right mousebutton as the part is attached.

Changelog:


0.10.0
- KSP 1.0 compatibility
- FAR v15.4+ compatibility
- Taniwha - Corrected transform for collider, NRE's fixed, FAR and KSP compatibility
- CrzyRndm - Overhauled manipulation logic, optimisations for aero calculations, KSP compatibility
- Kerbas_ad_astra - added bulkhead profiles
- Added .version file

 

Spoiler

0.1 - "Alpha" Release
0.2:
- (sort of)Added reflective FAR support
- Code refactoring by Taverius
- Unborked a bunch of stuff
- Further optimization
- Mirrored parts now automatically get updated
- Lift indicator should be correct.
0.3:
- Proper (afaik) FAR support
- Unborking of the attach override logic.
0.4:
-Added B9 aerospace wing, asset by Bac9.
0.5:
-Added adapter thing, updated references, might have fixed the CoL indicator some people were having with vanilla ksp.
0.6:
-Added 2 controlsurfaces and one 1 new wing part, Added WIP thickness scaling.
0.7:
-Fixed name conflict,Added allmoving controlsurface, changed to nonrelative thickness scaling, changing thickness now autoupdates. Might have fixed something else too that I don't remember.
0.8:
- Changed internal math from floats to doubles to keep up with Ferrams changes to FAR, didn't fix any of the bugs you expected me to. Also, added another wing type that's kind of WIP.
0.8.1:
-Added basic cost support, change it by adjusting "costDensity", default is 2000.
0.9:
-Taverius update! Added SP+ wing (thanks Porkjet) Fixed tons of bugs, added an option to revert to relative thickness scaling among other things also NEAR support, check bitbucket for a full changelog.
0.9.1:
-NathanKell update! Added compatibility with latest FAR
0.9.2:
-Added compatibility for KSP 0.90 (thanks to taniwha, MattHP85, ckfinite).
-Change R key to B (per abrr2000) since KSP 0.90 uses R in the editor already.
-Fixed some NREs for debris (thanks to taniwha).
0.9.3
-Fixed for NEAR.
-Resaved PNGs so the DDS converter can read them.

 

Known issues / Improvable areas

  • Elliptical wings don't have their own math yet, and as such they behave like trapezoidal ones.
  • The zero clamp intended to prevent you from inverting your wing doesn't really work and instead makes other möbius shapes.
  • There is a SP+ style wing but now control surface

How do I make my own?

Example files: https://dl.dropboxusercontent.com/u/70818657/pWing%20Example.zip

B9 Procedural Wings Thread  - (Download)

Spoiler

 

On 12/27/2014 at 11:16 AM, bac9 said:

6GRvQ5l.png

r5ws7xH.pngAXkQOlc.png

There are things about existing procedural wings, like texture stretching and lack of some options, that have long bothered me a bit. This mod employs different approach (direct vertex manipulation instead of controlling skinned mesh renderers) that is more verbose and inconvenient to set up, but allows proper UV mapping of arbitrary geometry. Multitude of parameters can be configured, from leading and trailing edge shapes to widths, lengths and thicknesses at root and tip of a wing. Wings can also be colored without any performance cost and drawcall inflation, using vertex color and UV2 to deliver data into the shader without breaking batching.

 


Features

4Md1LP0h.jpg

In addition to options outlined in this infographic, you have separate control over material properties of every surface.

An example is available on the color-coded tweakable screenshot below.

 


Notes

Some important information on the current state of the mod:

 

  • Wings with inbuilt control surfaces won't be supported, same thing can be built out of a wing segment with a slightly smaller root/tip width compared to neighbours, Flat trailing edge type on that wing, and a control surface attached to it.
  • You must FAR 15.3.1 or later. Previous versions had a serious issue preventing proper voxelization of mirrored meshes.

 

 


Latest patch notes

AR6Vgwuh.jpg

[table=width: 1200, align: left]

[tr]

[td]0.16

 

  • Wings support thickness of up to one meter from now on
  • Removed leading and trailing edge multiplier property from wings
  • Added leading edge root/tip width and trailing edge root/tip width properties, all four of them can be adjusted from zero to one meter, allowing you to set up vertically elongated edge cross sections, horizontally elongated edge cross sections and cross sections proportional to arbitrary wing thickness values alike.
  • Added collapsable categories parenting logical property groups (dimensions, materials, edges and so on) to the tweakable menu, making the selection and adjustment of numerous properties more manageable
  • All tweakable properties are no longer initially open in the context menu, being hidden under categories
  • Replaced all edge models with new ones, improving cross section polycounts and adding hard material edge that looks better under arbitrary thickness and edge width combinations resulting in stretching
  • Reordered edge models: first type is circular, second type is biconvex (between sharp and circular in shape), third one is triangular, which makes a bit more sense (progression from smooth to sharp shapes instead of random order)
  • Reordered and renamed some properties for convenience
  • Added flat fill support (fifth material type) to edges
  • Improved aerodynamic value calculation for wings, edges now properly contribute to the behaviour
  • Improved aerodynamic value calculation for control surfaces, trailing edge widths are now taken into account, along with contributions of offset properties to taper ratio
  • Internal fixes and refactoring in geometry handling, setup sequence and field updates
  • Top and bottom surfaces of control surfaces and wings are collapsed into one mesh with a slight benefit to performance (separate material selection still available, shader based switching makes use of one mesh a non-issue)
  • Slight improvements to text in alternative UI

[/td]

[td]0.17

 

  • Implemented coloration - every wing surface (top/bottom/leading/trailing) can now have not just previously implemented separate material type, but also an appropriately masked paint overlay with configurable opacity, hue, saturation and brightness
  • Reimplemented alternative UI, it now closely resembles tweakable menu with a number of improvements over stock (color coded groups, longer labels, hints, collapsable sections)
  • Moved all sliders in the stock tweakable menu to KSP API Extensions UI_FloatEdit editor, which seems to positively affect the rate of a memory leak on tweakable window redraw (sometimes it even stops entirely).
  • Unified all properties, control surfaces and wings no longer use isolated fields (breaking change, all previously built crafts will not retain wing part configurations)
  • Added an option to set current configuration of a wing or control surface as default, making all subsequently created parts of that type use the same values (along with an option to reset default values back)
  • Shifted all properties into logical groups
  • Implemented collapsable menus to make editing more convenient
  • Geometry and performance fixes, refactoring and minor fixes in other areas
  • Improved some layer textures, surface type 0 in particular (rivets, more appropriate seam structure and so on)

[/td]

[td]0.18

 

  • Fixed geometry counterparts not updating properties
  • Minor UI fixes

 

0.19

 

  • Leading and trailing edge width is no longer taken into account when type 1 (flat) edge is selected
  • Control surface main body width lower limit is now set to 0.125 (I'll look into making it lower in the future, but at the moment I have to snap it to the increment and it can't go to 0 without breaking geometry)

 

0.20

 

  • The alternative UI height no longer shifts height during slider editing, tooltip label height is now locked, tooltip text adjusted to always take two lines
  • The description of the last edited property is always correct now, jumps to improper descriptions eliminated
  • Editing mode button changed to J to prevent conflict with Editor Extensions hotkeys
  • It is now possible to force the part you are editing to match the shape (parent tip width becomes child root width, parent tip thickness becomes child root thickness and so on)
  • It is now possible to force the part you are editing to match the surface material settings of a parent
  • Control surface offset settings can now assume a wider range of values, allowing proper setup of control surfaces on high-sweep trailing edges

[/td]

[td]0.21

 

  • Implemented fuel switching based on code by Andreas Aakvik Gogstad (Snjo): You can use the button in both tweakable and alternative menu to scroll through four possible internal configurations of a wing: empty structure (STR), liquid fuel (LF), liquid fuel with oxidized (LFO) and monopropellant (RCS). As you alter the shape of a wing and change it's internal volume, amount of fuel within the wing is altered accordingly.
  • Fixed some style and formatting issues of the alternative menu
  • Fixed incorrect trailing edge width limits on control surfaces
  • Added opt-in update notifications supported by MiniAVC

 

0.22

 

  • Control surface edge width limits no longer reset to 0-0 instead of correct 0.24-1 (rogue Vector2 was used instead of Vector4 at a certain point, losing those limits due to absence of .z and .w values)


0.23

 

  • RealFuels support added, wings switch from inbuilt fuel switching code to RealFuel tweakables automatically upon detecting it installed
  • Fixed the alternative UI getting stuck in the timeout mode upon after you exit and reenter the editor scene
  • Added a button to the KSP editor appbar allowing you to close the alternative UI window and reopen it without mouseover+J (the button appears and disappears automatically whenever a procedural part is present in a scene)
  • Added a configuration menu to the KSC scene, accessible through the appbar button. It allows you to enable one of 12 logging modes (all disabled by default) and might come in handy later when I might ask some of you to reproduce an issue with a certain logging mode enabled, sending me the resulting log
  • Fixed fuel per volume multiplier - previously you were able to use the total internal volume of a wing for fuel, which is fixed now, with only reasonably realistic 70% of it available
  • Various minor fixes and optimizations

 

 

...

0.40

 

  • Includes all changes from the maintenance fork by Crzyrndm (lots of bugfixes and improvements to the code)
  • Full compatibility with KSP 1.0.2
  • Full compatibility with FAR 0.15.3+
  • Aerodynamics calculations no longer restart on every slider change, editor performance is improved
  • New stock-alike texture (old texture is available optionally)
  • Textures converted to .dds
  • Improved shader and material settings

[/td]

[/tr]

[/table]

 

mJFRx2Cl.jpg

 


Incompatible mods

This is just assumptions, but odds are pretty good:

 

  • KerbPaint
  • Reflection Plugin
  • Kronal Vessel Viewer
  • Every other mod that attempts to swap part shaders (wings are reliant on their own custom shader and will break if it's removed)

 

 


Credit

I referenced how attachment/detachment is handled in pWings by DYJ and I have used the same aerodynamic stats calculation methods (if I'm not mistaken, those were set up by Taverius and ferram4).

Wing geometry itself is not handled in the same way (I'm not using skinned mesh renderers or same parameters) and no part content is shared with Procedural Dynamics, so this is not exactly a proper derivative work, I guess.

Credit where it's due, I'm sure I would've stepped into ten times more mistakes if I had not studied the source. Thanks to DYJ, NathanKell and Taverius for their work.

Also, thanks to ferram4 for advice on FAR support and to helpful folks from #kspmodders IRC channel who answered some of my horrifyingly incompetent questions about C#.

Special thanks to xEvilReeperx for helping me out with figuring custom shader loading.

Fuel switching is based on code from Andreas Aakvik Gogstad (Snjo).

Maintenance in the few last months, changes required for KSP 1.0.x and FAR 0.15.x compatibility and enormous number of fixes and improvements to the code were performed by Crzyrndm.

More images

DcFHaULm.jpg26VHuyZm.jpg

TKkjfBEm.pnglYcSIjJm.png

License

 

  • The code is licensed under MIT.
  • All art (i.e. textures and meshes included into the download) is licensed under CC BY-NC-SA 4.0
  • KSP API Extensions by swamp_ig and taniwha are included into the download without modifications and under conditions of CC BY-SA 3.0
  • CrossFeedEnabler by NathanKell is included into the download withough modifications and under conditions of CC BY-SA 3.0

 

 


KSP-AVC Notice

This mod includes version checking using MiniAVC. If you opt-in, it will use the internet to check whether there is a new version available.

Data is only read from the internet and no personal information is sent. For a more comprehensive version checking experience, please download the KSP-AVC Plugin.

 

 

Edited by Crzyrndm
Link to comment
Share on other sites

Version 0.10.0 for KSP 1.0.4

  • KSP 1.0 compatibility
  • FAR v15.4+ compatibility
  • Taniwha - Corrected transform for collider, NRE fixes, FAR and KSP compatibility
  • CrzyRndm - Overhauled manipulation logic, optimisations for aero calculations, KSP compatibility
  • Kerbas_ad_astra - added bulkhead profiles

Wing manipulation is now part relative!

If you want to swing the wing forwards, you move the mouse in the direction the wing is facing. If you want to move it faster, zoom out. (thickness is towards the top of the part, width is towards the rear of the part)

Wing manipulation doesn't require the mouse to remain inside the bounds of the part!

No more tap-drag-tap-drag-tap-drag to get to the length you need, the wing will continue to change shape even if your cursor is no longer hovering over it for some reason.

Wing Manipulation wont turn the editor into a slideshow

KSP v1.0 Aero for both FAR and stock require complex (and therefore time consuming) calculations to determine part shape. To ensure a smooth framerate, these calculations are delayed until after wing manipulation is no longer occuring

I could kiss you with my Kerbal lips.

Send it taniwha's way :P

Edited by Crzyrndm
Link to comment
Share on other sites

I never got to playing with this. How does it differ from B9's wings,are they compatible? Are these parts techtree integrated?:)

Good to see it's alive and kicking again!

B9 wings include a GUI, appearance customization, can hold fuels, and allow separate edge shaping.

Original Pwings (these) can not be precisely edited to a size (no GUI / numeric interface), but are not dimensionally limited.

B9 wings were at the very least inspired by this codebase so there are a lot of similarities (a good portion of my changes that weren't to do with the wing manipulation were directly ported from my work with the B9 wings, and I have ported the revamped manipulation from these wings into the dev version of the B9 wings with minimal changes).

There is no incompatibility, although getting them to match up can be somewhat tedious.

EDIT

The 0.90 version was endlessly tedious to shape so B9's wings were a huge advance in that regard. I would say the new system puts them about on par for ease of use (but then I am slightly biased...)

Edited by Crzyrndm
Link to comment
Share on other sites

This mod has been a must-have for me since I first discovered it last year sometime. I have been jonesing for it... and I cannot express how much I appreciate your picking up this mod. Crzyrndm, Taniwha, I thank you both very much!

Link to comment
Share on other sites

well for us Non Far users. Theres no way to manage Pitch, Yaw or Roll; as there is no option to enable or disable it. With Far I'm sure it works just fine but Sans far... it's No joy.

I managed to get it working however! All I had to do was get rid of the MM Far patch in the bootom of the .cfg of the control surfaces.

Edited by Hellbrand
Link to comment
Share on other sites

well for us Non Far users. Theres no way to manage Pitch, Yaw or Roll; as there is no option to enable or disable it. With Far I'm sure it works just fine but Sans far... it's No joy.

I managed to get it working however! All I had to do was get rid of the MM Far patch in the bootom of the .cfg of the control surfaces.

I may try your method, but I clicked the option to get rid of the flaps and put stock flaps in their place. Looks wonky, but they function fine.

What I can tell you is that Procedural wings look damn smexy on my Bomber. Love that stainless look! :)

screenshot40_2.png

Edited by GDJ
Link to comment
Share on other sites

I managed to get it working however! All I had to do was get rid of the MM Far patch in the bootom of the .cfg of the control surfaces.

Delete the "FerramAerospaceResearch" folder from your GameData directory so MM doesn't trigger FAR patches...

Link to comment
Share on other sites

I'm guessing you had it installed at some point through CKAN (it's not the first time I've seen this issue...). If you didn't go in and manually remove all traces of FAR, CKAN will leave a FAR folder with a couple of settings in it. Module Manager will see the FAR folder and think FAR is present and so apply the FAR patches. Remove the folder and things work as expected.

The only other possible reason is that somewhere in your GameData, a patch has been labelled :FOR[FerramAerospaceResearch] (which no one except ferram4 should be doing). If you don't have a FerramAerospaceResearch folder, search your log for that :FOR statement to locate the offending patch.

Edited by Crzyrndm
Link to comment
Share on other sites

Please have Porkjet Style Wing as that is the games style now and the current style does not really appeal to me and probably to others.

With me it's the other way around: I really dislike the black borders on the Porkjet wings. The big bomber with the shiny wings ... that's how I like it!

Idea: Can anyone please make a transparent texture for these wings? I'll remove the lift factor. Then at last we can build real cockpits with windows!

Edited by Azimech
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...