Jump to content

pacbard

Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by pacbard

  1. TL;DR: We found out that using the correct volumetric proportions to fill a tank makes no sense. Stock tanks don't make sense, so we cannot just convert them to liters and call it a day. We calculated some wet/dry fractions that we think are balanced with real world rockets once you consider the stock world resize (it works out that the wet/dry fractions should be about 1/3 of real world ones). Check out the neat tables for more info. Last, we are throwing around different configs for the tanks: My idea is to keep the same tank setup for stock tanks converted to LH2, which always works out to have 1/2 of its volume in oxidizer. From there, we can just double the amount of LH2 in a mix tank to find out the volume for a LH2-only tank. I did some balancing for tank weights so the total delta v for cryo engines stays the about the same for stock tanks (the patch is 6% better in terms of dry/wet ratio, but once you consider payload the effects are negligible). NFT are 1/4 of the weight for LH2 and 1/2 of the weight for OX. This helps a lot with nuclear rockets (~50% boost in performance before payload). // Adds InterstellarFuelSwitch to LFO and LH2 tanks // 5.5*total LFO // LF/O tanks @PART [*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { // Factors %mixOXProportion = 0.5 // Percent of OX in a mix tank %LH2tankDensity = 0.000043750 // 0.5 of the density of LH2 %OXtankDensity = 0.000625 // Same as stock %mixLH2Proportion = 1 @mixLH2Proportion -= #$mixOXProportion$ %LF = #$RESOURCE[LiquidFuel]/maxAmount$ %OX = #$RESOURCE[Oxidizer]/maxAmount$ %totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ @totalCap += #$RESOURCE[Oxidizer]/maxAmount$ %mixOX = #$totalCap$ @mixOX *= #$%mixOXProportion$ %mixLH2 = #$mixOX$ @mixLH2 *= 10 %onlyLH2 = #$mixLH2$ @onlyLH2 /= #$mixLH2Proportion$ // masses // find mass modifier for special tanks %massModifier = #$mass$ %tempVar = #$totalCap$ @tempVar *= 0.000625 @massModifier -= #$tempVar$ %onlyLH2mass = #$onlyLH2$ @onlyLH2mass *= #$LH2tankDensity$ @onlyLH2mass += #$massModifier$ %mixOXmass = #$mixOX$ @mixOXmass *= #$OXtankDensity$ %mixLH2mass = #$mixLH2$ @mixLH2mass *= #$LH2tankDensity$ @mixLH2mass += #$mixOXmass$ @mixLH2mass += #$massModifier$ MODULE { name = InterstellarFuelSwitch resourceGui = LF/OX;LH2/OX;LF;OX;LH2 resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$ } !RESOURCE[LiquidFuel] {} !RESOURCE[Oxidizer] {} } // Pure LH2 tanks @PART [*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { // Factors %TankRescale = 1.35 // Volume rescale to match stock %mixOXProportion = 0.5 // Percent of OX in a mix tank %LH2tankDensity = 0.0000109375 // 0.25 of a stock tank %OXtankDensity = 0.0003125 // 0.5 of a stock tank %mixLH2Proportion = 1 @mixLH2Proportion -= #$mixOXProportion$ %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$ @LH2 *= #$TankRescale$ %mixLH2 = #$LH2$ @mixLH2 *= #$mixLH2Proportion$ %mixOX = #$mixLH2$ @mixOX /= 10 %OX = #$mixOX$ @OX /= #$mixOXProportion$ // masses %LH2mass = #$LH2$ @LH2mass *= #$LH2tankDensity$ %onlyOXmass = #$OX$ @onlyOXmass *= #$OXtankDensity$ %mixOXmass = #$mixOX$ @mixOXmass *= #$OXtankDensity$ %mixLH2mass = #$mixLH2$ @mixLH2mass *= #$LH2tankDensity$ @mixLH2mass += #$mixOXmass$ MODULE { name = InterstellarFuelSwitch resourceGui = LH2;LH2/OX;OX resourceNames = LqdHydrogen;LqdHydrogen,Oxidizer;Oxidizer resourceAmounts = #$../LH2$;$../mixLH2$,$../mixOX$;$../OX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../LH2mass$;$../mixLH2mass$;$../onlyOXmass$ } !RESOURCE[LqdHydrogen] {} } Fraz86 instead is trying to do something different. He is working on keeping a correct ratio between the oxidizer and LH2 in the tank setup. I think that he settled for 45% OX and 55% LH2. From there, he calculates the dry mass for the tanks. He also found out a way to keep the stock's additional weights the same while switching fuels (for example the weight increase for fuselage tanks) . You can find his patch here. I love the additions! BTW, I finally went around reading your code. You did an awesome job with it. Take a look at the patch above. I basically ripped off some of your ideas and I think that I was able to find a way to get rid of the volume fudge factor for LH2. The idea is that when you pick the OX fraction, you are already settling on a density/pressure that LH2 will have in a mixed tank. From there, this is what I thought: In a mixed tank, the LH2 will have some density/pressure because it is still occupying the same volume as the original tank. Now, we can just convert the OX fraction to LH2 using that same density/pressure that we used to convert 55% of the tank to LH2 for the LH2-only tank. It works out like this: OX_Liters = OX_volume * 2 * 10 (Double the volume of OX and use the special density/pressure factor that we used to find the LH2 liters in a mixed tank) LH2_Liters = OX_Liters * fraction + LH2_Liters_mixed (Rescale the total liters of OX to 45% of the tank) I'm not sure the reason why doublinging the volume of OX works. I think it has to do with finding how far away you are from 0.5 of a tank or something. A numerical example for a FL-800 tank works out like this: 45%-55% mix -> 360 OX - 3600 LH2 100% LH2 -> (360 * 20 * 0.45) + 3600 = 6840 LH2 (Effective fudge factor of ~1.55) Edit: The *2 factor really does not make sense but it works out nicely. If we want to keep the LH2 density constant between tank setups we have to do something like this: LH2_only = LH2_mix / (1 - OXProportion) Beware that using that will make the LH2-only tanks very underpowered, at the expense of nuclear rockets. I would rather use a 50-50 composition and live with having a lot of LH2 in a LH2-only tank. Edit 2: I updated my script with the new proportional calculations for LH2-only and OX-only tanks. Let me know what you guys think about is.
  2. No offense taken. It has been real fun digging into KSP's fuel logic and getting to know it better. I really like your idea of calculating the weight of the tank on the amount of fuel that it holds. I really don't want to rain on your parade, but your fudge factor is just multiplying the volume. KSP actually uses the density from the CRP file to calculate the fuel consumption per second. If you don't change the density of the fuel in the config file, the fuel consumption does not change (fun fact, if you increase the density of the fuel, fuel consumption will actually go down!). So if you put more fuel in a tank and you keep the consumption the same (because the actual fuel density stays the same), the result is to just increase the volume of the tank. For example, the Volcano engine has an ISP of 410 sec and a thrust of 275 N. You can use the ISP formula to calculate the fuel rate in L/s (another fun fact! KSP uses L/s instead of fuel units per second with these calculations) using fuel rate = Thrust / (Average density of propellant * g * ISP) with the data for the volcano, you will get: Fuel rate = 275 / ((1*0.005+10*0.00007085) * 9.81 * 410) = 11.97 fuel units of oxidizer and 119.7 fuel units of liquid hydrogen (which is close enough to what you get from the game - 11.981 ox/sec and 119.81 LH/sec - I think that the game uses a longer number for g). If you go and multiply the density of LqdHydrogen in the CRP file (I think I did the test with 1.5 times), you will get something like 11.27 L/sec of oxidizer and 112.7 L/sec for liquid hydrogen (again, for some reason KSP calls fuel units liters). Changing the density of the propellant has long reaching effects on the game. I think that this is the reason why Nertea does not want to touch the density of the propellant. It will throw off the balance of the whole pack (especially ISP and thrust). I agree with you about trying to keep the game fun. My vote is for a fudge factor of 2 and an OX ratio of 0.50. This way, you can stack two LH+OX mixed tanks or one LH and one OX and get the same result. Easy, fun, intuitive, completely unscientific. In short, totally kerbal.
  3. Agree to agree! WOW! I'm getting carried away. Fraz86, do you github? With all these code snippets flying around I don't know what we are talking about anymore. If you want to use a script that keeps the volume constant across the different tank settings, you can use this: // Adds InterstellarFuelSwitch to LFO and LH2 tanks // 5.5*total LFO // LF/O tanks @PART [*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LF = #$RESOURCE[LiquidFuel]/maxAmount$ %OX = #$RESOURCE[Oxidizer]/maxAmount$ %totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ @totalCap += #$RESOURCE[Oxidizer]/maxAmount$ %onlyLH2 = #$totalCap$ @onlyLH2 *= 5.5 // CRP resources are measured in liters. 1 fuel unit = 5.5 L %LH2toOX = 15.5 // 5.5 Liters of OX to 10 liters of LH2 @LH2toOX /= 5.5 // Convert fuel units (keeps the decimal numbers neat) %mixOX = #$totalCap$ // Start with a tank full of OX @mixOX /= #$LH2toOX$ // Find the correct percentage OX %mixLH2 = #$totalCap$ // Use the total tank capacity @mixLH2 -= #$mixOX$ // LH2 will fill the rest of the tank @mixLH2 *= 5.5 // Convert LH2 to liters // masses %mixLH2mass = #$mass$ @mixLH2mass *= 0.9 %onlyLH2mass = #$mass$ @onlyLH2mass *= 0.85 MODULE { name = InterstellarFuelSwitch resourceGui = LF/OX;LH2/OX;LF;OX;LH2 resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$ } !RESOURCE[LiquidFuel] {} !RESOURCE[Oxidizer] {} } // Pure LH2 tanks @PART [*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$ %mixLH2 = #$LH2$ %LH2toOX = 15.5 // 5.5 Liters of OX to 10 liters of LH2 %mixLH2 = #$LH2$ // Start with a tank full of LH2 @mixLH2 /= #$LH2toOX$ // Find the correct percentage for LH2 @mixLH2 *= 10 // 10 parts of LH2 %mixOX = #$LH2$ // Start with a tank full of OX @mixOX /= #$LH2toOX$ // Find the correct percentage OX (we are supposed to *5.5 parts / 5.5 liters) %OX = #$LH2$ @OX /= 5.5 // Stock resources are measured in fuel units. 1 fuel unit = 5.5 L // masses %LH2mass = #$mass$ %mixLH2mass = #$LH2mass$ @mixLH2mass *= 1 %onlyOXmass = #$LH2mass$ @onlyOXmass *= 1 MODULE { name = InterstellarFuelSwitch resourceGui = LH2;LH2/OX;OX resourceNames = LqdHydrogen;LqdHydrogen,Oxidizer;Oxidizer resourceAmounts = #$../LH2$;$../mixLH2$,$../mixOX$;$../OX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../LH2mass$;$../mixLH2mass$,$../onlyOXmass$ } !RESOURCE[LqdHydrogen] {} } Cryo engines lose about 20% of their delta v as a result of the new fuel amounts (I just tested 1 engine with 2 tank setups, so my sample factor is rather small). I think that we need to do some balancing of tank weights if we want to keep it consistent with the current numbers. Also, we could just reverse the factors when converting the LH2 tanks (for example, if we decide to have a *0.5 factors for stock LH2 tanks, we can have a /0.5 for NFT OX tanks). BTW, if we decide to keep the volume constant across tank setups, I am against adding a fudge factor to buff up a specific tank setting. The problem is that KSP engine code does take in consideration the resource density when calculating the resource usage (that's one of the issues with NTR converted to LH2 and the reason why the NFP patch buffs ISPs). So, if we include a fudge factor, we will just increase the volume without increasing/decreasing the engine consumption - resulting in magic volume being added to the tank. This is the other option that we have. We take the current calculations for mixed tanks as correct (I like to think that LH2 is pressurized so kebals can fit more liters in a tank - is it even possible?), then LH2 fills 1/2 of a tank and we can just double that to get the amount in a LH2-only tank. I balanced the tank weights so that they have the target wet/dry ratios that we discussed yesterday. The only draw back about this setup is that the NFP tanks are underperforming stock tanks of the same size in terms of volume. // Adds InterstellarFuelSwitch to LFO and LH2 tanks // 5.5*total LFO // LF/O tanks @PART [*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LF = #$RESOURCE[LiquidFuel]/maxAmount$ %OX = #$RESOURCE[Oxidizer]/maxAmount$ %totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ @totalCap += #$RESOURCE[Oxidizer]/maxAmount$ %mixOX = #$totalCap$ @mixOX /= 2 %mixLH2 = #$mixOX$ @mixLH2 *= 10 %onlyLH2 = #$mixLH2$ @onlyLH2 *= 2 %tempVar = 0 %dryCost = 0 // masses %mixLH2mass = #$mass$ @mixLH2mass *= 0.9 %onlyLH2mass = #$mass$ @onlyLH2mass *= 0.85 MODULE { name = InterstellarFuelSwitch resourceGui = LF/OX;LH2/OX;LF;OX;LH2 resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$ } !RESOURCE[LiquidFuel] {} !RESOURCE[Oxidizer] {} } // Pure LH2 tanks @PART [*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$ %mixLH2 = #$LH2$ @mixLH2 /= 2 %mixOX = #$mixLH2$ @mixOX *= 0.1 %OX = #$mixOX$ @OX *= 2 // masses %LH2mass = #$LH2$ @LH2mass *= 0.000035425 //A Cryo tank is 3.20 times lighter than an equivalent stock tank %mixLH2mass = #$LH2mass$ @mixLH2mass *= 1.1 %onlyOXmass = #$LH2mass$ @onlyOXmass *= 1.5 MODULE { name = InterstellarFuelSwitch resourceGui = LH2;LH2/OX;OX resourceNames = LqdHydrogen;LqdHydrogen,Oxidizer;Oxidizer resourceAmounts = #$../LH2$;$../mixLH2$,$../mixOX$;$../OX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../LH2mass$;$../mixLH2mass$,$../onlyOXmass$ } !RESOURCE[LqdHydrogen] {} } Both patches have been cleaned up of unused variables and outdated parameters. Nertea, if you are still following this thread, what are your ideas about all this? We can be sitting here spinning our wheels all weekend long, but ultimately you are the one calling the shots.
  4. 1) It works, but I wouldn't use it in career. There are still some quirks with contracts and balance in general (especially for money). I would recommend to play it in sandbox. This mod is a lot of fun. 2) Get mods that have more powerful engines (like cryogenic engines and HGR 1.875m parts) and get KER if you don't have it already. Be prepared build giant rockets that have real world dimensions. Don't be afraid of very tall rockets, just add tanks until you have just enough TWR to lift-off (~1.3 atmospheric TWR works best for me). If you are short of delta v, add tanks/stages until you reach your desired delta v budget then add boosters to reach 1.3 launch TWR. Remember to use boosters for TWR and not delta v. Launch and do a gravity turn. Everything else should work like stock. Edit: TRW is actually TWR (Thrust-to-Weight ratio). Sorry for anyone confused. I always have problem with the letter order in acronyms. Thank you monstah for pointing it out.
  5. But that was homework. Anyhow, there is an error on how the original patch solves the problem. Basically, it does not take in consideration that oxidiser is measured in Fuel Units instead of liters. Currently, the calculations divide the tank volume in liters into 11 parts (from the 1:10 burn ratio). 10 parts are taken up by liquid hydrogen and the remaining 1 part is oxidizer. This would be ok when oxidizer is measured in liters, and not in fuel units. When you take the 1 part for oxidizer, you are magically fitting 5.5 times as much oxidizer per volume (remember that oxidizer is 5.5 liters per unit) in that 1/11 fraction of tank. A formal proof would be the following: Let's assume that a tank T has total capacity V, measured in Fuel Units (1 FL = 5.5 Liters). Let's then call VL the total volume of the tank in liters. By definition: VL = 5.5 V Tank T should hold VL liters of Liquid Hydrogen when converted to LH2. To find out the mix fuel fraction, the IFS script currently performs the following operations: VLH2 = VL /1.1 VOX = VL - VLH2 Substituting for VL and VLH2 in the equation for VOX gives us: VOX = 5.5 V - (5.5 V)/1.1 = 5.5 V - 5 V = 0.5 V Which gives us that the total volume of oxidizer in a mixed LH+OX tank will always be 1/2 of the original tank. Q.E.D. The problem with the proof is that it assumes that VLH2 and VOX have the same units of measure when calculating the mix tank ratio. Cryo engines have been balanced with this basic assumption and Nertea seems not to be interested in changing it (and I understand it. Changing the LH2/OX ratios in the mixed tank will throw off the balance for cryo engines big time. All this conversation is really just for converted engines that use just use LH2 or balance NFT tanks in their mixed configuration, which we already agree that is way off). If we assume that these calculations for the mix LH2+OX are intended, we take this the next logical step to assume that a tank filled with only with LH2 has double the amount of LH2 in a mix tank. After all, LH2 occupies 1/2 of a mixed tank, so why shouldn't be possible to fill a LH2 only tank with double that amount? If we assume that the calculations are incorrect and we want to keep the volume in liters constant between the different tank setups, then we need to change the calculations to keep the same unit of measure during the calculations and then convert one of the two quantities to its unit of measure (in italics in the formulas). The calculations in fuel units would be the following. Burn fraction between OX and LH2 is 1 FU:10L, which is equivalent to 1 FU:1.8181 FU. The tank has to be divided in 2.81 parts (1 part of oxidizer and 1.8181 parts of LH2). The rest of the volume is occupied by LH2, which is converted to liters. VOX= V /(10/5.5+1) * 1 VLH2= V / (10/5.5 + 1) * 10 * 5.5 The same calculations can be done keeping all the volumes in liters. Burn fraction between OX and LH2 is 1 FU:10L, which is equivalent to 5.5L:10L, which simplified to a unit ratio equals 1L;1.8181L, giving us the same results as the ratio above. If you want to carry out the conversion in liters, you can use these equations: VLH2 = VL / (5.5+10) * 10 VOX = VL / (5.5+10) * 5.5 / 5.5 Exercise: Calculate the correct volumetric fraction of LH2 and OX for a tank that has volume 800 Fuel Units. [TABLE=width: 1000] [TR] [TD]All calculations in Fuel Units[/TD] [TD]All calculations in Liters[/TD] [/TR] [TR] [TD]VOX = 800 / (10/5.5 + 1) * 1 = 283.87 FU VLH2 = 800 / (10/5.5 + 1) * 10/5.5 = 516.12 FU = 2838.7096 L Which occupies a total of 283.87 FU + 516.12 FU = 799.9999 FU. (I know, rounding sucks).[/TD] [TD]The thank holds 800*5.5 = 4400 L VLH2 = 4400 / (5.5+10) * 10 = 2838.7096 L VOX = 4400 / (5.5+10) * 5.5 = 1561.29 L = 283.87 FU Which occupies a total volume of 2838.7096L +1561.29L = 4399.9999 L = 799.999 FU. (I know, rounding sucks).[/TD] [/TR] [/TABLE] You can see from the numbers that the original calculation ends up fitting 1.4 times as much oxidizer in a mixed tank as it is supposed to do. (283.87 FU vs. 400 FU). I brought this up in the cryo engines thread and I think that Nertea added the 1.4 fudge factor to LH2 only tanks for that reason. From the patch notes: Edit: Totally agree. I figured it out after I did the patch for LqdOxygen. The only difference is that it is easier to calculate the tank fractions if the fuel and oxidized use the same units. As I said before, I am happy burning stock oxidizer. We just have to agree on the tank volume ratios and balance everything from there. My vote is for just keeping the bugged calculation for LH2+OX and double the amount of LH2 for a LH2-only tank. It keeps it easy even if we end up with tanks holding more than they should.
  6. Yeah. You are right. I should have said something like stock Liquid Fuel+Oxidizer is Aerozine 50. The bottom line is that stock oxidizer is not liquid oxygen but rather something like dinitrogen tetroxide as you said. That's a decision that only Nertea can make. But I want you to know that I totally agree with you about using Liquid Oxygen. It would make the conversions and balancing so much easier. Edit: For anyone interested in taking a look at cryo engines running liquid oxygen instead of stock oxidizer, this is a quick and dirty patch for it: // Convert any engine that runs on LH to use Liquid Oxygen. @PART [*]:HAS[@MODULE[ModuleEngine*]:HAS[@PROPELLANT[LqdHydrogen],@PROPELLANT[Oxidizer]]]:LAST { @MODULE[ModuleEngine*]{ @PROPELLANT[LqdHydrogen] { @ratio = 4 // Real fuels has 76.30830964721619 } @PROPELLANT[Oxidizer] { @name = LqdOxygen @ratio = 1 } } } // Adds InterstellarFuelSwitch to LFO and LH2 tanks // 5.5*total LFO // LF/O tanks @PART [*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LF = #$RESOURCE[LiquidFuel]/maxAmount$ %OX = #$RESOURCE[Oxidizer]/maxAmount$ %totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ @totalCap += #$RESOURCE[Oxidizer]/maxAmount$ %onlyLH2 = #$totalCap$ @onlyLH2 *= 5.5 %onlyLOX = #$totalCap$ @onlyLOX *= 5.5 %mixLH2 = #$onlyLH2$ @mixLH2 *= 0.8 %mixLOX = #$onlyLOX$ @mixLOX *= 0.2 // masses %mixLH2mass = #$mass$ @mixLH2mass *= 0.9 %onlyLH2mass = #$mass$ @onlyLH2mass *= 0.85 MODULE { name = InterstellarFuelSwitch volumeMultiplier = 1 massMultiplier = 1 resourceGui = LF/OX;LH2/OX;LF;OX;LH2 resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,LqdOxygen;LiquidFuel;Oxidizer;LqdHydrogen;LqdOxygen resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixLOX$;$../totalCap$;$../totalCap$;$../onlyLH2$;$../onlyLOX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$;$../onlyLH2mass$ } !RESOURCE[LiquidFuel] {} !RESOURCE[Oxidizer] {} } // Pure LH2 tanks @PART [*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$ %LOX = #$RESOURCE[LqdHydrogen]/maxAmount$ %mixLH2 = #$LH2$ @mixLH2 *= 0.8 %mixLOX = #$LOX$ @mixLOX *= 0.2 MODULE { name = InterstellarFuelSwitch volumeMultiplier = 1 massMultiplier = 1 resourceGui = LH2;LH2/OX;OX resourceNames = LqdHydrogen;LqdHydrogen,LqdOxygen;LqdOxygen resourceAmounts = #$../LH2$;$../mixLH2$,$../mixLOX$;$../LOX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mass$;$../mass$ } !RESOURCE[LqdHydrogen] {} }
  7. Wait! Does the corvus nose cone dock with a regular Jr. docking port?
  8. What do you think about this changes: // Adds InterstellarFuelSwitch to LFO and LH2 tanks // 5.5*total LFO // LF/O tanks @PART [*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LF = #$RESOURCE[LiquidFuel]/maxAmount$ %OX = #$RESOURCE[Oxidizer]/maxAmount$ %totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ @totalCap += #$RESOURCE[Oxidizer]/maxAmount$ %mixOX = #$totalCap$ @mixOX /= 2 %mixLH2 = #$mixOX$ @mixLH2 *= 10 %onlyLH2 = #$mixLH2$ @onlyLH2 *= 2 %tempVar = 0 %dryCost = 0 @dryCost = #$cost$ %LFCost = 0 %OXCost = 0 %LH2Cost = 0 %mixLH2Cost = 0 %mixLFCost = 0 // compute cost of stock tank fuel @tempVar = #$RESOURCE[LiquidFuel]/maxAmount$ @tempVar *= 0.8 @mixLFCost += #$tempVar$ @tempVar = #$RESOURCE[Oxidizer]/maxAmount$ @tempVar *= 0.18 @mixLFCost += #$tempVar$ @dryCost -= #$mixLFCost$ @cost -= #$mixLFCost$ // Cost LF only @tempVar = #$totalCap$ @tempVar *= 0.8 @LFCost += #$tempVar$ // Cost OX only @tempVar = #$totalCap$ @tempVar *= 0.18 @OXCost += #$tempVar$ // Cost LH2 only @tempVar = #$onlyLH2$ @tempVar *= 0.03675 @LH2Cost += #$tempVar$ // Cost mix @tempVar = #$mixLH2$ @tempVar *= 0.03675 @mixLH2Cost += #$tempVar$ @tempVar = #$mixOX$ @tempVar *= 0.18 @mixLH2Cost += #$tempVar$ @tempVar = 0 // masses %mixLH2mass = #$mass$ @mixLH2mass *= 0.9 %onlyLH2mass = #$mass$ @onlyLH2mass *= 0.85 MODULE { name = InterstellarFuelSwitch volumeMultiplier = 1 massMultiplier = 1 resourceGui = LF/OX;LH2/OX;LF;OX;LH2 resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$ //tankCost = #$../mixLFCost$;$../mixLH2Cost$;$../LFCost$;$../OXCost$;$../LH2Cost$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$ } !RESOURCE[LiquidFuel] {} !RESOURCE[Oxidizer] {} } // Pure LH2 tanks @PART [*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$ %mixLH2 = #$LH2$ @mixLH2 /= 2 %mixOX = #$mixLH2$ @mixOX *= 0.1 %OX = #$mixOX$ @OX *= 2 // masses %LH2mass = #$LH2$ @LH2mass *= 0.000035425 //A Cryo tank is 3.20 times lighter than an equivalent stock tank %mixLH2mass = #$LH2mass$ @mixLH2mass *= 1.1 %onlyOXmass = #$LH2mass$ @onlyOXmass *= 1.5 MODULE { name = InterstellarFuelSwitch volumeMultiplier = 1 massMultiplier = 1 resourceGui = LH2;LH2/OX;OX resourceNames = LqdHydrogen;LqdHydrogen,Oxidizer;Oxidizer resourceAmounts = #$../LH2$;$../mixLH2$,$../mixOX$;$../OX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../LH2mass$;$../mixLH2mass$,$../onlyOXmass$ } !RESOURCE[LqdHydrogen] {} } I left the stock mass adjustments as they were in the original IFS patch. The additional LH in the stock tanks makes them too good already. The weight ratios are LF+OX 1:9, LH+OX 1:6.07, and LH 1:2.3. For the cryo tanks, the weight is calculated based on the total LH volume (so, like stock tanks are 0.000625*volume, cryo tanks are 0.000035425*volume - once you take in consideration that LH is measured in liters, the weight for a NFP tank is about 3.20 times lighter than a stock tank.) Weight for a LH+OX tank is increased by 1.1 times and weight for an OX tank is increased by 1.5 times. Wet/dry ratios are LH 1:3, LH+OX 1:8.23, and OX only 1:10. The only draw back about this scheme is that cryo tanks currently hold less LH as their stock counterparts of the same size. I think that it has to do with the balance that Nertea put in the original release of the mod (which was LH is 1.4 times the tank volume, and not 2 times the tank's volume as proposed by this patch). On the other hand, one cryo tank weighs the about same as stock tank double its size and holds about 1.5 times the amount of fuel. So, you still get more delta v for the same amount of fuel, so we could say that that balances out the cryo vs. stock tanks. I haven't spent enough time trying various configurations between tanks and engines to see if all of this is still balanced with cryogenic and atomic engines. Let me know what you think about it.
  9. You know what? I was grilling some chicken for dinner and I had an epiphany. We want to keep the balance as close to stock feel as possible. Why? Because if I wanted to play with realistic weight and ratios and stuff I would be playing RSS+RO. Now, what does this mean for our little calculations? I present to you the "LOL so Kerbal" patch for Near Future Propulsion! // Adds InterstellarFuelSwitch to LFO and LH2 tanks // 5.5*total LFO // LF/O tanks @PART [*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LF = #$RESOURCE[LiquidFuel]/maxAmount$ %OX = #$RESOURCE[Oxidizer]/maxAmount$ %totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ @totalCap += #$RESOURCE[Oxidizer]/maxAmount$ %mixLH2 = #$totalCap$ @mixLH2 /= 1.1 %mixOX = #$totalCap$ @mixOX -= #$mixLH2$ %onlyLH2 = #$mixLH2$ @onlyLH2 *= 2 %tempVar = 0 %dryCost = 0 @dryCost = #$cost$ %LFCost = 0 %OXCost = 0 %LH2Cost = 0 %mixLH2Cost = 0 %mixLFCost = 0 // compute cost of stock tank fuel @tempVar = #$RESOURCE[LiquidFuel]/maxAmount$ @tempVar *= 0.8 @mixLFCost += #$tempVar$ @tempVar = #$RESOURCE[Oxidizer]/maxAmount$ @tempVar *= 0.18 @mixLFCost += #$tempVar$ @dryCost -= #$mixLFCost$ @cost -= #$mixLFCost$ // Cost LF only @tempVar = #$totalCap$ @tempVar *= 0.8 @LFCost += #$tempVar$ // Cost OX only @tempVar = #$totalCap$ @tempVar *= 0.18 @OXCost += #$tempVar$ // Cost LH2 only @tempVar = #$onlyLH2$ @tempVar *= 0.03675 @LH2Cost += #$tempVar$ // Cost mix @tempVar = #$mixLH2$ @tempVar *= 0.03675 @mixLH2Cost += #$tempVar$ @tempVar = #$mixOX$ @tempVar *= 0.18 @mixLH2Cost += #$tempVar$ @tempVar = 0 // masses %mixLH2mass = #$mass$ @mixLH2mass *= 0.9 %onlyLH2mass = #$mass$ @onlyLH2mass *= 0.85 MODULE { name = InterstellarFuelSwitch volumeMultiplier = 1 massMultiplier = 1 resourceGui = LF/OX;LH2/OX;LF;OX;LH2 resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$ //tankCost = #$../mixLFCost$;$../mixLH2Cost$;$../LFCost$;$../OXCost$;$../LH2Cost$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$ } !RESOURCE[LiquidFuel] {} !RESOURCE[Oxidizer] {} } // Pure LH2 tanks @PART [*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$ %mixLH2 = #$LH2$ @mixLH2 /= 2 %mixOX = #$mixLH2$ @mixOX *= 0.1 %OX = #$mixOX$ @OX *= 2 MODULE { name = InterstellarFuelSwitch volumeMultiplier = 1 massMultiplier = 1 resourceGui = LH2;LH2/OX;OX resourceNames = LqdHydrogen;LqdHydrogen,Oxidizer;Oxidizer resourceAmounts = #$../LH2$;$../mixLH2$,$../mixOX$;$../OX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mass$;$../mass$ } !RESOURCE[LqdHydrogen] {} } This is the basic assumption: the mixed LH+OX tank just works out to always have half of its volume in oxidizer (it's left to the reader to work out the formal proof. Hint: each unit of fuel is 5.5 liters and the burn ratio of a cryo engine is 1:10). The cryo engine pack has been balanced with this tank configuration in mind so let's not mess with it. Then it just hit me, if half of the tank is oxidizer, the other half must be liquid hydrogen. If this is true, we can just double the amount of liquid hydrogen in a mixed tank to find out the amount of hydrogen in a LH only tank (we decided not to consider any volume lost to the intertank right?). If we work the problem backwards, we can just find the correct amounts for LH+OX and OX only for the NFP tanks. This would fix the volume issue and balance the fuel issue (for example, two mixed tanks will give you the same amount of fuel as 1 tank of fuel and 1 tank of oxidizer, with the exception of LF and OX combos, because of the stock 4:5 burn ratio but this is really not an issue). Now we just have to fix the dry tank weight issue and we are golden! As a side effect of this change, now all the cryo tanks underperform the stock tanks that have the same size. Is that how it was from the beginning? If not, we might just have to match the amount of liquid hydrogen for the cryo tanks to at least match their stock counterparts.
  10. As far as I can find using google/wikipedia, these are some dry/wet ratios for real world tanks: Apollo Stage II (stock LH+OX) 1:10, Shuttle External Tank (NFP LH+OX) 1:28, Titan II Stage I (A-50, which should be stock's LF+OX) 1:27. If we take stock 1:9 dry/wet ratio for tanks as benchmark, that gives us the following ratios: LF+OX 1:9, LH+OX - stock tanks 1:3, LH+OX - NFP tanks 1:9. Basically, stock tanks converted to LH+OX should have a dry/wet ratio of 1:3, cryo tanks should be able to have a similar ratio than stock LF+OX tanks. I don't know what to do with stock LH-only tanks and NFP OX-only tanks. This is what we should change: [TABLE=class: grid, width: 500] [TR] [TD=align: center]Tank Setup[/TD] [TD=align: center]Current Dry/Wet Ratio[/TD] [TD=align: center]Target Dry/Wet Ratio[/TD] [TD=align: center]To do[/TD] [/TR] [TR] [TD]Stock LH+OX[/TD] [TD=align: center]1:6.07[/TD] [TD=align: center]1:3[/TD] [TD=align: center]Decrease fuel[/TD] [/TR] [TR] [TD]Stock LH Only[/TD] [TD=align: center]1:2.09[/TD] [TD=align: center]1:3 (?)[/TD] [TD=align: center]Increase fuel and decrease mass[/TD] [/TR] [TR] [TD]NFP LH Only[/TD] [TD=align: center]Variable between 1:2.5 and 1:3[/TD] [TD=align: center]1:9 (?)[/TD] [TD=align: center]Decrease weight[/TD] [/TR] [TR] [TD]NFP LH+OX[/TD] [TD=align: center]Variable between 1:12 and 1:15[/TD] [TD=align: center]1:9[/TD] [TD=align: center]Decrease fuel[/TD] [/TR] [TR] [TD]NFP OX Only[/TD] [TD=align: center]Variable between 1:14 and 1:18[/TD] [TD=align: center]1:9[/TD] [TD=align: center]Decrease fuel[/TD] [/TR] [/TABLE] We can do this by tweaking the amount of fuel in each tank and at the same time changing the tank dry mass to get the target dry/wet ratio.
  11. That's another problem and (per OP) it's one of the off-the-table issues. Nertea just wanted to add one resource (Liquid Hydrogen) and use the stock oxidizer. The cryo engines have been balanced to burn stock oxidizer (10:1, which is equivalent to a burn rate of 1.18:1 in fuel units or liters, and 1:7.05 by weight). As you know, the problem is that stock oxidizer is not liquid oxygen but probably something like Aerozine 45(does something like that even exist?) based on its density. I don't even know where we will end up if we go down this road. I am happy with the current cryo engines pack. It feels right with the other stock parts without going all crazy with realism. For this reason, I suggested a burn ratio of 16:1 for cryo engines over at the cryo engine thread. That would take the burn rate by weight to about 1:4.41 and would balance the tanks a little better.
  12. That's what I was thinking. We can keep volume somewhat constant between the different setups. The current patch for stock tanks has the following volume calculations: [TABLE=class: grid, width: 500] [TR] [TD][/TD] [TD]Stock LF+OX[/TD] [TD]LF or OX[/TD] [TD]LH + OX[/TD] [TD]LH Only[/TD] [/TR] [TR] [TD]LF+OX as reference[/TD] [TD]1[/TD] [TD]1[/TD] [TD]Not constant but it's about 1.4[/TD] [TD]1.4[/TD] [/TR] [TR] [TD]LH only as reference[/TD] [TD]0.71[/TD] [TD]0.71[/TD] [TD]1[/TD] [TD]1[/TD] [/TR] [/TABLE] The NFP cryo tanks have the following volume capacities: [TABLE=class: grid, width: 500] [TR] [TD]LH[/TD] [TD]LH and OX[/TD] [TD]OX Only[/TD] [/TR] [TR] [TD]1[/TD] [TD] 1.41 [/TD] [TD] 3.7 [/TD] [/TR] [/TABLE] You can notice the error there. Instead having mixed cryo tanks holding less fuel, they end up holding almost 3 times what they should have. That is caused by the way that the oxidizer fraction is calculated by the current fuel switch code. In short, it calculates the fraction of the tank that LH should take based on the current LH+OX burn ratio (10:1). Then, OX is added to the rest of the tank. What the script does not take in consideration is that LH is measured in liters while oxidizer is measured in fuel units. This magically fits 5.5 times as much oxidizer as it should have. My suggestion would be calculate the fraction of oxidizer that you need then fill the rest of the tank with liquid hydrogen, carrying out all calculations in fuel units and converting the LH to liters at the end. If we decide to have keep the volumes consistent between the different setups (I kinda like the 1:1.4:1.4 ratio that Nertea is using for the stock tanks), we definitely have to take a look at the tanks dry mass. The problem with the dry mass is very clear when you use atomic rockets converted to burn LH. The problem is that LH is 71 times less dense than LF. That results in the engines consuming 71 times the weight of fuel (my knowledge of rocketry is quite limited, but it has something to do with having to keep a constant exhaust velocity for a given ISP. This thread has more on the problem. It basically comes down to this formula: fuel rate in L/s = Thrust / ((density) * g * Isp). Nertea already took care of the atomic engines ISP in the extra patch in NFP, so this should be a huge problem). This plus the very low wet/dry tank weight ratio for LH only tanks makes atomic rockets basically unusable (thanks to the Rocket Equation). To summarize the problem, first we should fix the volume problem with cryo tanks. Then, we can start balancing the dry weight of the tanks based on engine performance and what not.
  13. We need to have a way to compare the different tanks that is constant (or close to constant) between the different tank setups if we want to balance them. We have volume (either in liters or fuel units - it's really the same) or fuel to tank mass ratio (wet/dry ratio). These two quantities only depend on the tank setup (I am curious if there is another way to compare the different tank setups). We could also use total delta v from a tank+engine setup. However, we will have too many variables to control (most notably, engine ISP, engine weight, and payload). I will add another sheet with the delta v calculations to the spreadsheet later today or tomorrow. We know that stock tanks have all constant volume (based on size), mass (0.000625 times the volume), and wet/dry ratio (always 8). So this is our baseline. Right now, stock fuel switched tanks to liquid hydrogen and oxidizer hold about 1.4 times more fuel units and the liquid hydrogen only tanks hold exactly 1.4 times more fuel units. If we consider the wet/dry ratio, liquid hydrogen tanks are always 1.09. The mixed tanks' wet/dry ratios are all over the place because of how the fuel fraction is calculated (it does not keep volume or wet/dry ratio constant between tanks). For example, this patch would keep the volume constant for LH+OX setups. If we don't want to touch the fuel volume, we can always play around with the tank weight (probably easier and faster). In this way, we can keep the current fuel quantities in the tanks but we will change the wet/dry ratios. For example, if we agree to have a wet/dry ratio of 2 for LH+OX tanks, we can adjust the tank weight accordingly.
  14. Tank you (get it? ) cap. Sierra for the data. I have this spreadsheet to calculate some data about the tanks. Let me know if you guys want help out with the numbers. The first thing that I noticed is that the fuel switch patch for Liquid Hydrogen only tanks has a logical error in calculating the quantities for the mixed tank. Right now, it takes the total volume in liters for the tank, it finds how much liquid hydrogen it needs for the fuel mix (1:10), then it fills the rest of the tank with oxidizer. This would work fine if the liquid hydrogen and oxidizer had the same units of measure. Unfortunately, oxidizer is measured in fuel units (which are 5.5 liters). As of right now, a LH tank converted to OX only holds 3.6 times more volume in fuel units (even after the 1.5 rescale factor is applied). A mixed LH+OX tank holds 1.4 times more volume in fuel units. In theory, the total volume available for a mixed tank should decrease as some space is taken up by the intertank. If we want to keep the NF tanks in line with the stock fuel-switched tanks, we modify the fudge factors for OX only tanks to 3 (from the current 1.5). This will give us a wet/dry weight ratio of about 8 (down from the current 16). A fudge factor of 2 for the LH+OX tanks will give a wet/dry ratio of about 7 (currently this is about 14). The new code for the fuel switch with the new volume fudge factors could be this: // Pure LH2 tanks @PART [*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels] { %LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$ %mixLH2 = #$LH2$ @mixLH2 /= 2 // New volume factor @mixLH2 /= 1.1 %mixOX = #$LH2$ @mixOX -= #$mixLH2$ %OX = #$LH2$ @OX /= 3 // Updated volume factor @OX /= 5.5 MODULE { name = InterstellarFuelSwitch volumeMultiplier = 1 massMultiplier = 1 resourceGui = LH2;LH2/OX;OX resourceNames = LqdHydrogen;LqdHydrogen,Oxidizer;Oxidizer resourceAmounts = #$../LH2$;$../mixLH2$,$../mixOX$;$../OX$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = 0 tankMass = #$../mass$;$../mass$;$../mass$ } !RESOURCE[LqdHydrogen] {} }
  15. The engines with tankbutts should all have two attachment nodes. The second (lower) node will not add the tankbutt.
  16. I just noticed that there is a logic error in the Interstellar Fuel Switch MM patch. Background: I have re-read the previous conversation about tanks 3 times and this is what I got from it: Liquid Fuel and Oxidizer are measured in Fuel Units. Community Resource Pack's resources (like Liquid Hydrogen) are measured in liters. It is commonly accepted that the conversion rate between Fuel Units and Liters is 1:5.5. Findings: The current IFS patch calculates the following values for a tank that holds 800 FU: - 360 LF +400 OX = 800 Fuel Units - 800 LF - 800 OX - 4400 LH2 = 800 Fuel Units - 4000 LH2 + 400 OX = 727 Fuel Units of LH2 + 400 Fuel Units of OX = 1127 total fuel units in the tank (which is 140% of the tank volume) Solution: When we solve the proportion between LH2 and OX, we should use Fuel Units rather than Liters. This code is a drop-in fix for the problem: // Adds InterstellarFuelSwitch to stock tanks // 5.5*total LFO @PART [*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!RESOURCE[MonoPropellant],!MODULE[InterstellarFuelSwitch]] { %LF = #$RESOURCE[LiquidFuel]/maxAmount$ %OX = #$RESOURCE[Oxidizer]/maxAmount$ %totalCap = #$RESOURCE[LiquidFuel]/maxAmount$ @totalCap += #$RESOURCE[Oxidizer]/maxAmount$ %onlyLH2 = #$totalCap$ @onlyLH2 *= 5.5 // CRP resources are measured in liters. 1 fuel unit = 5.5 L %LH2toOXratio = 10 // 1 fuel unit of OX to 10 liters of LH2 @LH2toOXratio /= 5.5 // Convert LH2 to fuel units @LH2toOXratio += 1 // 100% bar (1 fuel unit of OX + 10/5.5 fuel units of LH2) %mixOX = #$totalCap$ // Start with a tank full of OX @mixOX /= #$LH2toOXratio$ // Find the correct percentage OX %mixLH2 = #$totalCap$ // Use the total tank capacity @mixLH2 -= #$mixOX$ // LH2 will fill the rest of the tank @mixLH2 *= 5.5 // Convert LH2 to liters %tempVar = 0 %dryCost = 0 @dryCost = #$cost$ %LFCost = 0 %OXCost = 0 %LH2Cost = 0 %mixLH2Cost = 0 %mixLFCost = 0 // compute cost of stock tank fuel @tempVar = #$RESOURCE[LiquidFuel]/maxAmount$ @tempVar *= 0.8 @mixLFCost += #$tempVar$ @tempVar = #$RESOURCE[Oxidizer]/maxAmount$ @tempVar *= 0.18 @mixLFCost += #$tempVar$ @dryCost -= #$mixLFCost$ @cost -= #$mixLFCost$ // Cost LF only @tempVar = #$totalCap$ @tempVar *= 0.8 @LFCost += #$tempVar$ // Cost OX only @tempVar = #$totalCap$ @tempVar *= 0.18 @OXCost += #$tempVar$ // Cost LH2 only @tempVar = #$onlyLH2$ @tempVar *= 0.03675 @LH2Cost += #$tempVar$ // Cost mix @tempVar = #$mixLH2$ @tempVar *= 0.03675 @mixLH2Cost += #$tempVar$ @tempVar = #$mixOX$ @tempVar *= 0.18 @mixLH2Cost += #$tempVar$ @tempVar = 0 MODULE { name = InterstellarFuelSwitch resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$ tankCost = #$../mixLFCost$;$../mixLH2Cost$;$../LFCost$;$../OXCost$;$../LH2Cost$ displayCurrentTankCost = true hasGUI = true showInfo = true availableInFlight = false availableInEditor = true basePartMass = #$../mass$ tankMass = 0;0;0;0;0 } !RESOURCE[LiquidFuel] {} !RESOURCE[Oxidizer] {} } Conclusion: I do not know how this change will affect gameplay and balance. I just did the math so the tank has constant volume when we switch between fuels. On a related note, currently cryo engine burn at a ratio of 1 fuel unit of oxidizer to 10 liters of LH2, which equals to 1 fuel unit of OX to 1.18181818 fuel units of LH2. Cryogenic engines usually have a volumetric burn ratio of approximately 1:3 (source: total volume of OX:LH2 in the Saturn V Second and Third stages). Cryo engines should be updated to burn 1 Liter of LH2 to 0.0625 Fuel Units of OX, which equals to 1 Unit of OX to 16 Liters of LH2 or 1 Unit of OX to 2.90 Fuel Units of LH2. Let me know what you think about this and if you spot any errors in my math!
  17. @Crzyrndm: I use Pilot Assistant. But I like PID tuner better because of its simpler UI. BTW, your SAS tuning fix plugin gave me the inspiration for wanting RSAS values added to PID tuner, so thank you!! @regex: here is a patch that adds the relative SAS information to the UI and uses the new RSAS module to load and save the current PID values. What is the best way to send it your way? I was not able to find your mods on GitHub for a pull request, so I just used the source code bundled in the download. I was able to compile and use the plugin without major issues, and only one minor issue: the RSAS module seems not to have a clang value. I set it to 1 and then I divide the ki, kp, kd terms before saving. I also had to use floats in the PIDInput class. Somewhere in the code there was a typecasting error and all RSAS values had rounding errors.
  18. Regex, how likely is it for PID tuner to support RSAS alongside regular SAS stability assist? Usually, RSAS (the autopilot module) is the one that has the most problems.
  19. Ah! That explains it. I was trying to figure out the values with Kerbal Engineer and I was getting frustrated. Sorry if it sounded whiny. For example, build a rocket with a MK 1 pod, 2 FL-T800 tanks, and an LV-T45 engine. KER will tell you that it has 3836 m/s of vacuum delta v with a TRW of 1.80 or 3237 m/s of delta v at sea level with a TRW of 1.52. When you put the rocket on the launchpad, KER simulates it to have 3244 m/s of delta v available with a current TRW of 1.52. If you used the "Amount of Delta-V Expended" for the map that explains why the rocket was not getting in orbit even if it should have more than enough vacuum delta v. BTW, that rocket should be able to get in orbit no matter how you flight it because it does not have enough TRW to be efficient. I saw the video but I do not think that that is an example for a common launch, but more as a proof of concept. Thank you for the clarification! The map makes much more sense now.
  20. This is probably OT, but how do you guys get in orbit from Kerbin with 3300 m/s of delta v? Is it vacuum dv or dv on launchpad? As a (probably) mediocre KSP player, the delta v maps really help me a lot in designing my missions (and I prefer this subway map to the other one with the straight lines). And yes, I have read the disclaimer about ascent profiles and fairing use. Doing consistently worse than the suggested delta v budget feels like against the principle of having a delta v map to begin with. For example, a Mun rocket is supposed to have 5050 m/s of delta v, but then do I need to add 1000 m/s to it because I am not a good player? Wouldn't it be better to include an upper estimate for atmospheric delta v with the understanding that better players are able to calculate how much they can save rather than expecting new players to figure out how much delta v they need to pack over the recommended amount?
  21. I just fixed the links. CKAN should update them briefly. Sorry for the inconvenience. Regarding HGR Props, CKAN cannot overwrite any file in GameData - it' has been its policy from the very beginning of the project. If mods share assets, they need to be indexed separately (for example, USI tools contains all the files shared by all USI mods). Since the props are shared between the 1.875m parts pack and the Corvus pack, I had to create this new package for it.
  22. Great! They should be available for download through CKAN by tomorrow if everything goes smoothly.
  23. Orionkermin: I have the config files for CKAN ready but I want to check in with you before I submit them. Are you ok with CKAN indexing your mod?
  24. The CKAN people prefer to have the mods listed on kerbarlstuff because they can auto update the CKAN listing automatically whenever there is an update. If the mod is listed somewhere else, they need to update the CKAN file by hand every time there is a release. I'll be happy to put together a CKAN file for HGR while it is listed on curse, with the idea that we will update it once you are ready to release it on kerbalstuff. On a related note, is the HRG folder the same between HRG redux and Corvus?
  25. The pull request has been put on ice because of the HGR dependency.
×
×
  • Create New...