shadowmage45 / SSTULabs

Dev repository for testing/unfinished KSP parts/plugins/etc.
Other
62 stars 41 forks source link

Negative tank mass with Realism Overhaul #811

Open JackIt999 opened 4 years ago

JackIt999 commented 4 years ago

The modular tanks (except for the modular lander tank) appear to have negative masses in the VAB and thus float in midair when I launch them. I am aware that this issue was solved when RealFuels is installed, however with the rest of RO installed the bug appears again. I am guessing it has something to do with RO rescaling and re-weighing parts?

Running KSP ver 1.7.3 and the latest RO and SSTU, no other mods

shadowmage45 commented 4 years ago

I am aware that this issue was solved when RealFuels is installed, however with the rest of RO installed the bug appears again.

If it works with 'stock' RealFuels, it should work with RO. All that is needed is a simple patch to the SSTU fuel tanks configs ( https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/ModIntegration/RealFuels/RF.cfg ) Either way, I am not part of the RO team, and cannot directly provide fixes for their issues. I have provided the functionality for them to use, and the responsibility to make use of it is theirs.

To confirm -- you say that the tanks work fine with just 'stock' RealFuels installed, but then revert to having issues when the full RO pack is installed?

In order to investigate further to confirm where the problem is, I would need to see an excerpt of the SSTU MFT fuel tanks' config out of your ModuleManager.ConfigCache (please not the whole file, I just need the config for one of the SSTU fuel tanks), to see what the final config for those parts looks like. 95% likely that the RO patches are not setting up the interop flags properly for those, which then manifests in the issue you are seeing. (also possible there is some other bug or conflict, but this seems to be a simple patch omission)

JackIt999 commented 4 years ago

Heres what (I think this is the right one) says about one of the tanks in the ModuleManager.Config.Cache

UrlConfig { parentUrl = SSTU/Data/ModelData/ModelData-MFT-A-Tanks.cfg SSTU_MODEL { name = MFT-A-0-5 modelName = SSTU/Assets/SC-TANK-A-0-5 orientation = CENTRAL height = 2.5 diameter = 5 volume = 49 cost = 0 upperDiameter = 5 lowerDiameter = 5 upperProfile = cylinder upperProfile = uncapped compatibleUpperProfile = cylinder compatibleUpperProfile = uncapped compatibleUpperProfile = capped compatibleUpperProfile = inset lowerProfile = cylinder lowerProfile = uncapped compatibleLowerProfile = cylinder compatibleLowerProfile = uncapped compatibleLowerProfile = capped compatibleLowerProfile = inset minVerticalScale = 0.5 maxVerticalScale = 1.5 textureSet = SSTU-MFT-A-Stripes1-Stringers textureSet = SSTU-MFT-A-Stripes2-Stringers textureSet = SSTU-MFT-A-Stripes3-Stringers textureSet = SSTU-MFT-A-Stripes4-Stringers textureSet = SSTU-MFT-A-Stripes5-Stringers textureSet = SSTU-MFT-A-Stripes6-Stringers textureSet = SSTU-MFT-A-Stripes1-Plain textureSet = SSTU-MFT-A-Stripes2-Plain textureSet = SSTU-MFT-A-Stripes3-Plain textureSet = SSTU-MFT-A-Stripes6-Plain textureSet = SSTU-MFT-A-Soyuz textureSet = SSTU-MFT-A-Orange-Plain textureSet = SSTU-MFT-A-Orange-Stringers textureSet = SSTU-MFT-A-Gold textureSet = SSTU-MFT-A-Silver } }

shadowmage45 commented 4 years ago

Thanks... close, but not quite the config I was looking for :) (I should have given precise names... sorry) What you posted was the config for the model definition for one of the tanks, rather than for the actual Part that uses the models.

Looking for the config for the SSTU-MFT-A part. Try searching for 'SSTU-TANK-MFT-A' in that same file, and it should locate the specific config in question.

JackIt999 commented 4 years ago

First result for SSTU-Tank-MFT-A

UrlConfig { parentUrl = SSTU/Parts/Tanks/SSTU-TANK-MFT-A.cfg PART { module = Part name = SSTU-A-Tank-SM-IV author = Shadowmage TechRequired = basicRocketry entryCost = 16000 cost = 6148 category = FuelTank subcategory = 0 title = Modular Service Module, IV manufacturer = SSTU description = Level IV Service Module Tank similar to ones used by Apollo. These are used to store life support, payloads and electric charge. These are heavy tanks with poor utilization that simulates the supporting structures and systems needed for the specialized payloads. Max Utilization: 75% Can Hold Satellite Payload, Sounding Rocket Payload and Life Support Supplies (as well as regular fuel) tags = tank, fuel, ?lfo, ?lf, lh2, hydrolox, kerolox, cryo, resource, storage sstu rescaleFactor = 1 node_stack_top = 0,1,0,0,1,0,2 node_stack_bottom = 0,-1,0,0,-1,0,2 node_stack_noseinterstage = 0,1,0,0,1,0,2 node_stack_mountinterstage = 0,-1,0,0,-1,0,2 node_attach = 2.5, 0, 0, 1, 0, 0 attachRules = 1,1,1,1,0 mass = 1 crashTolerance = 14 fuelCrossFeed = True breakingForce = 2000 breakingTorque = 2000 maxTemp = 773.15 gTolerance = 100 maxPressure = 20000 skinMaxTemp = 873.15 MODEL { model = SSTU/Assets/EmptyProxyModel }

shadowmage45 commented 4 years ago

Was there anything below the MODEL node?

There should be a MODULE with 'name = SSTUModularPart'. And inside that there should be a value 'subtractMass = false'.

Edit: Pretty much that is what I'm looking for -- to confirm the presence or absence of that line.

JackIt999 commented 4 years ago

under the config for SSTU-TANK-MFT-A 'subtractmass' is not listed at all

shadowmage45 commented 4 years ago

Thanks.

That points to whatever patches RO is using being incomplete / incorrect. The solution will have to come from RO, by implementing the patches properly.

Notably here: https://github.com/KSP-RO/RealismOverhaul/blob/master/GameData/RealismOverhaul/RO_SuggestedMods/SSTU/SSTU_Tanks.cfg#L32-L39

They need to add the following line: %subtractMass = false

I'm personally not sure why SSTU's RF patches aren't working in such a setup (as I'm already patching that line when RF is found), unless RO-RF has a different modname than stand-alone RF.

JackIt999 commented 4 years ago

Thank you so much for the help, i just tried this and now there are no more negative mass tanks! Also turns out that RO has problems with displaying mass correctly for any fuel tank - not just sstu tanks. Luckily none of them have negative mass