bac9

[1.0.2] B9 Aerospace | Procedural Parts 0.40 | Updated 09.06.15

Recommended Posts

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 bac9

Share this post


Link to post
Share on other sites

Reserved for deletion by mods.

P.S. Thanks Bac9! I'll take a look at these as soon as I can this weekend :)

Edited by mrBlaQ

Share this post


Link to post
Share on other sites

Oh wow, this looks amazing.

So will this solve the issue of the wings disappearing when the root part of the wing falls out of camera shot? Also are we able to put black tiles on the wing undersides with the texture switching? E: ah, looks like it does.

Edited by falken

Share this post


Link to post
Share on other sites
So will this solve the issue of the wings disappearing when the root part of the wing falls out of camera shot?

Oh, pWings has that? This can actually be fixed without altering it's implementation, you just have to recalculate mesh bounds so that Unity knows when to disable the mesh as it leaves the camera frustum. Literally one-line fix.

Also are we able to put black tiles on the wing undersides with the texture switching? E: ah, looks like it does.

Yes, you can select top and bottom surface types separately, and mirroring works properly so you don't get black tiles on vertically opposite sides.

Share this post


Link to post
Share on other sites

Ohhh hell yes!

How's that DL link coming along? :P

Share this post


Link to post
Share on other sites

Fantastic. I cannot wait to test!

I don't suppose you could figure out slanted control surfaces (like evelon 5 in squad ssp) and also split control surfaces?

Share this post


Link to post
Share on other sites
I don't suppose you could figure out slanted control surfaces (like evelon 5 in squad ssp)

That's planned and possible, yeah.

and also split control surfaces?

That's outside of what I can control, there is no support for control surfaces like that in the game.

Share this post


Link to post
Share on other sites

Nice, a solution to a problem I didn't even know I had. keep up the amazing modeling and texturing work man, it's a shame you weren't involved with the t1 and t2 space centers.

Share this post


Link to post
Share on other sites

But... but where were we when we needed you? With the buildings?

But yeah, this is really great. If I ever decided to use B9 Aerospace again, I'll definitely use this.

Share this post


Link to post
Share on other sites

So does this mean that we will get procedural B9 fuel tanks and other parts? Oh that would be AWESOME!

Share this post


Link to post
Share on other sites

Looks pretty awesome, definetly gonna try this.

Share this post


Link to post
Share on other sites
*Searches vigorously for download link and wimpers*

*Dose the same*

Always been a big fan of the Aerospace pack...this will take it to a whole new level.

Just an idea can you make the landing gear adjustable?

Share this post


Link to post
Share on other sites
So does this mean that we will get procedural B9 fuel tanks and other parts? Oh that would be AWESOME!

Nope, this is a separate small-time mod, I do not plan parts like those at the moment.

Share this post


Link to post
Share on other sites

Posted the link to the repository.

https://bitbucket.org/bac9/b9_aerospace_plugins/downloads

I'm mostly interested in aerodynamic stats behaving properly in FAR and stock and in whether any actions spam null reference exceptions or other errors. If the latter happens, I'd like a verbose log and reproduction steps. Test whether crafts are saved correctly, loaded correctly, launched with all modifications preserved, etc.

Share this post


Link to post
Share on other sites

this is really good! i just wish it could also change thickness but otherwise perfect! now my aircrafts have wings that stays together instead of wabbling everywhere haha

edit: some times the wing resets after revert flight

POxZMPZ.png

Edited by K.Yeon

Share this post


Link to post
Share on other sites

Updated, download here as usual (I'd recommend to always download the latest snapshot of the repo and not my prepacked archives as their contents might be obsolete).

https://bitbucket.org/bac9/b9_aerospace_plugins/downloads

mREb9GJl.jpg

Changes:

  • Added separate tip/root offsets allowing setup of slanted control surfaces
  • Added separate tip/root control surface thickness and width controls
  • Improved texture coord calculations on control surfaces
  • Changed thickness handling to allow higher thickness limits
  • Added boundary area on control surfaces for improved readability, and some other stuff.

Edited by bac9

Share this post


Link to post
Share on other sites

Uploaded a version 0.3 with a fix for wings and control surfaces becoming corrupted on reattachment.

I also have to remind you that as far as I understand, only the latest development version from FAR git repository should be used with 0.90.

Edited by bac9

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now