Jump to content

how to balance a part


steuben

Recommended Posts

I'm playing around with part design.

General question: How can I tell if a part is decently balanced for general game play?

Specific case study:

Aetheric Tractor

from the CFG:
mass = 2.0
maxThrust = 200
heatProduction = 2000
PROPELLANT
{
   name = ElectricCharge
   ratio = 1200
  }
  atmosphereCurve
  {
   key = 0 300
   key = 1 300
 }

The VAB/SPH reports ~82 EC/s at full throttle and KER reports ~40 MW of heat at full throttle. In tests it takes just shy of 4 gigantor XL panels to power it and a large TCS, or about 8 large radiator panels, to keep it from melting at full thrust.

 

 

 

 

Edited by steuben
Link to comment
Share on other sites

Well for starters pure electric propulsion is not balanced, and never will be.

If some one wants easy unlimited range it's a lot less effort to just enable infinite fuel in the cheat menu and get the same effect than it is to implement a new part in ksp. If this is meant as some sort of endgame part that you earn after completing the tech tree then again just turn on infinite fuel after completing the tech tree.

Edited by passinglurker
Link to comment
Share on other sites

Nertea's near future propulsive systems seem reasonable - you need a complete nuclear reactor to generate enough sustained thrust for anything bigger than a satellite, that's something like 2000EC/s plus reaction mass for 50-100 thrust for the bigger thrusters.

Link to comment
Share on other sites

17 minutes ago, Van Disaster said:

Nertea's near future propulsive systems seem reasonable - you need a complete nuclear reactor to generate enough sustained thrust for anything bigger than a satellite, that's something like 2000EC/s plus reaction mass for 50-100 thrust for the bigger thrusters.

The thrust of NFP engines is several orders of magnitude less than its mass in exchange for that sort of range and even then it's still limited by a finite supply of propellant 

Edited by passinglurker
Link to comment
Share on other sites

Balancing something in a game in general is a trial and error process.

You are essentially exploring a solution space. The best strategy is to start from an initial guess value and test it for some time. If it seem too low, double it. Repeat until you reach a point where you start to feel it is too high, and then go back halfway between previous value and current one. Keep repeating the process until you feel satisfied. The same apply in the other direction.

Link to comment
Share on other sites

"Never" has been a word I have seen used more frequently than wisely.

I have run it through some testing. It has a TWR of about 1.5 with 14 tons of craft. Of that 14, 1 ton is cooling,  4 med TCS, and 2 tons is power, 6 gigantors and a few batteries. It'll turn a Z-4k inside out in under a minute and fatally overheat in about that same minute if uncooled.

It isn't a question of process. It is a question of knowing the solution is close enough. I'm exploring a four dimensional solution space; mass, thrust, heat production, and energy use. And i have no feel for topology. 

Link to comment
Share on other sites

You asked how to balance this for general game play and I'm telling you unless you make it require a propellant that has mass and can't be pulled from the vacuum of space you might as well just do whatever you want with this no general user would accept it.

No amount of power and cooling mass is gonna matter if you are still pulling off a 1.0+ twr. Engines can have high efficiency or they can have thrust not both and by using purely electric charge you've already given yourself infinite efficiency.

Besides last I checked engines don't actually produce thrust in ksp unless one of the propellants has mass and electric charge does not.

Link to comment
Share on other sites

1 hour ago, steuben said:

It isn't a question of process. It is a question of knowing the solution is close enough. I'm exploring a four dimensional solution space; mass, thrust, heat production, and energy use.

That's why you do a binary search, because it is faster than alternatives. In your example, did you sense there is too much EC being consumed? Halve it. At the same time, is the heat production too high? Halve it. Is the TWR too low? Double it. At the same time.

I'm not commenting on the specifics of what you are trying to balance. Prior knowledge of the right values is not required (of course, else you wouldn't need to search in the first place). Experience with the matter in question is only desiderable to choose a better initial guess, but otherwise is completely optional. You could choose random initial guesses and still reach some sweet spot after a while.

 

1 hour ago, steuben said:

And i have no feel for topology.

That's the spirit.

 

Edited by ShotgunNinja
Link to comment
Share on other sites

10 hours ago, passinglurker said:

Besides last I checked engines don't actually produce thrust in ksp unless one of the propellants has mass and electric charge does not.

Yeah, this. I was wondering if you had actually tested this engine of yours on the pad or in space already, @steuben ... using the KER readouts in the editor is fine and dandy, but it will not tell you that the entire 200 kN of thrust will evaporate into nothingness because you have only massless propellants.

A typical solution to this problem is to have the engine generate some sort of bogus resource at the same rate at which it consumes it. For example: you make a resource definition for "unobtanium", which has a non-zero density entry. You then include a ModuleGenerator in your engine config that produces "unobtanium" at a high rate for a negligible Ec cost. (Yes, you can indeed produce a resource with mass with only massless resources as input.) Also include a tiny amount of resource storage (like 0.1 units) in the engine, and hide the display of said resource so it doesn't get in the way (stock KSP hides the Ec resource on engines with an alternator, check that for pointers as to how it's done). Finally, configure the engine to use "unobtanium" as a primary propellant, and ElectricCharge as a secondary propellant (since Ec is massless, its consumption is defined as a ratio towards the primary propellant, not as an absolute value).

 

In regards to advice for balancing parts, since Near Future was mentioned, and I'm doing the engine balancing for that - let me share the approach I used.

I've found that sometimes, it helps to consider mathematical relationships between the various statistics you want to balance - especially when you have many different engines supposed to fill many different niches. With IRL electric engines in particular, there are some really obvious trends that you can use for inspiration. Consider the following table:

Engine                           Source     Year    Power      Thrust      Isp      Thrust/Power
SPT-100B hall thruster           Fakel      1994    1.35 kW    0.082 N     1,600s    0.061 N/kW
BHT-8000 hall thruster           Busek      ????    8.0 kW     0.449 N     2,210s    0.056 N/kW
NSTAR ion thruster               NASA       1990    2.3 kW     0.092 N     3,120s    0.040 N/kW
NEXT ion thruster                NASA       2004    6.9 kW     0.236 N     4,190s    0.034 N/kW
VX-200 VASIMR                    Ad Astra   2010    200 kW     5.000 N     5,000s    0.025 N/kW
HiPEP ion thruster               NASA       2003    39.3 kW    0.670 N     9,620s    0.017 N/kW
Dual-Stage 4-Grid ion thruster   ESA        2005    250 kW     2.500 N    19,300s    0.010 N/kW

What this tells you is, basically: no matter who you are or when you developed your engine, you're all clustering around the same mathematical relationship between engine Isp and thrust/power ratio. The higher the former, the lower the latter - and vice versa.

So in order to help me balance NF Propulsion, I took a spreadsheet and wrote a simple equation that represents this relationship: (Isp ^ a) / b, where a is the scaling exponent that defines how quickly power use for 1 kN of thrust increases as Isp goes up, and b is an arbitrary integer used afterwards to normalize the result onto a common base.

Choosing a was a bit of trial and error. Ultimately I decided to divide the available engines into three classes: one that scales well with increasing Isp (a = 1.2), one that scales poorly with increasing Isp (a = 1.4), and one that's average (a = 1.3). Then I decided on a power use of 2 Ec/s at 1 kN of thrust at an Isp of 1000s, and defined this as my common base. So for the average engine group, I had (1000 ^ 1.3) / b = 2, which I could simply solve for b. Finally, because one engine group scaled better with Isp than the others, I gave it a higher base power use at 1000s - in other words, these are the engines you want if fuel economy is more important than your thrust output. And for the engine group that scaled poorly, I defined a lower base power use at 1000s - in other words, these are the engines you want if you need maximum thrust out of a given amount of power, at the expense of fuel economy.

After solving for b for those engine groups too, I now have three equations that essentially do the most difficult part of the balancing for me: they spit out a power/thrust ratio ("this many Ec/s for 1 kN of thrust") for any given Isp!

In order to stat up an engine, I consider what technology it uses and what its niche should be. "Hey, i don't have a class A engine at this tech level yet, let's make this one into that." After sorting it into one of the three classes, I know which equation applies to it. Then, I decide on the Isp I want, which is usually easy, since I can base it on an increase over the related engine at the previous tech level (all the way down to the stock Dawn) and/or whatever the IRL inspiration for this engine happens to have. Then, I pick a number for power production, which is also easy, since I usually put them around multiples or divisions of reactor sizes that Near Future Electrical ships (since there is a 2,000 Ec/s reactor, I might potentially make engines with power needs of 500, 1,000, 1,500, 2,000, 3,000 and 4,000). And after choosing these two easy values - the question of how much thrust the engine should produce is already solved, because the equation I prepared tells me how power and thrust and Isp are related. Done!

As for heat? I decided to give each engine an "electric efficiency". This is something that also exists IRL, and is an important number defining important characteristics of the engine, but for my purposes I kept it super simple. Each 'technology' (like hall effect or gridded or the like) got an arbitrary efficiency, which is different from the others only because it makes for more interesting gameplay. And then I multiplied power use with that. An engine with an efficiency of 70% and a power use of 1,000 Ec/s would produce 30% of that power use as heat: 1000 * (1 - 0.7) = 300. And because Ec/s has no particular meaning or unit, but heat does, I then used an arbitrary multiplier to increase the heat output until it felt right ingame. Currently it's a five-fold multiplier, so that 1,000 Ec/s engine would produce 1,500 kW worth of heat while at full throttle. Might bump it up a little more in the next iteration, but we'll see.

 

So yeah. Mathematical relationships help! :) If you can find any for whatever you're trying to balance, define and lay them out clearly, so they can do some of the work for you.

Edited by Streetwind
Link to comment
Share on other sites

The other thing to consider is the simple fact that engines convert one type of energy to another, so go backwards - set a thrust target, work out how much energy that uses ( in a back-of-envelope real world-ish way ), decide on efficiency, and you have a figure for how much you have to feed into it, and the excess is heat. The problem with electric engines is deciding what an Ec is.

Edited by Van Disaster
Link to comment
Share on other sites

I have tested it. KER is blind to the part until it gets to the launch pad. And pushing it off the launch pad has to be slow or I end up ripping off the folding TCS panels. On a fresh static test, it melted when it had drained 3/4 of a Z-4K with no cooling at all.

I know the ISP formula requires mass. But, in the part config file the ISP is explicitly defined (atmosphereCurve), so it gets nicely handwaved away.

I hacked up the Dawn engine as a starting point. The part for any who are interested.

Spoiler

PART
{
 name = replus
 module = Part
 author = steuben
 mesh = model.mu
 scale = 1
 rescaleFactor = 1
 node_stack_top = 0.0, 0.2135562, 0.0, 0.0, 1.0, 0.0, 1
 node_stack_bottom = 0.0, -0.1872844, 0.0, 0.0, -1.0, 0.0, 1
 TechRequired = ionPropulsion
 entryCost = 16800
 cost = 8000
 category = Engine
 subcategory = 0
 title = repulser1
 manufacturer = Aetheric Alchemic Aerologics
 description = pushing against the aether it works... somehow
 attachRules = 1,0,1,1,0
 mass = 2.0
 dragModelType = default
 maximum_drag = 0.2
 minimum_drag = 0.2
 angularDrag = 2
 crashTolerance = 7
 maxTemp = 2000 // = 3600
 bulkheadProfiles = size0
 tags = aetheric electric
 MODULE
 {
  name = ModuleEnginesFX
  engineID = Ion
  thrustVectorTransformName = thrustTransform
  exhaustDamage = False
  ignitionThreshold = 0.1
  minThrust = 0
  maxThrust = 200
  heatProduction = 2000
  powerEffectName = IonPlume
  EngineType = Electric
  PROPELLANT
  {
   name = ElectricCharge
   ratio = 1200
  }
  atmosphereCurve
  {
   key = 0 300
   key = 1 300

  }
 }
 MODULE
 {
  name = FXModuleAnimateThrottle
  animationName = colorAnimation
  dependOnEngineState = True
  responseSpeed = 0.5
  engineName = Ion
  dependOnThrottle = True
 }
 EFFECTS
 {  
  IonPlume
  {
   AUDIO
   {
    channel = Ship
    clip = sound_IonEngine
    volume = 0.0 0.0
    volume = 0.05 0.20
    volume = 1.0 0.25
    pitch = 0.0 0.2
    pitch = 1.0 0.8
    loop = true
   }
   MODEL_MULTI_PARTICLE
   {
    modelName = Squad/FX/IonPlume
    transformName = thrustTransform
    emission = 0.0 0.0
    emission = 0.25 0.5   
    emission = 1.0 1.0
    //speed = 0.0 0.0
    //speed = 1.0 1.0
   }
  }
 }
 MODULE
 {
  name = ModuleTestSubject
  useStaging = True
  useEvent = True
  situationMask = 112
  CONSTRAINT
  {
   type = REPEATABILITY
   value = ALWAYS
   prestige = Trivial
  }
  CONSTRAINT
  {
   type = REPEATABILITY
   value = BODYANDSITUATION
   prestige = Significant
  }
  CONSTRAINT
  {
   type = REPEATABILITY
   value = ONCEPERPART
   prestige = Exceptional
  }
  CONSTRAINT
  {
   type = ALTITUDEENV
   test = GT
   value = 4000
   prestige = Trivial
  }
  CONSTRAINT
  {
   type = ALTITUDEENV
   test = LT
   value = 8000
   prestige = Trivial
  }
  CONSTRAINT
  {
   type = ALTITUDEENV
   test = GT
   value = 2000
   prestige = Significant
  }
  CONSTRAINT
  {
   type = ALTITUDEENV
   test = LT
   value = 4000
   prestige = Significant
  }
  CONSTRAINT
  {
   type = ALTITUDEENV
   test = GT
   value = 1000
   prestige = Exceptional
  }
  CONSTRAINT
  {
   type = ALTITUDEENV
   test = LT
   value = 2000
   prestige = Exceptional
  }
  CONSTRAINT
  {
   type = ALTITUDE
   test = LT
   value = 300000
   situationMask = 16
   body = _NotSun
  }
  CONSTRAINT
  {
   type = ALTITUDE
   test = LT
   value = 600000
   situationMask = 32
   body = _NotSun
  }
 }
}

 

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...