Jump to content

[0.90WIP] Procedural Parts - Parts the way you want 'em 0.9.21, Dec 19


swamp_ig

Would you prefer decouplers to:  

118 members have voted

  1. 1. Would you prefer decouplers to:

    • Closely as possible follow stock behaviour
      15
    • Have a sensible relation between size, decoupler force, and mass
      153


Recommended Posts

Hey, swamp_ig, you said you thought that the SRB nozzles should vary in relation to thrust? Turns out they should! I have a bit of complicated math for you.

I guess all the constants in the formula can be neglected, since at the end of the day you have to have something that looks right - just tweak it until it looks equivalent to stock.

The proportionality is important of course.

So:

A* = k . m / t / Pa (m = Fuel Mass, t = burn time, Pa = atmosphere pressure, k = constant)

Substituting in A* = 1/4 * pi * d^2 (d= Tank Base diameter/2) and folding everything back into the proportionality constant:

d > k . sqrt( m/(t*Pa) )

What about the length and end of the bell of the nozzle? Does that just stay proportional to the throat diameter?

Link to comment
Share on other sites

But you dint answer my question, what is your main idea with this mod?

The goal is basically to improve on StretchySRBs, and to entertain my fancies with coding :) The future plans are pretty well documented. See the README.txt for details.

What about others procedural mods?

I wouldn't like to replace stuff that others already have and are working well. For example I wouldn't try to replace ProceduralFairings, cos that's already been done. Of course if Keramzit came to me and said lets integrate, I certainly wouldn't say no.

It will be possible to have one day one mod to remplace almost all parts with procedural parts, or the only chance would be had 20 mods that would cover most of the parts, and then delete all stock parts that we might remplace... Going in this direction is difficult to imagine a widespread use of procedural parts.

You could do that. However the custom made parts for a particular size will likely always be more detailed than a procedural part.

How you would manage the cost depending the dimentions that we choose?

We'd have to wait until costs are integrated into stock. I imagine there'd be some kind of formula - some polynomial with surface area and volume as terms. It's all a bit moot until stock KSP integrates costs anyhow.

Link to comment
Share on other sites

I guess all the constants in the formula can be neglected, since at the end of the day you have to have something that looks right - just tweak it until it looks equivalent to stock.

The proportionality is important of course.

So:

A* = k . m / t / Pa (m = Fuel Mass, t = burn time, Pa = atmosphere pressure, k = constant)

Substituting in A* = 1/4 * pi * d^2 (d= Tank Base diameter/2) and folding everything back into the proportionality constant:

d > k . sqrt( m/(t*Pa) )

Pressure should be included in the constant as well; it's also not atmospheric pressure, but instead the pressure inside the SRM's combustion chamber.

What about the length and end of the bell of the nozzle? Does that just stay proportional to the throat diameter?

The length should remain approximately proportional to the diameter of the nozzle exit; how large the exit diameter is compared to the throat varies with the design altitude of the nozzle (1 atm pressure, 0.7 atm pressure, 0 atm pressure, etc.) and the pressure in the combustion chamber. For starters, I'd just have the entire thing scale with the throat diameter and see how that works out.

Link to comment
Share on other sites

Using jsimmons real fuels patch, but all of my tanks are treated as non stretchable tanks with a constant volume of 8000 no matter what I do to the length/diameter/shape tweakables. Based on other posts in the thread, I cant tell if this is a known problem or if its just me. Any ideas?

Edited by OtherBarry
Link to comment
Share on other sites

@Camacha: Nozzles optimized for lower ambient pressures should have a longer, wider divergent section; it's the exit diameter that really matters (that's what accelerates the flow) and the length is only to prevent flow separation on the inside. A nozzle optimized for lower pressures will have (relatively) higher Isp at those pressures, but then will have (relatively) lower Isp at other pressures. Thrust actually increases with larger nozzles, assuming that the exhaust isn't at a much lower pressure than the ambient air. It's just that for most vacuum-optimized engines there's very little demand for high thrust due to being in orbit (or close enough) when they light it, so that complicated stuff is removed to keep the weight down.

Link to comment
Share on other sites

RealFuels:

As for real fuels instead of having real fuels be aware of ProceduralParts events we should do like StrechyTanks does which is call ChangeVolume().

if (part.Modules.Contains("ModuleFuelTanks"))

{

try

{

...

part.Modules["ModuleFuelTanks"].SendMessage("ChangeVolume", (newVolume));

..

}

catch (Exception e)

{

print("*PP* changing volume, caught: " + e.Message);

}

}

My testing shows RF is smart enough to change mass of the tank as you strechy it for you.

Decouplers:

The basic stack decoupler was easy. I still haven't figured out how to do a shourd. I'm thinking that the shourd works by using the proper node offset. Currently I'm looking at SAS and heatshields. Both are even easier than decouplers since thickness doesn't matter. All are still missing adjusting properties based on the size of the object. As for shapes of the decouplers we have the classic pancake. The others I have seen are square in shape for radial attachments. Looking for a picture of a real life one but can't find it.

Link to comment
Share on other sites

RealFuels:

As for real fuels instead of having real fuels be aware of ProceduralParts events we should do like StrechyTanks does which is call ChangeVolume().

if (part.Modules.Contains("ModuleFuelTanks"))

{

try

{

...

part.Modules["ModuleFuelTanks"].SendMessage("ChangeVolume", (newVolume));

..

}

catch (Exception e)

{

print("*PP* changing volume, caught: " + e.Message);

}

}

My testing shows RF is smart enough to change mass of the tank as you strechy it for you.

Ah. This is well outside my modding abilities, although I was going to suggest something like that. Also on the real fuels note, is the plan to stick with the current 2 tank system (Liquid Fuel and RCS) or something similar to stretchy tanks with Cryogenic/Balloon/Service module/etc? So far I'm using the default RF module for the liquid fuel tank and service module for the RCS tank, though I think I'll change it to cryogenic tank and then a hypergolic ballon tank/service module hybrid, as thats what I used most with stretchy tanks.

As for radial decouplers, there is a somewhat realistic one in the NovaPunch pack, can't remember the exact name of it, but its the long one. I doubt you will be able to find real life examples as most of them are built specifically for each rocket.

Edited by OtherBarry
Link to comment
Share on other sites

Pressure should be included in the constant as well; it's also not atmospheric pressure, but instead the pressure inside the SRM's combustion chamber.

So another constant that can be ignored. For SRBs since there's a constant burn rate, then there's a constant pressure. :)

This should also hold for liquid rockets one would expect, assuming you want max efficiency at max thrust.

I guess the upshot is it collapses to scale proportional to sqrt(thrust). Which does make a lot of sense physically since the area of both the throat, and the end of the bell (vent?) are proportional to the square of the scale, and you'd want a constant thrust per unit area to push against so to speak.

The length should remain approximately proportional to the diameter of the nozzle exit; how large the exit diameter is compared to the throat varies with the design altitude of the nozzle (1 atm pressure, 0.7 atm pressure, 0 atm pressure, etc.) and the pressure in the combustion chamber.

So ultimately, a nozzle designed for a constant fuel mix and best efficiency altitude will still scale only with sqrt(thrust).

Unless you got some better ideas, I'll code it up like this.

Link to comment
Share on other sites

As for real fuels instead of having real fuels be aware of ProceduralParts events we should do like StrechyTanks does which is call ChangeVolume().

Fixed.

I think I might have already known that... or something :P

TankContentSwitcher will also listen for the same message.

I still haven't figured out how to do a shourd. I'm thinking that the shourd works by using the proper node offset.

I know how to do a shroud. (for the SRB nozzle you mean?). Haven't done it at this stage however, since I don't see it as being hugely important since SRBs are most commonly used for launch, so there's no stack attachments behind them. There's a module for it that you can add in and you point it at some meshes for the part(s) of the shroud.

Link to comment
Share on other sites

Also on the real fuels note, is the plan to stick with the current 2 tank system (Liquid Fuel and RCS) or something similar to stretchy tanks with Cryogenic/Balloon/Service module/etc? So far I'm using the default RF module for the liquid fuel tank and service module for the RCS tank, though I think I'll change it to cryogenic tank and then a hypergolic ballon tank/service module hybrid, as thats what I used most with stretchy tanks.

I think having a dedicated set of configs for real fuels would be the way to go.

Link to comment
Share on other sites

I think having a dedicated set of configs for real fuels would be the way to go.

That would make sense. I do often forget that people play KSP without the whole realism suite.

If there is going to a separate RealFuels config, you may want to increase the efficiency and/or volume of the SRB's as, although i still need to properly test this, they seem really underpowered.

EDIT 1: After some testing with RealFuels installed, I changed the atmosphere SRB to an Isp of 260-280 and that gives about the same delta v as the stock RT-10, if I scale the SRB to the same dimensions as the RT-10, however with a much smaller amount of fuel. I will do more testing, but I do suggest increasing the volume or the Isp of the SRB at the moment.

EDIT 2: After a clean install, purely stock+procedural parts, A procedural SRB of the same size as an RT-10 will run out of fuel ~3 seconds earlier than, while a procedural SRB with the same fuel will cut off at the same point, but weighs 0.04t (very close, well done on that count) but is 0.725m (~27%) longer, which isn't that far off, but probably what triggered my underpowered reaction.

EDIT 3: The BACC edition. Firstly, three unrelated bugs I have discovered in my testing. A) With SAS on or off, and with gimbal on or off, a ship that is just Procedural SRB+Payload will wobble around, while a stock SRB+Payload rocket will stay perfectly straight SAS on or off. B) on occasion, if not using launch clamps, a stretched tank will occasionally spawn part way through the launch pad, and will promptly explode when the physics kicks in. IIRC stretchy tanks also had this issue, although I believe that was fixed somehow. C) I can now only change the SRB thrust tweakable in the hundreds using the << or >> buttons, as the smaller ones do nothing, and the slider just always resets to the lower hundred.

Anyway, back to the BACC. So oddly enough a procedural SRB the size of the RT-10 will have about 20% less fuel than its stock counterpart, but when comparing the procedural SRB to the BACC, the procedural SRB has >30% more fuel. In flight testing, the procedural SRB (with a slightly lower thrust, 300-315) outperformed the stock SRB of the same size by ~16s (47-63). A procedural SRB with the same fuel as the BACC is a massive 1.625m shorter, and (still with a lower thrust, so its actually underperforming) outperformed the BACC by about 1 second.

If this is helpful/important, I'm happy to do more testing. Otherwise I'll probably still do it (It's surprisingly fun) I just wont clog the forum with it.

Thanks for making this awesome mod, btw.

Edited by OtherBarry
Link to comment
Share on other sites

Guess I wasn't clear. :]

This isn't a, this is *the* stretchy successor, i.e. Stretchy v9+, with a broader name since it's diversifying, and spearheaded by swamp_ig who's doing amazing stuff (and way more/better than I was!)

Oh didn't quite get that :D I thought something like that but I wasn't sure. Good to know

Link to comment
Share on other sites

For people using RealFuels you need to remove the TankContentSwitcher section of TankLiquid.cfg and TankRCS.cfg for it to work. This is for the current download. This will be fixed in the near future.

I real hate to see 10 different types of RealFuel cfgs so I thought of a idea on how to handle differnt tank types. Right now with Strechy Tanks you have duplicate tanks to handle different types such as cryo, ballon. Currently the tank models are solid shapes. What if we determine the tank type (cryo, etc) by the thickness of the tank. Instead of a solid cylinder for example we have a larger radius and smaller radius which allows use to hollow out the cylinder. This can also be applied to SAS, decouplers, and space station cores. In fact looking at the circular stack decouplers gave me the idea. They tend to be a thin wheel. Besides cylinders we can apply this to the other shapes as well. This also will allow really fine control of the weight of a fuel tank. Besides weight we could even model true shearing forces which would enable us to simulate true stress failure of the tank. Thicker tanks would be harder to flatten on impact.

Sorry I haven't contributed code. I'm a software engineer by trade but I never worked with C# before. Just started to look at monodevelop on linux platform. Can contribute pseudocode for now.

Link to comment
Share on other sites

If there is going to a separate RealFuels config, you may want to increase the efficiency and/or volume of the SRB's as, although i still need to properly test this, they seem really underpowered.

If you want to see my calculations, there's a spreadsheet with it all in here: https://github.com/Swamp-Ig/ProceduralParts/blob/master/Source/ProceduralParts/Calculations.xlsx

Basically the BACC has a lower fuel / dry mass ratio (566) than the RT-10 (866). I try to keep things consistent with stock, so I chose 800 units per T, which is lower than the RT-10 but higher than the BACC. If you really want you can fiddle with the config file and change it.

Firstly, three unrelated bugs I have discovered in my testing. A) With SAS on or off, and with gimbal on or off, a ship that is just Procedural SRB+Payload will wobble around, while a stock SRB+Payload rocket will stay perfectly straight SAS on or off.

Yeh I've noticed that too. Will look into it at some stage.

B) on occasion, if not using launch clamps, a stretched tank will occasionally spawn part way through the launch pad, and will promptly explode when the physics kicks in. IIRC stretchy tanks also had this issue, although I believe that was fixed somehow.

This is fixable, but it would take an awful lot of effort. Just use a launch clamp!

The problem is caused by KSP moving parts to ground before we have a chance to rescale the mesh, so when the mesh gets rescaled it ends up underground.

C) I can now only change the SRB thrust tweakable in the hundreds using the << or >> buttons, as the smaller ones do nothing, and the slider just always resets to the lower hundred.

Ok will fix.

Could you kindly add any bugs you find to the bug tracker as in OP.

Link to comment
Share on other sites

uhm sorry to post this bug here (my computer is old and github hates my computer) but everytime i "revert to launchpad" i get just the orginal SRB (so it's just the one you see in the VAB without any changes) and the thrust effects are on but if i revert again it still does it. will post pics when home.

Link to comment
Share on other sites

acc I think you need to modify TankRCS.cfg. In the MODULE TankContentSwitcher section you need to change resourceName to MonoPropellant. You might have to change unitsPerT as well but I haven't tried this potential fix yet.

Link to comment
Share on other sites

acc I think you need to modify TankRCS.cfg. In the MODULE TankContentSwitcher section you need to change resourceName to MonoPropellant. You might have to change unitsPerT as well but I haven't tried this potential fix yet.

That's fixed.

Link to comment
Share on other sites

The good news:

Bezier cones are implemented and working well

With the exception of what's commented below, all the above reported bugs are fixed.

I will release a new version quite soon (in the next day or two)

The bad news:

I haven't been able to track down why the rockets go unstable soon after launch. I think it's because the links between the parts need to be updated. Will have to look into this.

I have a feeling StretchySRBs might have had the same issue.

Link to comment
Share on other sites

The goal is basically to improve on StretchySRBs, and to entertain my fancies with coding :) The future plans are pretty well documented. See the README.txt for details.

I did. What happen if anyone wants to create a new part?

Not for your mod, just for the game (lets said a decoupler), but they dont want add 1 part for each standard diameter. They can borrow your code (with all credits listed) to make their part with your system?

Or that is against your wish?

In case they can, how easy is to addapt your code?

Of course if Keramzit came to me and said lets integrate, I certainly wouldn't say no.

I have a gun, let me see what I can do :)

You could do that. However the custom made parts for a particular size will likely always be more detailed than a procedural part.
THat it would be the choice of the player, had some differences in the models or reduce their count part ,increasing game performance and increase their part possibilities by a lot.

If you dont remplace the standard parts with yours, you are doing the thing that you dont want.. That is, increase the part counts.

So maybe in the future needs to be a way to remove all game parts, or just ignore them in the game load.

Also you can make a compatibility list, for example, you have a procedural part that remplace several standard tanks, also some other mods tanks.

You can have a file that if some craft have that part, then is remplaced with X parameters of your procedural part to approach to the dimensions of that standard/mod part.

If there is a way to do that, you can do it with one and I will help you to complete the list with the rest.

For example, I have stretchy tanks, real fuels, and other procedural mods, I took the job to remove all the other parts that I dont need from KSP and other mods, and I lose all compatibility with oldest creations.

This is a hard work that it takes hours. I am just saying that many people would not install the mods if they know that they need to do all that, becouse if they already had NP, or KW Rocketry. They would not find any improve if they dont delete the parts that can be remplaced.

Edited by AngelLestat
Link to comment
Share on other sites

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