KSP-RO / RealismOverhaul

Multipatch to KSP to give things realistic stats and sizes
374 stars 279 forks source link

Global Materials Configuration #1306

Closed PhineasFreak closed 7 years ago

PhineasFreak commented 8 years ago

After some talk with @NathanKell about the temperature limits of the parts i decided to create an "automated" system so that all RO parts can have correct physical abilities (be it an engine, fuel tank, structural part, electronics, etc).

NOTE: everything below are subject to change. Suggestions are highly recommended.

1. Defining a material

Similar to the engine definitions and the TestFlight configs, the Material configs can define either a generic material (AeroLow, StructuralHigh, UtilityLow etc) or a true material (Aluminum, Titanium, Inconel etc). Example config node below:

@PART[*]:HAS[#materialType[Aluminum2219]]:FOR[RealismOverhaulMaterials]
{
    MATERIAL
    {
        name = Aluminum2219
        tensileStrength = 455
        shearStrength = 285
        partServiceTemperature = 573.15
        skinServiceTemperature = 573.15
    }
}

The "tensileStrength" and "shearStrength" parameters define the maximum structural loads that the material can handle (KSP simulates that at the attachment nodes and not the parts themselves but it is a good approximation).

The "partServiceTemperature" and "skinServiceTemperature" define the maximum operating temperature of the material. Parts like heat shields may have a low part service temperature but a very high skin service temperature (simulating the ablative material used) and parts like structural couplers/trusses may have the same temperature values for both fields.

More parameters can be added like buoyancy, emissivity, thermal mass modifier(s) or even tags to make part cataloguing easier (i.e. search only for high temperature nose cones or for reentry - capable fuselages).

2. Using a material

Using a material config for a part is really easy. Just add the following fields via a Module Manager patch:

%useGlobalMaterialConfig = True
%materialType = Aluminum2219

And you are done! Now the part will automatically have the physical properties of the defined material (in our case a high strength Aluminum alloy for cryogenic fuel tanks, similar to the Space Shuttle External Tank).

3. Expanding the Materials library

A new MATERIAL config requires: a) mechanical properties (currently tensile and shear strengths to be used by the attachment nodes) and b) the thermal properties (currently core and skin service temperatures - same as the stock maxTemp and skinMaxTemp fields). For non - materials (electronics or science instruments that usually have low mechanical strengths and service temperatures) the values can be game - play defined and balanced. Example: a pressure gauge for Venus (high mechanical and thermal capabilities) and for Titan (low mechanical and thermal capabilities compared to Venus).

You can grab the current testing files from here. Required files include the RealismOverhaul_Global_Config.cfg and the (WIP) Material Configs.

NathanKell commented 8 years ago

Looks good to me! Sorry about missing commenting on this.

Worth noting that DRE's "burn" times are so short that effectively we should IMO treat the service temp as when the burning starts, not the true internal maxTemp.

PhineasFreak commented 8 years ago

IIRC DRE adjusted the "burning" temperature to be 80% of the defined maxTemp. In that case the service temperature could be adjusted accordingly with a multiplier, right?

NathanKell commented 8 years ago

Yep!

PhineasFreak commented 8 years ago

Sorry for not replying earlier (was in vacation) but i have made a slight change to account for the 85% (and not 80%) of the Deadly Reentry "burning temperature" factor. Everything should be good now.

stratochief66 commented 7 years ago

While the material properties of various materials can be stored, how can these be realistically used? Doesn't the possibility of failure depend on the area of connection between two parts, which is related to their actual in-game sizes? Is there a straightforward way to extract that information from the MM data for the two parts interfacing?

This seems like useful information, to be used by a mod that doesn't exist. Unless I'm missing something major. @PhineasFreak ?

PhineasFreak commented 7 years ago

@stratochief66 No, there is not a way to know what parts are going to be connected to other parts. Even the simplified implementation of setting a part to have the specific mechanical/thermal properties would ultimately fail since they are dependent on the physical properties (shape, thickness) and construction (riveted, welded, bolted) e.t.c.

These are also the reasons why i did not continue pursuing this "global materials". It is much easier to set the thermal properties per part and the mechanical ones are not so fleshed out by stock to warrant something else than the RO global patching (crash tolerances are a different beast though, they directly impact the correct operation of the part, just like the max temperatures).

I guess that we can safely close this one.