Jump to content

[1.12.x] Mk2 Rebalance v0.0.3


Recommended Posts

Mk2 Rebalance v0.0.2

This mod attempts to tweak the part config for Mk2 spaceplane parts to be a little more in line with the rest of the stock game.

Downloads:

Explanation:

So after the nth time of getting annoyed by how draggy Mk2 spaceplane parts are, I decided to study how bad the problem actually is. Turns out that from the bottom or the top, Mk2 spaceplane parts are almost three times draggier than 5m tanks of equivalent length in the same orientation (tested at Mach 2.3), despite having less than half the exposed area. Even stranger, in this orientation Mk2 cargo bays actually become significantly less draggy when opened, even though their exposed area increases.

f0xPzDn.png

It turns out that the default drag cube calculation is extraordinarily bad at providing reasonable drag coefficients for flat, wing-shaped parts. This causes the supposedly aerodynamic stock Mk2 parts to be some of the worst parts you could ever use for spaceplane building, as any pitch away from prograde will destroy their aerodynamic performance. They're also just extremely hollow, with fuel capacity akin to 1.25m parts, while having a volume more than twice as large.

But this problem could also easily be resolved. With some changes, these parts can be given drag that is much more appropriate for their size and shape. And we're not talking huge changes here, just making their top/bottom face drag coefficient comparable to those of the cylindrical tanks. Their fuel contents and mass can also be tweaked to be somewhat closer to the rest of the available parts. In total, this mod tries to give them body drag comparable to that of 1.875m tanks, and fuel contents of about 160% that of same length 1.25 tanks, while maintaining the same mass fraction that they already had. This makes them not strictly superior to any of the already existing parts, while giving them their own niche as a high-temperature tolerant fuselage part that sacrifices a small amount of space and mass for this.

The difference these small tweaks make to aircraft handling is staggering. Glide slopes are much improved, and spaceplanes become much less flip happy during re-entry. Mk2-based spaceplanes become much more comparable in size and performance to basic fuel tank based space planes. You can finally design pretty Mk2 based spaceplanes without compromising on performance.

Usage:

Simply copy the contents of the GameData folder of the mod into your GameData folder, or install it via CKAN. This mod is purely config-file based.

Dependencies:

This mod requires ModuleManager

Compatibility:

Right now this only tweaks stock Mk2 spaceplane parts. It purely alters their base parameters and drag cubes, so it should be broadly compatible.

Future plans:

I am working on improving Mk2 Stockalike Expansion support right now. I have plans for doing basic tweaks to the Mk3 parts as well, as these suffer from the same drag cube issue (although not as bad as the Mk2 parts).

Changelog:

  • v0.0.1: initial release
  • v0.0.2: tweaked numbers slightly. Bugfix long cargo bay drag cube. Added initial support for Mk2 Stockalike Expansion. Most components are implemented, support for components with variants is preliminary.
  • v0.0.3: Initial stock Mk3 part support. Bugfix of mk2 expansion shock cone.

Final notes:

This is my first KSP mod, please be kind if I did something stupid ;)

 Feel free to give this a spin and give some feedback on how balanced it is!

 

Edited by CensoredUsername
update title
Link to comment
Share on other sites

This is great, thank you! That said, I find it interesting that this has been brought up many times since at least 2016, but no changes were ever made. The numbers suggest that this was indeed a bug, but the lack of change/update suggests that these parts are working as intended. Although I suppose it's also possible that there was never any real desire by the devs to fix the issue. Very curious. 

Link to comment
Share on other sites

Spent a few hours on this last night and it is very interesting.  It is harder than stock and reminds me of FAR.  It does not affect existing craft so gave me an opportunity for side to side comparisons. 

Overall:  There is less drag and lift so the craft need to be set up differently.  The first versions I made went off the runway and straight into the sea.  It got better after some changes.  There is still the issue of landing that I need to explore more.  So far nothing but crashes.

Specifics:  I ended up with a new craft and an old one that weighed almost the same so the comparison is easier.  The old one is very forgiving and almost flies itself, but is sluggish getting up to speed and does not have good range, but it comes down from orbit and lands very nicely.  The new one is very fast and has good range too.  It is also very sensitive to weight distribution.  I have only flown it with fuel in the 100-60% range and it is nose heavy.  It should not be, but it is.  More testing and tuning with less fuel is the next step. 

Link to comment
Share on other sites

9 hours ago, miklkit said:

Spent a few hours on this last night and it is very interesting.  It is harder than stock and reminds me of FAR.  It does not affect existing craft so gave me an opportunity for side to side comparisons. 

Overall:  There is less drag and lift so the craft need to be set up differently.  The first versions I made went off the runway and straight into the sea.  It got better after some changes.  There is still the issue of landing that I need to explore more.  So far nothing but crashes.

Specifics:  I ended up with a new craft and an old one that weighed almost the same so the comparison is easier.  The old one is very forgiving and almost flies itself, but is sluggish getting up to speed and does not have good range, but it comes down from orbit and lands very nicely.  The new one is very fast and has good range too.  It is also very sensitive to weight distribution.  I have only flown it with fuel in the 100-60% range and it is nose heavy.  It should not be, but it is.  More testing and tuning with less fuel is the next step. 

That is very interesting. I am curious how you encountered less lift. Each component should be generating exactly the same amount of lift as it did previously, so maybe you got caught off guard by the fuel tanks having gotten significantly heavier? It shouldn't be harder than stock stats wise, but aircraft will need ~40% less fuel tanks for the same amount of fuel storage. Stability in flight at angles of attack near prograde shouldn't be impacted by the changes really as well. Could you post some pictures of the craft or craft files so I can confirm your observations?

Unrelatedly, there's a 0.0.2 update on spacedock that adds preliminary support for Mk2 expansion. It contains some hacks for now, but should be usable enough for people to try.

 

Link to comment
Share on other sites

Ok, this should be a big post. 

This is the first plane I built using your mod showing lift and a clear view.

 

 

Then the old plane.  The are at different altitudes and speed.  Didn't notice at the time.

 

Then I got tired of burning the cockpit off so built another plane with a stronger nose and all stock parts.  It still went nose down but managed to land fine. 

 

 

Then 3 pics showing the CoM and CoL of that plane at different fuel loads. 

 

 

 

 

 

Edited by miklkit
Post too big and ugly
Link to comment
Share on other sites

4 hours ago, miklkit said:

Ok, this should be a big post. 

This is the first plane I built using your mod showing lift and a clear view.

-- rest cutoff due to size--

Interesting. Just checking, with "It still went nose down but managed to land fine. " you mean it wanted to point straight prograde during reentry right?

In the now published 0.0.2 I have tweaked the numbers slightly as I did find that at reentry mach numbers the effect was a bit too strong.  This might impact some of the issues you found.

That said, one major problem I see with this craft is that it just doesn't have enough control authority in pitch to get it to do high-AoA manoeuvres.  You've got about 0.6 relative wing area that can deflect to 30 degrees trying to control it, and about 31 relative wing area in total out of which

High-AoA maneuvres in this mod will require a bit more control surface than you're used to for pitch. These could be easier without this mod, as the extra drag resulting from the usually forward-located Mk2 components would push them upwards. Of course, this came at the expense of this drag effect getting significantly stronger with Mach number compared to the rest of the parts, which would often cause Mk2 spaceplanes which are stable at like 2000m/s during reentry to become utterly unstable at a 3000m/s reentry at the same angles of attack.

 

Link to comment
Share on other sites

19 hours ago, DVQuill said:

This is great, thank you! That said, I find it interesting that this has been brought up many times since at least 2016, but no changes were ever made. The numbers suggest that this was indeed a bug, but the lack of change/update suggests that these parts are working as intended. Although I suppose it's also possible that there was never any real desire by the devs to fix the issue. Very curious. 

Honestly, it's just the drag system being very simplistic. It works kinda, but don't expect it to do anything intelligent or semi-realistic.

There's some funny edge cases like a sphere moving in the XY direction of its model having about 40% more drag than a sphere moving directly in the X direction. An aligned flat plate having basically no drag, but a flat plate at a 30 degree angle having about 50% the drag of a flat plate that is perpendicular to the flow direction. Anything that's slightly pointier than a cylinder has basically no drag, anything less pointy than a cylinder having significantly more drag. The latter effect being so strong that if you were to take a sphere, and only keep like the flattest part facing the flow in the centre while removing the rest, it'd still have more drag than the full sphere, even though you just only removed geometry. Attaching things via nodes does remove some drag, but this doesn't actually check for the attached area, just the projected area of the entire part attached. I.e. you can mount 10 1.25 to 2.5m adapters in a row, all facing the same direction, and all but the first and last of them will cause no drag if prograde.

It'd be nice to adjust the full system so things like this mod wouldn't be necessary, but such changes would mess with the balance of the game so much it'd be hard to oversee. It's also just hard to create a performant solution that still offers predictable behaviour for gameplay. Real aerodynamics are hard.

Link to comment
Share on other sites

13 hours ago, CensoredUsername said:

Interesting. Just checking, with "It still went nose down but managed to land fine. " you mean it wanted to point straight prograde during reentry right?

Correct.  Left to its own it started pointed up at 45 degrees, then fell to -5 or so and wanted to stay there.  I clicked on prograde to force it down into thicker air or it would have "bounced" 2-3 times before slowing down and dropping down.  Mistakes are expected as I am chasing unfamiliar physics.  Got the update and will see about adding more control surfaces.  More has not been needed in the past. 

Link to comment
Share on other sites

Aight, thanks for taking them time.

As for the next update, I'm working on the stock Mk3 spaceplane parts now.  Clocked them at Mach 3, generating about 3 times as much drag as the equivalent 3.75m tanks :D With only half the fuel of course. Probably going to aim for 1.6 times more fuel again (so it's more like 80% of a rocket fuel tank), and drag similar to the 3.75m tanks  (because well, they're literally shaped like them with a tiny piece cut way. Which for some reason makes them produce three times the drag).

 

Link to comment
Share on other sites

I think I may have encountered a bug where your new drag cubes aren't properly checking whether a part is in front of them, so they're acting as if the airstream is directly hitting them even though they're in the middle of the craft. This only happens to parts placed after downloading the mod, the drag cube modifications go through just fine on existing parts.

See below:
https://ibb.co/5TNygy3

https://ibb.co/bL2dvKv

Not sure exactly why this happened, but if you need any more info on it I can try and get it.

 

EDIT: It seems the large cargo bay is giving me the "open" drag cube when closed as well.

https://ibb.co/BjGfgTt

Edited by Pazuzu
Link to comment
Share on other sites

Posted (edited)
12 hours ago, Pazuzu said:

I think I may have encountered a bug where your new drag cubes aren't properly checking whether a part is in front of them, so they're acting as if the airstream is directly hitting them even though they're in the middle of the craft. This only happens to parts placed after downloading the mod, the drag cube modifications go through just fine on existing parts.

See below:
https://ibb.co/5TNygy3

https://ibb.co/bL2dvKv

Not sure exactly why this happened, but if you need any more info on it I can try and get it.

 

EDIT: It seems the large cargo bay is giving me the "open" drag cube when closed as well.

https://ibb.co/BjGfgTt

I think you ran into a known bug in 0.0.1 (I typo'd the drag cube name, causing KSP to ignore it. It's fixed already in 0.0.2).

Edited by CensoredUsername
Link to comment
Share on other sites

5 hours ago, HockeyGoalie35 said:

Great mod, and thanks for the MK2 expansion support. Does "Mk 3 Stockalike Expansion" have the same issue?

Probably. I haven't played with it yet. The Mk3 tanks do suffer from the same issue, although it's much less severe than the Mk2 parts (WDrg on top/bottom faces of 0.83 compared to 0.90). I might work on that in the future, haven't played much with Mk3 expansion myself yet.

I was also thinking of finding a way to fix the problem in general (modding the actual drag mixing curves KSP uses to reduce the ridiculous drag side faces generate at small angles of attack in general), but that's a bit more advanced modding than I'm experienced with.

Link to comment
Share on other sites

  • 2 weeks later...

I seem to be getting an error with this installed alongside FreeIVA.

[WRN 14:50:40.313] Cannot find key node_stack_bottom_01 in PART
[ERR 14:50:40.313] Error - Cannot parse variable search when inserting new key node_stack_bottom01 = #$node_stack_bottom_01$
[WRN 14:50:40.313] Cannot find key node_stack_bottom_02 in PART
[ERR 14:50:40.313] Error - Cannot parse variable search when inserting new key node_stack_bottom02 = #$node_stack_bottom_02$


Looks like both this mod, and FreeIVA are trying to delete/rename the stack nodes on the tricoupler. Which leads to FreeIVA throwing an error.
 

FreeIVA:

Spoiler
@PART[M2X_linearTricoupler]:HAS[!MODULE[ModuleFreeIva]]:FOR[FreeIva]
{
	// when KSP loads the part, it splits these keys by underscore and only takes the 3rd token.
	// So, the part ends up with 3 attachnodes named "bottom" and we can't tell hatches which one they belong to
	node_stack_bottom01 = #$node_stack_bottom_01$
	node_stack_bottom02 = #$node_stack_bottom_02$
	-node_stack_bottom_01 = delete
	-node_stack_bottom_02 = delete
	
	FreeIva_AutoPassThrough_InternalName = FreeIva_M2X_linearTricoupler_IVA
}

Mk2 Re-balance:

Spoiler
// Mk2 to 3x 1.25 adapter
// this has a lot of fuel by default. A bit too much really.
// fuel, lifting wing, default drag cube
@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion]:FIRST
{
    // todo: the following is a bugfix for bugged node definitions in M2X.
    // I have reported them, so check if that report has gotten through.
    !node_stack_bottom = 0
    !node_stack_bottom_01 = 0
    !node_stack_bottom_02 = 0
    &node_stack_bottom03 = 0.0, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom01 = 1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom02 = -1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    <SNIP>
}

I ended up splitting it out like so:

Spoiler
// Mk2 to 3x 1.25 adapter
// this has a lot of fuel by default. A bit too much really.
// fuel, lifting wing, default drag cube
@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion,!FreeIva]:FIRST
{
    // todo: the following is a bugfix for bugged node definitions in M2X.
    // I have reported them, so check if that report has gotten through.
    !node_stack_bottom = 0
    !node_stack_bottom_01 = 0
    !node_stack_bottom_02 = 0
    &node_stack_bottom03 = 0.0, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom01 = 1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom02 = -1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
}

@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion,FreeIva]:FINAL
{
    // todo: the following is a bugfix for bugged node definitions in M2X.
    // I have reported them, so check if that report has gotten through.
    &node_stack_bottom03 = 0.0, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom01 = 1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom02 = -1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
}

@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion]:FIRST
{
    @mass *= 0.83636 // 0.46, down from 0.55t, adjusted to make this part lighter
    @cost *= 1.44231 // 1500, up from 1040. This shouldn't be cheaper than the bicoupler

    @RESOURCE[LiquidFuel]
    {
        @amount *= 0.8
        @maxAmount *= 0.8
    }

    @RESOURCE[Oxidizer]
    {
        @amount *= 0.8
        @maxAmount *= 0.8
    }

    @MODULE[ModuleLiftingSurface]
    {
        %useInternalDragModel = True
    }
    
    !DRAG_CUBE {}
    DRAG_CUBE
    {
        cube = Default, 2.487,0.5452,1.957, 2.487,0.5452,1.942, 4.172,0.7505,1.847, 4.187,0.9061,1.878, 5.659,0.8418,0.8467, 5.659,0.8386,0.8467, 0.000401,-0.05069,7.987E-06, 3.698,1.779,1.5
        @cube[14] = 0.74
        @cube[17] = 0.74
    }
}

 

Not sure if that's the most ideal way to fix that, but it seems to be working the same for me.

Link to comment
Share on other sites

7 minutes ago, jthero7 said:

I seem to be getting an error with this installed alongside FreeIVA.

Known issue, I'm trying to get it fixed at the source (https://github.com/SuicidalInsanity/Mk2Expansion/pull/69). If it causes problems just delete either the fix in FreeIVA or Mk2Rebalance for now. If I don't get a response from Mk2 expansion for longer I'll deal with it properly.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
On 8/3/2024 at 6:02 PM, jthero7 said:

I seem to be getting an error with this installed alongside FreeIVA.

[WRN 14:50:40.313] Cannot find key node_stack_bottom_01 in PART
[ERR 14:50:40.313] Error - Cannot parse variable search when inserting new key node_stack_bottom01 = #$node_stack_bottom_01$
[WRN 14:50:40.313] Cannot find key node_stack_bottom_02 in PART
[ERR 14:50:40.313] Error - Cannot parse variable search when inserting new key node_stack_bottom02 = #$node_stack_bottom_02$


Looks like both this mod, and FreeIVA are trying to delete/rename the stack nodes on the tricoupler. Which leads to FreeIVA throwing an error.
 

FreeIVA:

  Hide contents
@PART[M2X_linearTricoupler]:HAS[!MODULE[ModuleFreeIva]]:FOR[FreeIva]
{
	// when KSP loads the part, it splits these keys by underscore and only takes the 3rd token.
	// So, the part ends up with 3 attachnodes named "bottom" and we can't tell hatches which one they belong to
	node_stack_bottom01 = #$node_stack_bottom_01$
	node_stack_bottom02 = #$node_stack_bottom_02$
	-node_stack_bottom_01 = delete
	-node_stack_bottom_02 = delete
	
	FreeIva_AutoPassThrough_InternalName = FreeIva_M2X_linearTricoupler_IVA
}

Mk2 Re-balance:

  Hide contents
// Mk2 to 3x 1.25 adapter
// this has a lot of fuel by default. A bit too much really.
// fuel, lifting wing, default drag cube
@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion]:FIRST
{
    // todo: the following is a bugfix for bugged node definitions in M2X.
    // I have reported them, so check if that report has gotten through.
    !node_stack_bottom = 0
    !node_stack_bottom_01 = 0
    !node_stack_bottom_02 = 0
    &node_stack_bottom03 = 0.0, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom01 = 1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom02 = -1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    <SNIP>
}

I ended up splitting it out like so:

  Hide contents
// Mk2 to 3x 1.25 adapter
// this has a lot of fuel by default. A bit too much really.
// fuel, lifting wing, default drag cube
@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion,!FreeIva]:FIRST
{
    // todo: the following is a bugfix for bugged node definitions in M2X.
    // I have reported them, so check if that report has gotten through.
    !node_stack_bottom = 0
    !node_stack_bottom_01 = 0
    !node_stack_bottom_02 = 0
    &node_stack_bottom03 = 0.0, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom01 = 1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom02 = -1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
}

@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion,FreeIva]:FINAL
{
    // todo: the following is a bugfix for bugged node definitions in M2X.
    // I have reported them, so check if that report has gotten through.
    &node_stack_bottom03 = 0.0, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom01 = 1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
    &node_stack_bottom02 = -1.223489, -0.9028862, 0.0, 0.0, -1.0, 0.0
}

@PART[M2X_linearTricoupler]:NEEDS[Mk2Expansion]:FIRST
{
    @mass *= 0.83636 // 0.46, down from 0.55t, adjusted to make this part lighter
    @cost *= 1.44231 // 1500, up from 1040. This shouldn't be cheaper than the bicoupler

    @RESOURCE[LiquidFuel]
    {
        @amount *= 0.8
        @maxAmount *= 0.8
    }

    @RESOURCE[Oxidizer]
    {
        @amount *= 0.8
        @maxAmount *= 0.8
    }

    @MODULE[ModuleLiftingSurface]
    {
        %useInternalDragModel = True
    }
    
    !DRAG_CUBE {}
    DRAG_CUBE
    {
        cube = Default, 2.487,0.5452,1.957, 2.487,0.5452,1.942, 4.172,0.7505,1.847, 4.187,0.9061,1.878, 5.659,0.8418,0.8467, 5.659,0.8386,0.8467, 0.000401,-0.05069,7.987E-06, 3.698,1.779,1.5
        @cube[14] = 0.74
        @cube[17] = 0.74
    }
}

 

Not sure if that's the most ideal way to fix that, but it seems to be working the same for me.

Oh hey, really the FreeIva patch should first be checking to make sure the old node names exist in the part.  I'd suggest that anyone else making patches to rectify this problem do the same, AND follow the FreeIva example of copying the old value rather than hardcoding the locations of the nodes.

 

Further, FreeIva's config for this part does assign hatches to specific node names (bottom, bottom01, bottom02) so if you're not using those then you're likely to break FreeIva.  I'm not sure if this cfg predates automatic node detection in FreeIva, so if I remove those explicit names then it might work, but you're still gonna be waiting on a new FreeIva release.  So in the meantime if anyone is going to release anything I'd suggest using those names.

 

Oof.  Yeah it would really help everyone if you didn't rename `node_stack_bottom` - the center node.  This is pretty well established by convention on a lot of parts.

Edited by JonnyOThan
Link to comment
Share on other sites

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