Jump to content

Modular Fuel System Continued v3.3 (OBSOLETE)


NathanKell

Recommended Posts

NathanKell:

Can you please include build number in the file name of your download? It's very hard to figure out if the version I'm using the latest one or not... I use bitbucket.org for my projects, in addition to git/mercurial source control and bug tracker it provides an area for downloads, where you can put your packages.

With that said, Stretchy Tanks & MFSC still don't play nice together - when I load craft, it puts incorrect amount of propellants into tanks, once I go to action group menu -> select tank -> remove all -> load it back, dV and TWR magically changes. Second - when I resize the tank, it usually overfills them (the numbers are yellow in MFSC GUI), again remove all props -> re-add all props fixes the problem. These issues are not a deal breaking, but very annoying.

Oh, and you MJ build still can't seem to recognize the fact that thrust in atmopshere is lower than in vacuum.

Edited by asmi
Link to comment
Share on other sites

NathanKell:

Can you please include build number in the file name of your download? It's very hard to figure out if the version I'm using the latest one or not... I use bitbucket.org for my projects, in addition to git/mercurial source control and bug tracker it provides an area for downloads, where you can put your packages.

With that said, Stretchy Tanks & MFSC still don't play nice together - when I load craft, it puts incorrect amount of propellants into tanks, once I go to action group menu -> select tank -> remove all -> load it back, dV and TWR magically changes. Second - when I resize the tank, it usually overfills them (the numbers are yellow in MFSC GUI), again remove all props -> re-add all props fixes the problem. These issues are not a deal breaking, but very annoying.

Oh, and you MJ build still can't seem to recognize the fact that thrust in atmopshere is lower than in vacuum.

use the latest development build of MJ. It does take into account atmo thrust. (says SLT)

IF you are using MFSC

Link to comment
Share on other sites

asmi,

1. I do put the build number in the filename: this is v3.

2. Based on some issues people were having in the ST thread, I'm going over the whole thing one more time. The heart of the problem is that the stretching is done tiny bit by tiny bit, and Modular Fuels rounds fuel quantities to 4 significant figures. When you start from a rounded base and multiply by like 1.0001 each timestep, the errors compound. I'm trying to figure out a better solution.

3. As was said upthread (and can be seen by the removal of the link to the custom MJ that used to be in the OP) sarbian included my patch in the latest dev build, as Starwaster says. What exact issue are you running into regarding it being wrong about thrust? SLT is correct for sea level, and TWR / Max TWR are correct for vacuum. Is the current reported acceleration wrong?

Link to comment
Share on other sites

P.S. in Mechjeb, you have to hit "show all stats" for it to show up the first time, I think. I wrote it that way so that it won't confuse people who don't use MFSC (it's only ever available if you fly a vessel with an engine with MFS support).

Link to comment
Share on other sites

asmi,

1. I do put the build number in the filename: this is v3.

How many "v3's" have you released already? I know about at least three of them :wink: The point is to use notation like v3.X, where X is just a sequential release number, so that I would be able to figure out if there is a never version just by looking at your download's filename and comparing it with what I've got locally (I keep all packages of all mods I ever downloaded, including old versions).

2. Based on some issues people were having in the ST thread, I'm going over the whole thing one more time. The heart of the problem is that the stretching is done tiny bit by tiny bit, and Modular Fuels rounds fuel quantities to 4 significant figures. When you start from a rounded base and multiply by like 1.0001 each timestep, the errors compound. I'm trying to figure out a better solution.

How about instead of calculating the delta you recalculate the whole tank? This way there will be no rounding errors.

3. As was said upthread (and can be seen by the removal of the link to the custom MJ that used to be in the OP) sarbian included my patch in the latest dev build, as Starwaster says. What exact issue are you running into regarding it being wrong about thrust? SLT is correct for sea level, and TWR / Max TWR are correct for vacuum. Is the current reported acceleration wrong?

I think I know what the problem is. I use custom-made RL engines:

ukkvqWv.png

I thought MFSC would automatically add thrust correction, but apparently I was wrong. What do I need to do to make that happen? I don't need any other features of MFSC (like fuel types, levels, etc.) since it's a RL engine - I only want thrust corrector to work. How do I specify sea-level thrust (I've set thrust in vacuum as maxThrust)?

Link to comment
Share on other sites

You sure you have the latest? They sure do have mass in the cfg.

And I just checked in my game, and the mass is right in line with my calculations.

The Jumbo masses 0.345t dry.

Install MFS v3 Continued RFRM again.

I checked and I do have the latest. What's more, looking at I do see LiquidH2 tank mass... And basemass. Since I have a set of WIP configs I checked there but I'm not touching LH2 tank mass. So I'm not sure yet where the missing mass went :(

Link to comment
Share on other sites

asmi,

1. I released a v3 alpha, and now I have released v3 full. But some folks didn't want to unzip RealFuels.zip and change cfg settings, so I provided three "prebuilt" MFSCv3 downloads, regular, RealFuels (but non-realistic masses) and RealFuels + RealMasses. You presumably want v3RFRM.

I think I may have titled the zip file for v3 alpha just v3, though, for which I apologize. Won't happen again (Well, I will make every effort. No impossibles.)

2. I do recalculate the whole tank. That's the new system. But what gets messy is that to recalculate the whole tank's _fuels_ I have to run off the existing maxAmounts of the resources in it, to keep the percentage of each scaled right. And since they start rounded (MFS rounds all amounts and maxamounts to 4 sig figures), that's where the error arises. I did find the problem where they're overwriting persistent volumes, though, and I'll add final rounding on mouse leaves tank (via another sendmessage to MFT)

3. You can add a "dummy" ModuleEngineConfigs.


MODULE
{
name = ModuleEngineConfigs
configuration = ANYTHING_CAN_GO_HERE
modded = false
CONFIG
{
name = AS_LONG_AS_THE_SAME_THING_GOES_HERE
minThrust = YOUR_ENGINE_MIN_THRUST (= maxThrust if not throttleable)
maxThrust = YOUR_ENGINE_MAX_THRUST
heatProduction = YOUR_ENGINE_HEAT_PRODUCTION

PROPELLANT // copy this from ModuleEngine
{
name = Aerozine
ratio = 0.47
DrawGauge = True
}
PROPELLANT // and this
{
name = N2O4
ratio = 0.53
}
atmosphereCurve // and this
{
key = 0 316
key = 1 160
}
IspSL = 1.0
IspV = 1.0
}
}

The reason is because thrust scaling is done in the MEC partmodule. No partmodule, no thrust scaling. It's required because you need some way of knowing the engine's actual max thrust, and with configurations chanegeable in flight, the method Arcturus uses (load each engine module on flight start) won't work.

Link to comment
Share on other sites

I checked and I do have the latest. What's more, looking at I do see LiquidH2 tank mass... And basemass. Since I have a set of WIP configs I checked there but I'm not touching LH2 tank mass. So I'm not sure yet where the missing mass went :(

That sounds like an extra config file changing something, sure enough.

Link to comment
Share on other sites

2. I do recalculate the whole tank. That's the new system. But what gets messy is that to recalculate the whole tank's _fuels_ I have to run off the existing maxAmounts of the resources in it, to keep the percentage of each scaled right. And since they start rounded (MFS rounds all amounts and maxamounts to 4 sig figures), that's where the error arises. I did find the problem where they're overwriting persistent volumes, though, and I'll add final rounding on mouse leaves tank (via another sendmessage to MFT)

Why can't you save propotions into your part module's config using double-precision once user enters them, and then after rescaling recalculate amount/maxAmount based off these numbers? Oh, and speaking of which - PartModule's built-in persistence mechanism doesn't support doubles - only floats. This revelation cost me a good couple hours of debugging and head-scratching this weekend :) So if you want to save doubles, you'll need to override OnLoad/OnSave and manually read/write doubles, or resort to floats which work fine.

3. You can add a "dummy" ModuleEngineConfigs.

Thanks, I'll try it out.

The reason is because thrust scaling is done in the MEC partmodule. No partmodule, no thrust scaling. It's required because you need some way of knowing the engine's actual max thrust, and with configurations chanegeable in flight, the method Arcturus uses (load each engine module on flight start) won't work.

But you surely can attach your part module on flight start :)

Link to comment
Share on other sites

Engineer, I guess I should include some of ialdabaoth's OP. Sorry.

Modular Fuel System does the following:

*It allows any supported tank to be filled with exactly how much or how little fuel you want, of whatever type you want (though different tanks may allow or disallow certain fuels; jet fuel tanks won't take oxidizer for instance)

That's the classic modular fuels.

Then, there's the Real Fuels mode. That opens up some new options. First, new resources get added, so engines can use real-world fuels, and KSP fuels are changed to be their real-world counterparts. Also, Isps are made realistic for the type of engine. Finally, engines can be of multiple tech levels; at higher tech levels they have higher thrust, lower mass, and better Isp.

Second, engines can have multiple configurations (for example, an upper stage could support a kerosene + liquid oxygen mode, and a liquid hydrogen + liquid oxygen mode). These modes have different thrust, Isp, etc.

asm: cool! Yeah, close enough. :]

Link to comment
Share on other sites

Okay so I am working on adding some new fuel types and I've been mostly successful but currently the "buttons" that show up in the MFS box in action groups don't do anything aka I can't add my fuel to a tank and I cannot auto configure for an engine that uses the new fuels. What needs to be done?

Thanks!

Link to comment
Share on other sites

You need to:

Add a new RESOURCE {} definition

For all the tank types you want it enabled for (each TANK_DEFINITION node) you need to add a TANK {} subnode. That subnode needs name = your_new_fuel_type and whatever other params you want to add.

Then it should be available.

Example

In some CFG (assuming you have ModuleManager 1.3 installed):

RESOURCE_DEFINITION
{
name = foo
density = 0.005
flowMode = STACK_PRIORITY_SEARCH
transfer = PUMP
}

@TANK_DEFINITION[Default] // add one of these for each tank type you want to add it to, like Cryo or RCS
{
TANK
{
name = foo
utilization = 0.995
mass = 0.00005
temperature = -183 // do not include temp
loss_rate = 0.0000000001 // or loss_rate if fuel is not cryogenic
maxAmount = 0 //set to > 0 if you want the tank to default to having some of this, and use %
amount = 0 // or set to a ratio between 0 and 1 [or full] if you want tank to start filled to that ratio
note = (requires insulation) // include a note if you need a note. Cryos have this, Xenon has (pressurized), others have no note.
}
}

Link to comment
Share on other sites

I did that. I only added it to the Default type and the fuels show up in the list of fuels that "can be added" but the "add" button doesn't actually add them.

c3M52aD.png

nXx8LwW.png

Edited by gm537
added pics
Link to comment
Share on other sites

Huh!

Post your files and I'll take a look.

In other news: Finally have stretchy-MFS integration better. The one issue is the ratio issue I've been talking about; when doubling size you end up off by about 1% from correct ratio. So you have to, when done rescaling, go into MFS and remove and re-add to get the correct ratio. But the textfields update, the tanks don't break on save/load, it all looks good. And it will even auto-round correctly when you mouse out of the tank.

Link to comment
Share on other sites

Here are my files. I can't really see what's wrong. Note I had previously made some changes to the engines document but was having no problems until I tried this Fuel thing. Only the LV-909 is currently configured to run the new fuel.

http://www./view/5xr37fvvsb1qn8e/RealTankTypes.cfg

http://www./view/4xx9qay57cf5ax9/ResourcesFuel.cfg

http://www./view/n45k57u4k4661ci/Engines.cfg

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...