Jump to content

[1.3] Kerbal Joint Reinforcement v3.3.3 7/24/17


ferram4

Recommended Posts

@Zander: What's the mass of the flexing procedural interstage? Now what's the mass of the fuel tank below it? Large mass disparities between physics parts is almost impossible to deal with.

Well, there are two ways that I could try ending bending: the first is to try and disable physics on the individual parts or to try and merge them all into one large part. Problem is this breaks every physics-affecting part. The second is to use a joint that tries to hold the parts stationary relative to each other, called FixedJoint; the only problem is that's what the stock game uses.

I've been trying to fix the issues, but I really don't know where it's breaking. It's almost like something got changed in KSP 0.23 that broke it. But the only other issue I've been able to find is that most of the problem seem to occur when involving stretchy tanks (which encourage stupidly large mass disparities). I'm tempted to just declare the plugin not intended to deal with parts like that.

Edit: I'll add another bit of info: I have managed to effectively lock down rotation completely, but the problem is that it doesn't give the joints any "play" to deal with minor floating point issues. I've seen rockets spontaneously start dancing and twisting around as a result, before breaking horribly. So another solution is needed.

Edited by ferram4
Link to comment
Share on other sites

Alright, version 1.7 is out, with some fixes that should help stretchy tanks, minor adjustments to the default parameters, and the option (disabled by default) to scale stiffness with volume rather than area to deal with absurdly large vehicles.

Link to comment
Share on other sites

Alright, version 1.7 is out, with some fixes that should help stretchy tanks, minor adjustments to the default parameters, and the option (disabled by default) to scale stiffness with volume rather than area to deal with absurdly large vehicles.

By putting StretchyTanks in decoupler stiffening you are not making anything in any way realistic. What that does is cause any decoupler strut every part of the rocket to every other one, because there are often no non-extension parts in the main connection tree if the tanks are included. That is what causes the 'decoupling something causes the rocket go wobbly' issue. The rocket doesn't suddenly go all wobbly, it was actually just invisibly over-strutted initially.

P.S.: I'm not saying that it is relevant, but did you ever try looking into whether the inertia tensor of various parts is correct? I think when I looked a long time ago I found it doesn't appear to scale with changes in cfg part mass, and that doesn't seem right. Since I don't know much about physics models, I can't tell what would the consequences of mismatch be. There is also the thing with the hard cap on angular velocity and torque in the physx model that depends on this tensor.

Edited by a.g.
Link to comment
Share on other sites

I know, it's a completely bogus stopgap measure. The problem is that stretchies are currently the main problem spot with a lot of KJR. If the inertia tensor isn't being set properly, then that would explain why they're so wobbly. The "decoupling causes the rocket to go wobbly" was happening before I added stretchies back into the decoupler stiffening extension, and I've set things up so that the decoupler stiffening doesn't cause the entire rocket to go wobbly when things are decoupled.

I know that the cap on angular velocity + torque is there to minimize the physics model exploding, but there has to be a way to override it or something. That's where most of the wobble seems to come from. And if I can't, there's really not that much that can be done, since there's no way to deal with small parts.

Link to comment
Share on other sites

By putting StretchyTanks in decoupler stiffening you are not making anything in any way realistic. What that does is cause any decoupler strut every part of the rocket to every other one, because there are often no non-extension parts in the main connection tree if the tanks are included. That is what causes the 'decoupling something causes the rocket go wobbly' issue. The rocket doesn't suddenly go all wobbly, it was actually just invisibly over-strutted initially.

P.S.: I'm not saying that it is relevant, but did you ever try looking into whether the inertia tensor of various parts is correct? I think when I looked a long time ago I found it doesn't appear to scale with changes in cfg part mass, and that doesn't seem right. Since I don't know much about physics models, I can't tell what would the consequences of mismatch be. There is also the thing with the hard cap on angular velocity and torque in the physx model that depends on this tensor.

Making the rockets work realistically is impossible without a new physics engine. Ferram is just trying to simulate realistic behavior. and in real life rockets don't bend like spaghetti so whatever he can do behind the scenes to produce a realistic looking effect onscreen (no matter how unrealitic) is fine by me. I don't care if he simulates a magic bean stalk that goes up through the whole rocket. as long as it looks and moves realistically in game.

Link to comment
Share on other sites

Making the rockets work realistically is impossible without a new physics engine.

Actually, I tested it and fixing the inertia tensor appears to reduce bendiness a lot (details sent to Ferram). I didn't test anything other than this artificial rig however:

VXS8Oti.png

Link to comment
Share on other sites

I'll look into getting a.g.'s code into KJR in the morning, when I'm less likely to introduce a game-breaking bug through lazy testing. And then v1.8 will be out (or should it be 2.0? Hmm....).

@Galane: And you need to re-arrange your ribbons so it doesn't get cutoff.

Link to comment
Share on other sites

Yeah, the quick-fix I added is very good, but it's completely improper so I'd rather not use that if I can avoid it; the stretchy tank stiffening will be removed in the next version and replaced with a more proper solution. I've been playing around with a.g.'s fix and it seems to work quite well so far, but I want to make sure that I can get some good default values in the config before pushing it. It also feels a little too good to be true so far so I'm trying to break it as much as I can before putting it out there.

Link to comment
Share on other sites

Something that might work to break it is using the big adapter in the ReStock pack which mounts four Rockomax size and five small engines onto a ThunderMax size tank. Try that adapter on the bottom of a stretchy tank the same diameter.

I used one of those adapters on one of my early rockets and even with struts it'd wiggle around. Flew it with KJR 1.6 a couple of days ago and it was stuck in place nice and solid.

Hrmmmm, perhaps I could use that adapter now for the initial boost stage for going to Eve since it'll stay put and not shed engines during launch like it often would without KJR...

Link to comment
Share on other sites

Alright, I've made the v2.0x1 experimental available for people to play with, integrating a.g.'s inertia tensor fix. There may be some issues with it (hence why it's an experimental) but it does seem to help quite a bit. I suspect that it might need separate configs for Real Solar System (which needs some play between the joints to allow physics to not destroy everything) and stock KSP, where things can be tightened to the limit; if you're thinking that things are too loose, try going into the config.xml and reducing the angLimit and linLimit values to 0 and see if that causes any weirdness. Launch clamps should also be more rigid as well.

I also removed the previous stretchy tank quickfix, since it's completely improper and really shouldn't be there. Be aware that stretchy tanks encourage stupidly large mass ratios and that there's not much that I can do if you insist on attaching a 0.5 tonne tank to a 900 tonne tank.

Link to comment
Share on other sites

I also removed the previous stretchy tank quickfix, since it's completely improper and really shouldn't be there.

Does it mean you replaced it with the proper version ? Or that we're back to noodle mode when using stretchies ?

Link to comment
Share on other sites

The inertia tensor fix helps dealing with stretchies, but a lot of the issues with them are simply design issues caused by the player. There is a more proper fix, but it does wobble a bit more than the quickfix, although hopefully I'll be able to tighten things up for the full release. If you're insisting on making something out of lots of tanks when you don't need to for aesthetics, then it'll wobble a lot more, and there's really not much I can do about that. Ultimately, this is just a problem with stretchy tanks that cannot be solved: there is no way to stop a player from building a vehicle that breaks the physics simulation, since it gives you so much control over the mass of various parts. For reference, things start to get weird in physics simulations when two connected rigid bodies have a mass ratio greater than ~5:1. Stretchy tanks easily encourage mass ratios of 50:1, 100:1, or (in a case that I'm currently trying to stabilize) 550:1 between parts.

Basically, stretchy tanks will always be capable of being noodle-like if you try to make them act like noodles. I've always kind of had a love-hate relationship with them, and after dealing with this I can see why SQUAD doesn't want procedural parts.

Link to comment
Share on other sites

I see. They are so useful though, precise control over masses and fuel quantities, precise control over size of elements, all that with very few parts in the catalog.. I use them exclusively now for just everything.

things start to get weird in physics simulations when two connected rigid bodies have a mass ratio greater than ~5:1.

Good to keep in mind (i think that's something you might want to put on 1st post by the way).

So the solution to have a huge fuel capacity, is not to use one big 5mx60m tank, but to split it in small sections right ? The main problem i would see is whatever structural piece is connected to the tank (such as SAS wheels typically) will cause problems. Is it solved if i use progressively smaller sections in order not to exceed the 5:1 ratio ?

Link to comment
Share on other sites

The fix would be to place upper limits on the sizes procedural parts can be stretched to.

My first stretchy tank rocket had a single, central core tank of Rockomax diameter stretched to an absurd length. Then I ringed it with a lot of FL-T800 tanks, staging top down, using sepratrons on them all to kick away. Had something like 14~18 stages.

It performed... poorly. It would get off the pad but I don't recall if it ever made orbit.

Now I mainly use small stretchies as additional drop tanks for launchers that need just a bit of extra fuel so that what I want in orbit gets up there.

Link to comment
Share on other sites

@Surefoot: The best solution is to make sure that the stretchies are all the same mass, if possible; a bunch of 1:1 ratio joints with a few 8:1 joints at the end will hurt things a lot less than a bunch of 4:1 joints the whole way, since that will allow less flexing between each joint, but it will add up. If you can manage to build your stage out of one single stretchy, with engines at the bottom and a decoupler at the top it should be fine though, since the extra decoupler stiffening will be able to help there to remove a lot of the wobble. If you can't use a single stretchy, then you do the 1:1 ratio as much as you can.

Keep in mind that the 5:1 is my own rule-of-thumb, not a hard limit; noticeable effects happen with 2:1 if you know what to look for, and things can be managed up to ~20:1 if you are able to build enough extra joints between the parts with struts. Higher can be handled if you add joints to parts on either side of the problem joints, which is how the decoupler stiffening handles the 300 t tanks connected to 0.5 t decouplers in RSS; it connects that tank to the engine and fuel tank on the other side of the decoupler and the combination resists the forces.

Link to comment
Share on other sites

Two parts the game desperately needs are struts and fuel pipes with greater standoff height at the ends so they'll go over decouplers. The stock struts will do it some of the time but fuel pipes won't. I have to stick a small hardpoint to the decoupler and connect fuel pipes to and from that.

Link to comment
Share on other sites

Hm, I made a standard 4-part career starter rocket, and it started dancing on its engine, with lots of wobble in the engine-tank joint. This appears to be fixed by reverting angLim to 0 in the config file, although the joint still seems quite wobbly if you look closely at it while rolling with SAS.

The ground contact is obviosly a contributing factor here, but in general, I couldn't care less about supporting people who think a 500 ton tank is a good idea, if it makes things worse for small and medium sized rockets.

Edit: After some more testing I found that the level of wobbliness after the fix is similar to what happens with stock joints, so the only problem is that nonzero angLim quite literally makes the rocket start a never-ending dance on its engine.

Edited by a.g.
Link to comment
Share on other sites

Problem with the experimental version: When you first load up a craft on the launchpad, physics never kick in. Trying to wobble the craft or engage engine does nothing. Checked the debug log and KJR is stuck in a cycle as shown. However, going back to space center and back to launch pad fixes the problem. Unsure yet if hopping into an already active flight first thing suffers from this too. Also noticed a LOT of flexing between the engine and tank which I never remembered from the earlier versions.

A98DD449218960387E1CA3BBFF4C07A5B6F54017

Edited by Castun
Link to comment
Share on other sites

@a.g.: I think I might have to abandon the inertia tensor fix. I can't make it work with the stuff intended for Real Solar System, and this mod was originally intended to fix the wobbliness with those rockets, so it has to be able to handle 500+ tonne tanks. I've gotten things working a little bit better in my current dev version, but I want to be able to attach 2000 t boosters to a 3 t radial decoupler and have the connection hold together. Even if you think it's silly, that's my priority. Worst-case scenario, we have different configs for RSS and stock KSP.

@Castun: I need a copy of the output_log.txt; without that I have no idea where things are breaking. Especially since I've never had that issue myself.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...