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

Resource Mass Sometimes Misreported #20

Closed
toadicus opened this issue Feb 8, 2015 · 2 comments
Closed

Resource Mass Sometimes Misreported #20

toadicus opened this issue Feb 8, 2015 · 2 comments

Comments

@toadicus
Copy link

toadicus commented Feb 8, 2015

In some situations, the resourceMass and totalResourceMass values I'm fetching from KER do not seem to make sense. Using the Kerbal X as an example; here's a readout of the stages in the editor:

Stages In Editor

"Mass" and "Total Mass" are fetched directly from Stage.mass and Stage.totalMass. Here's my vessel info panel on the pad before staging at all:

Stages In Editor

The slight difference in total mass is the fault of another mod of mine, but is consistent. However, the reported Resource Mass of 145 tons is necessarily incorrect. "Resource Mass (stage)" is Stage.resourceMass and "Resource Mass" is Stage.totalResourceMass.

Here's the panel again after releasing the launch clamps (so we've staged twice):

Stages In Editor

The fuel mass in two nacelles is 400 * 3 * 2 * .005 = 12 kg. In all 6 nacelles it's 36 kg. There's another 48 kg in the center stack. None of those values or any reasonable sum seem to be represented here. Also, the 25.806 value does not change as fuel burns.

When the first pair of nacelles runs out of fuel, but before they're decoupled, the readouts change:

Stages In Editor

Again, both resource values reported much be incorrect, as they are equal to or greater than the total craft mass.

When the first pair of nacelles are decoupled (so we've staged one more time), it changes again:

Stages In Editor

As a temporary workaround, I have hacked access to baseMass at the stage level into my local fork.

Let me know how I can help!

@Gerry1135
Copy link
Contributor

I believe the fix for this is to change this line in simulation.cs:

stage.resourceMass = this.stepStartMass - this.stepEndMass;

to:

stage.resourceMass = this.stageStartMass - this.stepEndMass;

Toadicus is going to try this and let us know.

@toadicus
Copy link
Author

toadicus commented Feb 9, 2015

That does appear to fix it. Thanks!

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

No branches or pull requests

3 participants