Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROMaterials: Skin/TPS selection inside Editor #22

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

fluff-li
Copy link

@fluff-li fluff-li commented Sep 19, 2023

First, I'm not sure if this is the right Repo for this, it started as an extension to ROHeatshields but grew bigger.

This is a material based thermal property extension, inspired by RO_Materials.cfg & ROHeatshields, adding the ability to select the Skin/Thermal Protection System of a part inside Editor.

Screenshot (233)
The selected preset effects all skin related thermal properties, mass and cost.
The preset list is defined per part base. The preset definitions are not attached to parts.

Screenshot (234)
Core material changes based on tank types from Realfuels and in connection also the part properties.

Variables "thermalMassModifier" (Specific Heat Capacity), "skinInternalConductionMult" (Thermal Conductivity) and "emissiveConstant" change based on skin temperature, mimicking real-life behavior.

Tool for creating the Preset configs and csv tables fluff-li/RoMaterials_csv_calculator

Depends on: ProceduralParts - fork: to calculate surface area on procedural parts

To Do:

  • Add cost values & balancing
  • Automatic Reentry Tagging in ModuleTagList
  • Check interaction with MLI layering
    • Parts with MLI layer directly change part.heatConductivity based on partPrefab.skinInternalConductionMult
    • Other calculations are also partially based values from partPrefab
  • Presets: expand and revise

WIP/Bugs:

  • Unreliable/wrong surface area calculation using FARAeroPartModule, editor & inflight values differ
    - The big inconsistencies seem to occur only on Procedural & ModularTank parts
  • ModuleROTank: changing Nose/Mount variant doesn't update data
  • GUI: part weight lags behind, when tank type gets changed
  • Surface attached parts/children don't calculate contact area Gets taken care of by FAR voxelization

Parts implementing this, get a customization option inside VAB/SPH, for both core & exterior shell material/construction, which in turn affects the thermal properties of the part as a whole.
PresetROMaterials.cfg: add variable explanation, cleaned names
ModuleROMaterials.cs:
  - make core choose option inactive by default
  - save core & skin values defined in cfg
  - improve implementation of core preset defined in cfg
  - clean how presetCoreName gets overwriten, make it go through PresetCore
  - move thermal mass calculation in updateGUI function
  - make updateHight function differentiate new skin preset & not
Flight display to GUI with basic information
SkinHeight option for Part in cfg Module
Function to make shure core/skin defined in cfg gets addet to core-/skinPresets list
Nullref Exception check for UpdateCoreForRealfuels()

-Expanded
ThermalConductivity calculation
ApplySkinPreset() function to foreward skinNew parameter to UpdateHeight()

Handle skin to skin conductivity value same as skin to internal for now

Expanded Matarials.txt

Revised PresetsROMaterial.cfg explanation on start of the file
@NathanKell
Copy link
Member

HERO. :)

@fluff-li
Copy link
Author

I forgot to mention, it is still WIP, the configs are in early stages and the code has some bugs. I'm going append a list of features/bugs tagged with wip, missing, planned & finished.

@Capkirk123
Copy link
Member

Hot damn! That's good.

@NovemberOrWhatever
Copy link

That's amazing, well done

…ng contact area from surface area and also the option to ignore all surface attached parts, for the same thing. The main idea is to use this on parts that can hold internal attachments, like corgo bays.
…the shuttle.

added an excel sheet to ease preset calculation
moved temporary part patches for testing in here
Added a multiplayer to heat capacity of all surface sections & layer, based on the fraction between max temp of section/layer & the part/section. This is to compensate the dissonance between the supposed temperature difference between layers & section & kerbals uniform temperature modelling.
…eg. when loading a craft with removed or renamed preset.
…surface area

- Default to fARAeroPartModule for surface area calculation
- Removed no longer needed debug logs
- Implemented a calculation to keep the thermal mass the same on TPS change
… when TPS height changes & skip waiting for voxelization
@NathanKell
Copy link
Member

Sorry, for some reason our CI is trying to build this despite it being on another fork. Please ignore any spam from github in that regard. :)

Build a workaround to update mass diplay in GUI
Currently, the modules ModuleFuelTanks and FAR update their mass through periodic checks in the Update() / FixedUpdate() functions, which causes a delay in reflecting changes made through the uiControlEditor. As a result, the onFieldChanged calls on these modules execute before they update their mass.

Other Changes:
- Use OnPartVolumeChanged event to catch volume changes in ModuleROTanks
- Fire EditorShipModified event sender only if the module mass has changed
-Add eraly shuttle & shuttle presets
-Tweak excel sheet calculations
@fluff-li
Copy link
Author

Sorry, for some reason our CI is trying to build this despite it being on another fork. Please ignore any spam from github in that regard. :)

No worries :)

- reduced number of tries of rechecking for mass update
- ignore next voxelization if onEditorShipModified is fierd from ROMaterials
where the value of skinMaxTemp is set to average temperature across part, instead of localised maximum.
…erty values

Thermal mass value of the core is no longer influenced by thermal mass of skin and vice versa
Load temperature dependent properties array into Module on Loading if LoadedSceneIsFlight.

Removed part.heatConductivity from skinInternalConductionMult calculation.

Check for infinity on heightfactor calculation after TPS change.
…check for displaying & updating Flight Debug Display
…ffects skinInternalConductionMult calculation
Removed persistance of FlightDisplay & Debug Fileds

Temporarliy disabled getting surface area from ProceduralParts module

Split LoadThermalPropertiesAttay function into two for skin & core

Small changes on Debug.Logs
…alMassModifier) multiplier into one get Method
…t definition via cfg, scince with far installed, the game gets its in flight surface area from far

Fixed bug with flightDebug display
…, adjusting it to FlightIntegrator calculation
… to input a referance surface density for module mass calculation
…g of core preset, based on value defined in config
@NathanKell
Copy link
Member

@fluff-li please let us know when you're ready for this to be tested / merged! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants