Jump to content

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


bac9

Recommended Posts

Thanks, those are interesting results.

And about craft loading, - yeah, it's supposed to reset RAM usage completely unless KSP does something wrong. Memory leak most likely occurs simply because some objects are created, forgotten about and created again, piling up in memory (for example, some geometry). As the craft loading is implemented as reloading of the SPH scene, those objects can't survive it - Unity garbage collection (search for all objects that are not referenced from anywhere) clears all objects like that on any scene change.

Link to comment
Share on other sites

This is just outstanding man. Literally the first procedural parts I actually want to use because they don't look like crap.

The main note I would like to make right now, after just a few minutes with them, is that they don't scale down to small sizes very well. I was trying to use them as control fins on a .3m rocket and it just wouldn't work.

The texture is not meant to be used on a small scale like that, and leading/trailing edges do not have scaling proportional to semispan and width, so at the moment those parts are unfit for small craft like that, yeah.

Well it almost works. Yeah the texture looks odd simply because of the relatively large size of the "blocks" but the UVs still hold up fine. And the overall scaling works, almost. Really if you could just allow all the settings to go a nothc smaller it would work. The biggest problem was the control surface. While I could make it roughly fit in with the winglet, the control surface was longer than I wanted, IE extending farther behind the trailing edge, towards the rear of the craft, than it should.

I guess my point is it ALMOST works, so maybe if you could just let it go a tad smaller...?

I also have to second the ability to control sizing from CONFIG{}. It is a very important thing for many of the big career mode mods and I would bet you can find some code to use directly for it.

Link to comment
Share on other sites

Additionally, I'd like to know whether memory leak persists into the flight scene. If there are no noticeable leaks with aforementioned craft with just one wing part, try flying a full-fledged craft like the sample fighter jet too.

Well it almost works. Yeah the texture looks odd simply because of the relatively large size of the "blocks" but the UVs still hold up fine. And the overall scaling works, almost. Really if you could just allow all the settings to go a nothc smaller it would work. The biggest problem was the control surface. While I could make it roughly fit in with the winglet, the control surface was longer than I wanted, IE extending farther behind the trailing edge, towards the rear of the craft, than it should.

I guess my point is it ALMOST works, so maybe if you could just let it go a tad smaller...?

I also have to second the ability to control sizing from CONFIG{}. It is a very important thing for many of the big career mode mods and I would bet you can find some code to use directly for it.

Yeah, I'm planning on making smaller sizes possible, but that will require some changes to cross section texture mapping for wings and some significant changes to allow variable trailing edges on control surfaces. As for gradual size unlocks, I'm investigating that too.

Could you add something similar to the standard canard or winglet? A standalone re-shape-able control surface that pivots at the center rather than have to make a small wing and trailing edge.

Planned, but not in the next version.

Link to comment
Share on other sites

Version 0.8

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

  • Changed control surface geometry to allow topside and underside borders to go all the way to the trailing edge, improving the looks and readability of control surfaces with gray surface types.
  • Added an additional wing edge type (round one)
  • Improved texturing on wing edge cross sections
  • Control surfaces can now have bigger widths

Other changes are internal and attempt to close the memory leak. I don't know whether they actually succeed at this, so I need detailed tests again.

Link to comment
Share on other sites

Gorgeous mode! Thx for this great present for the new year! ^_^

And I have an idea: why not to add texture switching to the wings butt ends if we have it almost on all surfaces anyway? This will helps to make a pleasant fins... :)

Edited by ZobrAA
Link to comment
Share on other sites

Okay, still hunting down the leak.

Aside from 0.9 testing, I'd like to know the results of testing this version of the library:

https://www.sendspace.com/file/rmsmgv

There is almost nothing to test it with, actually, because I have removed all code from it but tweakables and an update method checking changes to those tweakables. No working functionality there. So, if you'll find that the memory leak still occurs with this version, only two possibilities will remain - either my update method leaks something, or Squad tweakables invariably leak something into memory.

Aside from that, I'd like you to test tweakables on stock parts without adding any of my wings into the scene. Let's see if the leak originates in the tweakables themselves.

Edited by bac9
Link to comment
Share on other sites

My base install has ATM, MM, and Ven's Stock Revamp installed. I am using 0.9, tested with your .dll above and the .dll from 0.9. I tested the parts by placing a Mk1 cockpit and attaching a part without symmetry.

With just my base install:

- Placing Mk1 cockpit and opening tweakables menu results in increase of ~1MB/s with drops of a few MB every few seconds keeping it seemingly stable(?).

- Placing advanced canard on cockpit results in stable memory usage, opening the tweakables menu also results in stable memory usage.

Base install + Procedural parts (.dll from 0.9 and .dll above):

- Placing Mk1 cockpit and opening tweakables menu results in increase of ~2MB/s for ~5 seconds then stabilises.

- Placing procedural wing on Mk1 cockpit results in seemingly stable memory usage, opening right click menu on wing results in sudden increase of 10-20MB, stabilises afterwards.

- Placing advanced canard on cockpit results in stable memory usage, opening the tweakables menu also results in stable memory usage.

Base install + Procedural parts (.dll from 0.9 and .dll above) + FAR:

- Placing Mk1 cockpit and opening tweakables menu results in increase of ~2MB/s for ~5 seconds then stabilises.

- Placing procedural wing on Mk1 cockpit results in stable memory usage, opening right click menu on wing results in constant increase of ~3MB/s after sudden increase of 10-20MB. When the right click menu is closed it stabilises.

- Placing advanced canard on Mk1 cockpit results in stable memory usage, opening right click menu on wing results in constant increase of ~3MB/s after a few seconds delay. When the right click menu is closed it stabilises.

Base install + FAR:

- Placing Mk1 cockpit and opening tweakables menu results in increase of ~2MB/s for ~5 seconds then stabilises.

- Placing advanced canard on Mk1 cockpit gives stable memory usage, opening right click menu on wing results in constant increase of ~3MB/s. When the right click menu is closed it stabilises.

Link to comment
Share on other sites

The problem appears to come from the interaction between B9 Procedural Parts and FAR. I tested using a clean install with:

(1) B9 Proc Parts by itself, and

(2) B9 Proc Parts and FAR.

Both were tested using one MK2 fuel tank and one procedural wing. With just B9 there was a small memory hit when the GUI was opened and left open but it quickly stabilized. With B9 and FAR when the GUI was opened and left open, memory usage increased until the game crashed. If I launched the craft under either scenario the memory reset. I did not conduct any testing on the runway. However in my regular install I've never experienced a crash while flying a craft with B9 procedural wings. I've only experienced a crash when spending a long time building a plane in the editor before launching.

Out of curiosity, I also tested a clean install with just FAR. By continuously mashing buttons in the FAR GUI (Sweep AOA, Sweep Mach, Run Simulation, etc.), I was able to get memory usage to slowly increase with a MK2 fuel tank as the only part. I lacked the patience to see if I could ultimately cause a game crash because the increases were small and tedious to create.

My guess is that when the GUI is open with FAR installed the wing shape is in flux or not sufficiently transparent to FAR which results in a nonstop memory leak as FAR attempts to simulate the aerodynamics.

Edited by Tarheel1999
Link to comment
Share on other sites

bac9: #kspmodders mentioned that stock tweakables leak as well:

http://i.imgur.com/e8qPKXA.gif

https://i.4cdn.org/vg/1420196534801.webm

Also terrain is leaking: http://forum.kerbalspaceprogram.com/threads/105514-BUG-Memory-Leak-Flying-Near-Ground

Pretty safe to assume at this point it's a problem with the game, not your mod.

Link to comment
Share on other sites

I'm afraid the issue is not linked to FAR or this particular mod and simply scales with amount of stuff in the tweakable UI, which happens to be longer than in stock and therefore leaks more memory. I'm reproducing the issue with a stock fuel tank here, although at a slower rate (probably because the window contains only two sliders):

e8qPKXA.gif

K3|Chris, I know, I posted those images in the first place. :)

Edited by bac9
Link to comment
Share on other sites

While probably related I'm not sure the small leak in stock tweakables caused by GUI manipulation fully explains the continuous and more substantial memory usage that occurs with B9 Proc Parts and FAR with no GUI manipulation. I was able to crash the game in a relatively short amount of time by simply opening the GUI and leaving it open, i.e., no further manipulation, with only two parts (MK2 fuel tank and procedural wing) in the editor. I was unable to accomplish the same thing without FAR installed. Something else must be going on. Although I take your point that the problem may ultimately lie with code in the stock tweakables implementation and neither you nor Ferram can fix it.

Link to comment
Share on other sites

bac9: #kspmodders mentioned that stock tweakables leak as well:

http://i.imgur.com/e8qPKXA.gif

https://i.4cdn.org/vg/1420196534801.webm

Also terrain is leaking: http://forum.kerbalspaceprogram.com/threads/105514-BUG-Memory-Leak-Flying-Near-Ground

Pretty safe to assume at this point it's a problem with the game, not your mod.

Do those memory leaks also happen on 0.25, or is it 0.90 only?

Link to comment
Share on other sites

This is the B9 Proc Wings on a 0.3m sounding rocket I made tonight. Really it still looks miles better than pWings IMHO. The only thing I would really like to see is more fine control. Why are the slider steps so large? Again this comes in more at smaller sizes than larger. When i'm trying to reproduce a real rocket, being forced to .250 meter increments makes it tough.

WAC Corporal

Link to comment
Share on other sites

Did the test, I can now confirm the obvious.

[table=width: 500, align: left]

[tr]

[td]Action[/td]

[td]Memory usage[/td]

[/tr]

[tr]

[td]Empty SPH[/td]

[td]2 591 500 KB[/td]

[/tr]

[tr]

[td]Mk2 Inline Cockpit alone[/td]

[td]2 591 376 KB[/td]

[/tr]

[tr]

[td]Procedural wing dragged onto the editor[/td]

[td]2 591 752 KB[/td]

[/tr]

[tr]

[td]P Wing attached[/td]

[td]rose steadily (~ 2 MB/s) until I detached it at 2 605 024 KB. Did not leak when I reattached it.[/td]

[/tr]

[tr]

[td]Opened P Wing tweakables menu[/td]

[td]2 614 900 KB, started rising a few seconds later.[/td]

[/tr]

[tr]

[td]Detached at 2 700 092, tweakables menu closed[/td]

[td]rising, but significantly slower (~200 kB/s)[/td]

[/tr]

[tr]

[td]Reattached and reshaped[/td]

[td]rising at ~2.5 MB/s[/td]

[/tr]

[/table]

I didn't have to wait long until KSP ran out of memory on its own at 3 773 672 KB.

*edit*

A little bug report, control surfaces tend to stall with full deflection at subsonic speeds. It doesn't seem to occur above mach 1.

http://i.imgur.com/OvlngsD.jpg

http://i.imgur.com/pYQ69E7.jpg

http://i.imgur.com/FgU5tXT.jpg

It's just a minor bug, the stall never goes above 1%, but I thought it's best to report it.

Edited by Wampa842
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...