Jump to content

Permanently attaching one part to another


AmpCat

Recommended Posts

I was looking at the REKT mod, and thought that these things really should come with some basic solar panels. Is there a way to take an existing part, say the stock small solar panel, and inside the part definition of one of the escape pods, stick this other part on the side? Without going in, making new models, adding new textures and all that stuff. The part I want is already done.

Sure, I could add them on, to the escape pod, but KSP has a big problem with more parts exponentially affecting performance, and there's not much that can be done to help, aside from reduce part count. Since ships getting up to a couple hundred parts start slowing things down a lot, and aren't uncommon (especially for something needing escape pods), I figured any way to minimize part count would be best. Going from 6 parts per pod to 3 can make a difference if you have 10 pods.

Anyway, mostly curious on whether or not this is even possible without changing asset models and just editing cfg files.

Link to comment
Share on other sites

On 5/26/2019 at 7:06 PM, zer0Kerbal said:

UBIO welder - some caveats.

 

but yes, you could just go Jeb*SMASH* to the part.cfg and make it work. hard part would be making the b part show up (model) where you want.

You have an example syntax in the part.cfg to add one part into another? For example, take a solar panel, with all it's features, textures and modules, and in the part.cfg attach it to a.. crew part or something. I know i'll have to figure out position, rotation, and maybe even scaling manually.

Link to comment
Share on other sites

5 hours ago, AmpCat said:

You have an example syntax in the part.cfg to add one part into another? For example, take a solar panel, with all it's features, textures and modules, and in the part.cfg attach it to a.. crew part or something. I know i'll have to figure out position, rotation, and maybe even scaling manually.

no example - but start with the core part.cfg - rename the file (and the part) - the core items should be simple (name, description, mass, cost, etc) - the copy into it the model parts (look at the parts here for an example maybe). The cport (and the solar) were either welded or manually added.

copy: model/texture - adjust placement, scale, orientation

  add in cost, mass, tech tree - adjust for brittleness etc.

add in modules/resources from parts being welded in. Animations are tricky - unless they are uniquely named - can usually only have one.

be methodical. add one thing at a time and adjust. once you get the base you can always try to use MM patches to attempt to add/adjust.

good luck. Bob is behind you all the way!

can also check out some parts I have welded in the past (WIP)

lots of trial and error is to be expected. KISS at first.

the station 'node' was tricky because of the switching involved (had to strip it out)

SGEx-KSS-DockingNode-mk2.1.png

the below is only 4 or five parts. each welded and then hand adjusted. probably not very game balanced. stick 3-4 of these on a station ...

SGEx-KSS-Arm-mk2.1.png

Link to comment
Share on other sites

Okay, now I see what you mean. Looks pretty straightforward. Though I'll need to look up solar panels to see how the EC generation portion, with it's sun orientation works. Hopefully it's just as easy.

The real question is: My main effort with this is to try and glue parts together that I'll use many times in a craft to try and reduce the part count, and thus, the physics simulation burden. In theory, this should help the game performance if it can cut say, 20% of my parts down. Think it's that simple? I've got a pretty fancy computer, but it's still bogged down pretty fast with high part counts.

Link to comment
Share on other sites

23 minutes ago, AmpCat said:

Okay, now I see what you mean. Looks pretty straightforward. Though I'll need to look up solar panels to see how the EC generation portion, with it's sun orientation works. Hopefully it's just as easy.

The real question is: My main effort with this is to try and glue parts together that I'll use many times in a craft to try and reduce the part count, and thus, the physics simulation burden. In theory, this should help the game performance if it can cut say, 20% of my parts down. Think it's that simple? I've got a pretty fancy computer, but it's still bogged down pretty fast with high part counts.

Essentially reducing part count and therefor system load was, in my opinion, why welding was done originally. I've seen some comments (probably in the Ubio welding thread) about how 1.7 (or 1.6 or 1.5) changed things so .... but yes, reducing part count and similar very handy in my opinion. Those 'docking nodes' reduced part count from 5 to 1 part, and included fuel. Those station arms - went from 50-100 parts each to 5, and using the Konstruction welding ports cut one more (two) from the total.

so 4 station arms, from almost 400 parts, down to 20? with deployable antenna, solar, radiators, lights, and filled with resources and looking :cool: from the NFC and other mods parts? I noticed the improvement in system performance.

the solar panels are real simple. sometimes the order of modules in a part can get finicky.

 

great explanation of steps by @Lisias below:

11 hours ago, Lisias said:

Yes. Essentially, a 'welded" part is a new synthetic part, living in a new CFG file. How the part is built is somewhat out of scope to this problem, but essentially we "join" the meshes and textures, recalculate mass, CoM, CoL, etc, and create a new part that ideally woud behave as the parts "welded" were when separated.

 

Edited by zer0Kerbal
Link to comment
Share on other sites

Hm. Are there any mods that simply weld your parts all together, then? I for one don't care about the flexible joint dynamics at all. If getting rid of it would increase performance, I'd love to do that.

Link to comment
Share on other sites

3 minutes ago, AmpCat said:

Hm. Are there any mods that simply weld your parts all together, then? I for one don't care about the flexible joint dynamics at all. If getting rid of it would increase performance, I'd love to do that.

https://github.com/net-lisias-ksp/UbioWeldContinuum/releases

One caveat - doesn't work on 1.7/1.6 -- only on 1.4.5 and earlier (right now - @Lisias is working on updating)

 

 

Link to comment
Share on other sites

35 minutes ago, zer0Kerbal said:

One caveat - doesn't work on 1.7/1.6 -- only on 1.4.5 and earlier (right now - @Lisias is working on updating

That caveat is no more! :)

I tried it on 1.7 and it worked fine. Even parts with ModulePartVariant welded fine, but they behave weirdly. Fixing it will be a bit less worksome than expected.

The caveat is the need to use ModuleManager 3, as the latest changed on a thing that was fatal to Ubiowelding. Problem is that the alternative to that changed feature is prone to a Unity's Mono bug, and I'm trying to avoid using that. So until I cook something, you need to use MM3 or a hacked MM4 fork.

Remember to install all the dependencies.

Link to comment
Share on other sites

5 minutes ago, Lisias said:

That caveat is no more! :)

I tried it on 1.7 and it worked fine. Even parts with ModulePartVariant welded fine, but they behave weirdly. Fixing it will be a bit less worksome than expected.

The caveat is the need to use ModuleManager 3, as the latest changed on a thing that was fatal to Ubiowelding. Problem is that the alternative to that changed feature is prone to a Unity's Mono bug, and I'm trying to avoid using that. So until I cook something, you need to use MM3 or a hacked MM4 fork.

Remember to install all the dependencies.

 

thank you.
 

concerning part variants - maybe just include the current showing one? some of the welds I did with SSPX gave me headaches with such. Also been following discussion concerning MM4 - sounds like there is headway being made.

Link to comment
Share on other sites

2 minutes ago, zer0Kerbal said:

concerning part variants - maybe just include the current showing one? some of the welds I did with SSPX gave me headaches with such.

It's exactly what I have in mind. :)

 

2 minutes ago, zer0Kerbal said:

 Also been following discussion concerning MM4 - sounds like there is headway being made.

i had no time for the Forum this week, so I completely loose track on that. In a way or another, as soon as the thing is tackled down, I will updated Ubiowelding. 

 

5 minutes ago, AmpCat said:

Any benchmarks or such on performance improvements using this?

Your mileage will vary. It will depend hugely of the craft and parts welded.

Small crafts doesn't worth it. You start to see gains welding crafts with about 100 parts, 50 on potato machines.

Link to comment
Share on other sites

My last ship to Duna had 500 parts. :/ Mostly because I'm using life support mods that make me bring the kitchen sink (literally) for long duration missions. Brought my computer down to like, 3fps. If I could get it to 100 parts, I'd be happy.

Still, seems like this sort of thing should be a baked in feature. A performance checkbox that says 'Enable joint physics'. Click on and off. In fact, if it were implemented in the core game it'd probably much more straight forward than glueing parts together. Could just disable physics calculations between parts. It's probably a simple if() statement. :p

Well, probably not, but I can dream.

Edited by AmpCat
Link to comment
Share on other sites

21 hours ago, AmpCat said:

Still, seems like this sort of thing should be a baked in feature. A performance checkbox that says 'Enable joint physics'. Click on and off. In fact, if it were implemented in the core game it'd probably much more straight forward than glueing parts together.

Then you would need another 3D Engine. Without some kind of "welding", there's no way to get rid of 'joints". Is how Unity keeps things together.

 

19 hours ago, AmpCat said:

Is the autostrut feature supposed to alleviate some of this physics calculation work in KSP now? Is that what the improvement was a few versions ago? Or something else?

Nope. It make it worse. The AutoStrut is a kind of "Kerbal Joint Reinforcement" that you set it up part by part. It adds more joints between the parts using different patterns than just "glue me to my parent".

Some people got unsatisfied with AutoStruts as Squad decided to get rid of some problems by automatically autostrutting gears to the Root Part, and I remember people complaining about how their rovers doesn't "bends" anymore on irregular terrain. :) Since all the gears are autostrutted to a single part, there're no bending anymore.

 

Link to comment
Share on other sites

Hm. I've not done tons of unity work, but I don't remember physics between models as a standard feature. But the last time I messed with unity was almost 10 years ago. Back when it wasn't free. I don't think it even supported physics back then.

What about the rigid attachment checkbox? I've heard Kerbal Joint Reinforcement slows things down, but the other joint reinforcement mod I tried Krakened some of my ships as soon as I put them on the launch pad. It does seem noticeably slower with KJR installed, though.

Edit: Hmm, though I suppose if you don't enable physics between two parts, when they're stuck together, they probably won't use physics to interact with another part (like another ship). You'd need the granularity to say 'Don't calculate physics between part 1 and 2, but do calculate between 1 and 3, and 2 and 3'.

Edited by AmpCat
Link to comment
Share on other sites

  • 2 weeks later...
On 5/30/2019 at 8:40 PM, AmpCat said:

Hm. I've not done tons of unity work, but I don't remember physics between models as a standard feature. But the last time I messed with unity was almost 10 years ago. Back when it wasn't free. I don't think it even supported physics back then.

Well, my only contact with Unity is through KSP, so I don't have a clear understanding about the frontier between both .

But mangling with KJR,  I think I remember that it deals directly with Unity's data structures. Well, it's some time since I did.

 

On 5/30/2019 at 8:40 PM, AmpCat said:

What about the rigid attachment checkbox? I've heard Kerbal Joint Reinforcement slows things down, but the other joint reinforcement mod I tried Krakened some of my ships as soon as I put them on the launch pad. It does seem noticeably slower with KJR installed, though.

The rigid makes things less flexible but way more brittle. It's surprisingly near how things works on RealLife. Think on glass and lead - glass is harder, and it's exactly by this reason it breaks a lot.

KJR 'classic' is essentially a Autostrut to grand parent with steroids - applied by brute force. :D it works, but taxes the CPU heavily.

Continued is the classic recompile with some fixes.

I got some good results using KJR/Next, but last time I tried it was for simple regression tests, before Serenity. So I can't say anything for now (keep in touch, I'll do a benchmark with all of them as soon as I find time)

Before Next was born, I was informally maintaining a personal fork that somehow got some attention. It is based on an ancient code tree that evolved to what's Next nowadays.

What do you think on giving it a try? If it works for you, contact the Nest's maintainer and tell about it. He wrote both codes, so he will be able to diagnose this!

 

On 5/30/2019 at 8:40 PM, AmpCat said:

.Edit: Hmm, though I suppose if you don't enable physics between two parts, when they're stuck together, they probably won't use physics to interact with another part (like another ship). You'd need the granularity to say 'Don't calculate physics between part 1 and 2, but do calculate between 1 and 3, and 2 and 3'.

Yep, there're the physics less parts, but as I understand, they are just polígons being drawn orderly on the screen. Not sure how KSP would handle this.

But it's a good insight, I didn't knew about it!

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...