Jump to content

MrSystems

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by MrSystems

  1. If anyone wants to try this at home, I suggest the following two modifications to the code I posted above: The default settings for B9PartSwitch add additional mass and cost to parts based on their volume, but the stock part configs already account for this. With the default B9 configs, a Rockomax X200-16 ends up with a wet mass of 9.4t and a wet cost of $2,674.40 instead of the stock stats of 9.0t and $1,550. So, 1) add this to the top of the file: B9_TANK_TYPE{ name=stockLFO tankMass=0 // this adds to part mass, which is why it was heavier with default configs tankCost=0 // this adds to part cost, which is why it was more expensive with default configs RESOURCE { name = LiquidFuel unitsPerVolume = 0.55 } RESOURCE { name = Oxidizer unitsPerVolume = 0.45 } B9_TANK_TYPE{ name=stockLF tankMass=0 tankCost=0 RESOURCE { name = LiquidFuel unitsPerVolume = 1 } } And 2) in each of the SUBTYPE calls below, change `tankType = LF` to `tankType = stockLF` and `tankType = LFO` to `tankType = stockLFO`. This way it won't break the stats on the stock parts or any mods you're running.
  2. I got it to work, but I don't why it works when the other method didn't. I'm sure it has something to do with type conversion in C#. Any explanation would be appreciated. Full .cfg is reproduced below, should anyone want to use it themselves. //// Allows switching between LFO and LF-only for all stock, Making History, and Missing History fuel tanks //// Requires B9PartSwitch //// (c) 2019 by Chad Tucker under the MIT Licence // stock parts of type LFO // note: Size3To2Adapter_v2 is a version 1.6 part @PART[fuelTankSmallFlat|fuelTankSmall|fuelTank|fuelTank_long|Rockomax8BW|Rockomax16_BW|Rockomax32_BW| Rockomax64_BW|Size3SmallTank|Size3MediumTank|Size3LargeTank|fuelTank3-2|miniFuelTank|toroidalFuelTank| fuelTank4-2|fuelTank2-2|fuelTank1-2|adapterMk3-Mk2|adapterMk3-Size2Slant|adapterSize2-Mk2|adapterSize2- Size1|adapterSize2-Size1Slant|adapterSize3-Mk3|toroidalFuelTank|externalTankCapsule|externalTankRound| externalTankToroid|mk2_1m_Bicoupler|mk2_1m_AdapterLong|mk2SpacePlaneAdapter|Size3To2Adapter_v2]:AFTER [B9PartSwitch] { MODULE { name=ModuleB9PartSwitch moduleID=fuelSwitch baseVolume = #$/RESOURCE[LiquidFuel]/amount$ @baseVolume += #$/RESOURCE[Oxidizer]/amount$ switcherDescription = Fuel Type switcherDescriptionPlural = Fuel Types switchInFlight = FALSE SUBTYPE { name = LF/Ox tankType = LFO allowSwitchInFlight = FALSE } SUBTYPE { name = Liquid Fuel tankType = LF allowSwitchInFlight = FALSE } } } // stock parts of type LF-only (could add spaceplane parts if desired) @PART[miniFuselage]:AFTER[B9PartSwitch] { MODULE { name=ModuleB9PartSwitch moduleID=fuelSwitch baseVolume = #$/RESOURCE[LiquidFuel]/amount$ switcherDescription = Fuel Type switcherDescriptionPlural = Fuel Types switchInFlight = FALSE SUBTYPE { name = Liquid Fuel tankType = LF allowSwitchInFlight = FALSE } SUBTYPE { name = LF/Ox tankType = LFO allowSwitchInFlight = FALSE } } } // Making History parts of type LFO @PART[Size1p5_Size0_Adapter_01|Size1p5_Size1_Adapter_01|Size1p5_Size1_Adapter_02| Size1p5_Size2_Adapter_01|Size1p5_Tank_01|Size1p5_Tank_02|Size1p5_Tank_03|Size1p5_Tank_04| Size1p5_Tank_05|Size3_Size4_Adapter_01|Size4_EngineAdapter_01|Size4_Tank_01|Size4_Tank_02|Size4_Tank_03| Size4_Tank_04]:NEEDS[SquadExpansion/MakingHistory]:AFTER[B9PartSwitch] { MODULE { name=ModuleB9PartSwitch moduleID=fuelSwitch baseVolume = #$/RESOURCE[LiquidFuel]/amount$ @baseVolume += #$/RESOURCE[Oxidizer]/amount$ switcherDescription = Fuel Type switcherDescriptionPlural = Fuel Types switchInFlight = FALSE SUBTYPE { name = LF/Ox tankType = LFO allowSwitchInFlight = FALSE } SUBTYPE { name = Liquid Fuel tankType = LF allowSwitchInFlight = FALSE } } } // Missing History parts @PART[Size1p5_Size2_Adapter_02|adapterSmallMiniTall|Size1p5_Size2_Adapter_02|Size3_Size2_Tank]:NEEDS [MissingHistory]:AFTER[B9PartSwitch] { MODULE { name=ModuleB9PartSwitch moduleID=fuelSwitch baseVolume = #$/RESOURCE[LiquidFuel]/amount$ @baseVolume += #$/RESOURCE[Oxidizer]/amount$ switcherDescription = Fuel Type switcherDescriptionPlural = Fuel Types switchInFlight = FALSE SUBTYPE { name = LF/Ox tankType = LFO allowSwitchInFlight = FALSE } SUBTYPE { name = Liquid Fuel tankType = LF allowSwitchInFlight = FALSE } } }
  3. I am trying to write a custom .cfg that uses B9PartSwitch to allow changing all the stock LFO fuel tanks to liquid fuel only. I cannot find documentation for how to change a previously-loaded .cfg (such as when to use @, +, |, etc), and if you can point me to documentation I would appreciate it, but I think I have enough of that figured out for my purposes. The problem I am having that I cannot seem to work around comes when I go to get the amounts of liquid fuel and oxidizer in the part, then add them together. The way I am accessing that data it is returned as a string, and trying to add the two strings together or divide them by 0.45 or whatever causes a System.FormatException that forces the game to quit while it is loading when it gets to the first part I've specified. A minimum working (or failing, rather) example follows: @PART[fuelTankSmallFlat]:AFTER[B9PartSwitch] { MODULE { // superfluous information redacted LFamount = #$/RESOURCE[LiquidFuel]/amount$ Oxamount = #$/RESOURCE[Oxidizer]/amount$ baseVolume = LFamount / .45 // this crashes because LFamount is a string baseVolume = LFamount + Oxamount // this crashes too because both are strings // superfluous information redacted } } I don't even know what language this is in (is it C++?), but what I think I need is a way to coerce a data type change, like I would in R, as.numeric(LFamount) Thank you for your assistance. (And yes, I am aware of the existence of Interstellar Fuel Switch and Simple Fuel Switch. I want a) something that works with B9PartSwitch, which I already have installed, and b) to learn how to do this myself.)
  4. My mistake. It doesn't move any stock engines, but it does move the J10 and the RK-7 from Making History.
  5. First I did the math the way you did. Then, in the Wikipedia entry for Nuclear thermal rockets I saw the formula I ended up using in my post. I assumed it was more likely to be right than my initial calculations, but perhaps I was mistaken on that point. The .cfg file for the Dawn agrees with your stats regarding the engine. I must have a mod installed (maybe Near Future Propulsion?) that re-configures it to the numbers I cited. In both cases, thank you for the corrections.
  6. I thought it was relevant on the theory that parts that become useless when other parts are unlocked belong early in the tech tree while parts that remain useful after everything is unlocked belong later in the tech tree. Unlock everything and you'll still find uses for the Valiant. Also, often it's harder to make a thing small than it is to make a thing in the first place. Basic Rocketry gives you the Swivel; General Rocketry gives you a more-efficient non-swiveling Swivel (the Reliant) plus a smaller swiveling Swivel (the Valiant). Makes sense to me. PBC does not move any engines in the tech tree at present, so perhaps this discussion is more relevant to Missing History.
  7. Unlike the Reliant, the Valiant has a gimbal. And once you've unlocked the Kodiak, the Swivel should never be used again. In atmosphere the Kodiak produces more thrust at better efficiency for less mass than the Swivel, and in vacuum you can always do better than the Swivel with a Reliant, a Kodiak, 3 Terriers, 2 Cheetahs, a Dart, a Skiff, or a Poodle, depending on what precisely you're trying to do. The Swivel is a starter engine.
  8. There's some math involved. To simplify slightly but not too much, as a body moves in orbit around another body it trades altitude (potential energy) for velocity (kinetic energy) such that total energy is conserved. There's a good bit of calculus involved in deriving the formulas, but the formulas have already been derived and it's just a bit of algebra to use them; the important two are: Tsiolkovsky's Rocket Equation, delta-V = ve ln(Mo / Mf) Where ve is the velocity of exhaust (which is equal to Isp times the specific gravitational acceleration 9.80665 m/s²), Mo is the initial mass of the craft, including all fuel, fuel tanks, and engines, and Mf is the final mass of the craft, including empty fuel tanks and engines. And the orbital velocity equation, v=SQRT(mu(2/r - 1/a)) Where v is velocity, mu is the standard gravitational parmeter (Newton's gravitational constant Gc times the mass of the body being orbited), r is the radius from the gravitational center of the body at the time in question (which is the altitude plus the body's radius), and a is the semi-major axis of the orbit (which is the average of the apoapsis altitude and the periapsis altitude, plus the body's radius). When the orbit is circular, r = a and the equation simplifies to v=SQRT(mu/r) To use an example of both calculations, say you're in low Kerbin orbit, circular at altitude 80,000m, you want to get to the Mun (altitude 11,400,000m), your craft has a mass of 5 tons, and it's powered by a Terrier. Your current velocity is SQRT(mu/(80,000m + 600,000m)). (You can look up various bodies' gravitational parameters on the Wiki, but Kerbin's is 3.5316×1012.) Your orbital velocity, then, is 2278.93, which is also what the read-out on the Nav Ball should show. Your desired orbit has a semi-major axis of ((80,000 + 11,400,000)/2 + 600,000), or 6,340,000. In such an orbit, at periapsis your craft would have a velocity of SQRT(mu(2/(80,000+600,000) - (1/6,340,000)), or 3,135.29. The delta-V (literally, the difference between those two velocities) is 856.36, so that is how much you need to accelerate your craft. The Terrier has a vacuum Isp of 345 seconds (the game doesn't specify that the units are in seconds, but they are), and therefore its propellant exits with an exhaust velocity of 345 s × 9.80665 m/s² = 3,383.3 m/s. We re-arrange Tsiolkovsky's Rocket Equation to solve for Mf, getting Mf = Mo / (EXP(delta-V/ve)). Thus, your rocket which originally had a 5.000 ton mass before you burned to the Mun will now have a mass of 3.882 tons; you burned 1.118 tons of fuel. Those are the two equations and how they work. Some people put them into spreadsheets to simplify using the calculations for mission planning. For instance,
  9. Or I can share it now, here, I guess, as an early release. I'll type it up in the Add-Ons forum later. Feedback is welcome. Kerbal multipurpose calculator v1.0.xlsx https://drive.google.com/open?id=1YXN06keUEW7AkaMWv12g9aj7FWreLvEk
  10. I'll put a version out once I get to 5 mod-approved posts. I'm a nerd. I can't help it. In my defense, though, this is a game based on rocket science.
  11. I absolutely agree! It's hard to do the math when you don't know what the values mean. Going by the power output of the Dawn, I think one unit of electrical charge is close to 1.21 megaJoules. For a non-chemical engine, Thrust = 2 × Power / Ve. The Dawn produces 1,000 N of thrust with an exhaust velocity of 3690s × 9.80665 m/s², so its power is 18.09 MJ/s. It uses 14.999 electrical charge / second, so one Ec = 18.09 MJ/s ÷ 14.999 Ec/s = 1.206 MJ. (the Nerv by the same calculation produces 235 megawatts of power, which is one order of magnitude smaller than the real-life NERVA designs from the space race.) (That would mean the stock radioisotope generator puts out close to a megawatt of power, which is about three orders of magnitude too much. I think the Dawn is 1,000× overpowered, but nobody would want to use an engine with 1 N of thrust.)
  12. MrSystems

    Howdy

    I've been playing KSP since 2016, but I'm just now joining the forum. I play a heavily-modded version, so thank you very much to all the mod developers out there! The mods I can't live without include: ForScience Kerbal Engineer Redux Kerbal Operating System (not updated to 1.6.1, so I am currently living without it ) Missing History Near Future Construction, Launch Vehicles, and Solar PreciseNode SCANSat SpaceY Heavy Lifters SurfaceLights Tarsier Space Technology Transfer Window Planner That list is by no means all-inclusive of what I use; those are just the important ones for the way I play the game. And the way I play the game is with a lot of math on the side. I tend to work out answers to questions like "what engine will meet my thrust and delta-V requirements for the lowest total mass?" and "I haven't launched yet but I want to orbit the sun with an apoapsis of 70Gm; how much prograde delta-V do I need from low Kerbin orbit" in spreadsheets and on note paper. I'll release a public version of my spreadsheet soon; it takes all the guesswork out of building rockets.
  13. I might have a different strategy than most players. My first playthrough I was horrified when I turned on the option to show orbital debris for the first time, and there were dozens of spent stages floating around Kerbin, so now I intentionally crash all of my debris. With that goal in mind, my launches typically go: Ignite boosters and main rocket stage simultaneously. Separate boosters when empty. Separate main stage when empty. Separate trans-orbital stage when desired apoapsis is achieved (usually 75km-80km is my goal) and periapsis is in the range –20km to +15km (so that it burns up in atmosphere and minimizes burn from payload stage). Use less than 100dV from my payload stage to circularize. With that as my plan, I design my rockets as follows: Trans-Orbital: 1200 to 1400 dV (by vacuum stats), 0.8-1.2 TWR Main stage: 1200 to 1400 dV (by vacuum stats), 1.0-1.4 TWR (by atmospheric stats) Boosters: Add enough dV to get to 3400 total (by vacuum stats, usually about 500-700 additional dV), and dial down the thrust until liftoff TWR is about 1.7-1.8. I use SpaceY's lifter pack, so I have a good assortment of boosters to choose from, and Kerbal Engineer Redux, so I can easily see the mass and dV at each stage. Most rockets get either two or three boosters. Once everything is configured, the boosters tend to burn for about 45-60 seconds, and the main stage burns for 45-60 seconds more after booster separation. There might be methods to orbit that are cheaper in delta-V, but: It works for me, reliably I've had stability issues when main-stage separation happens too low in the atmosphere. It would be more efficient in terms of mass and cost to pack more onto the TransOrbital stage, but it's not worth the aggravation that comes with a rocket tipping over. You don't have to be mass-efficient on your main stage, because there's nothing below it; I try to be cost-efficient, not mass-efficient here Boosters are cheap in terms of both $$$ and thinking costs. Rather than use partial amounts of fuel in the tanks for my Main and TransOrbital stages, I adjust the rocket's overall delta-V by using different types or numbers of boosters. I have a spreadsheet that does all the calculations before I even start putting parts on the rocket Sample configurations include: Sample Take-Off Strategies Orbital Payload Mass 1 5 10 50 100 TransOrbital Engine Spark Cheetah Poodle Skipper Mainsail TransOrbital Fuel Req 0.61 2.93 5.84 29.49 61.43 Subtotal Mass 1.71 8.93 17.59 82.49 167.43 Main Stage Engine Valiant Kodiak Bobcat Ratite Mammoth Main Stage Fuel Req 2.36 8.89 15.23 78.02 138.52 Subtotal Mass 4.82 19.16 34.82 166.51 320.95 Booster Type SpaceY 05S SpaceY 09S SpaceY 10R SpaceY Thor SpaceY S211 Booster Quantity 2 3 2 1 3 (I think the Valiant comes from Missing History, the Cheetah, Bobcat, Kodiak, and Mammoth come from Making History, and the Ratite comes from SpaceY Lifters, if you're not familiar with those engines) You may note in the 1 Ton example that 0.61 tons of fuel for the trans-orbital stage is not a convenient amount to get. So I'd probably go under on that stage with just an FL-T100, add more fuel in the form of an extra FL-T100 to the main stage, and maybe need more or bigger boosters, but those are easy and inexpensive modifications.
  14. I'm using this mod with ResearchBodies to play my first OPM game, and it makes things much more fun, so thank you for developing it! I have noticed, though, that it has the issue Eriksonn described. The telescope is not viewing all the planets from the correct vector, and some are in different amounts of sun than they should be. Steps to Reproduce: Start a new Sandbox game in 1.6.1 with Outer Planets Mod and put a craft with a Deep Space Telescope into Kerbin orbit. View all the planets through the scope. As can be seen from the picture, Moho and Eve should be crescents, and all the rest of the planets should be close to full. In actuality, Moho and Eve are crescents, but so are Duna, Jool, and Plock. Worse, Sarnus, Urlum, and Neidon are back-lit. Now warp ahead half a Kerbin year (I went to year 1 day 161), so that Kerbin is on the same side of the sun as all the outer planets but Dres. Now Moho, which is on the opposite side of the sun and thus should be full, is in complete darkness. Eve is a crescent as expected. Duna, which should be gibbous, is half-lit. Jool & Dres should be near-full but are crescents. Sarnus and Plock are full as expected, but Neidon is half-lit. I looked through the mod's code to see if I could find the calculation but I didn't see it. The problem might actually be in the main game code, as without a telescope you'd never see a planet from the opposite side of the sun.
×
×
  • Create New...