Jump to content

[1.3 - 1.8.1] Decoupler Shroud


navot

Recommended Posts

56 minutes ago, navot said:

Thanks for sending the screenshots! I have tried once more to reproduce this, but couldn't. If you could you send me a log, that might help me understand what is happening

Will provide. The log has only 708 kb, I could send by PM? If not I find someway of uploading.

Again, the last version seems perfectly finethis is just because you asked me to understand more what happened. In this test now I used the first version, you also did that? 

Launched the vessel to gather more data in the log. It was losing the top and bottom attach points, and the antenna was having a strange behavior after launching (that parts sticking out).

BNDWhew.png

The Gamedata folder:

he4mvsQ.png

Edited by MaximumThrust
Orthographic error.
Link to comment
Share on other sites

I guess you could send it to me as a PM (I'm not really sure myself how this site works, also still new to this). I got that it is no longer happening in the later version, but it is still puzzling me how it happened in the first place.

Link to comment
Share on other sites

@MaximumThrust I suggest using something like Dropbox or OneDrive. I've posted a number of log files in these forums, and it seems the easiest method. :-)

@navot I only started using this mod today, but I wanted to say that I love it. I've been waiting a long time for something like this. I'll keep an eye out for any bugs I can find.

Link to comment
Share on other sites

  • 2 weeks later...

Hi all, not sure if other people have this issue.  If so then I'll post logs etc @navot

I am in 1.4.1 (also have MH).  Using the decoupler shroud against the 2.5m heatshield, in turn attached to the Mk1-3 pod, the heatshield is ignored by the game when entering the atmosphere.  The decoupler is staged off as the craft hits 70km altitude so only the pod and heat shield remain, but the pod heats up and the heatshield loses no ablator an doesn't show the red flames off the shield. 

Same craft, same staging etc, but without the decoupler shroud enabled this time (mod still installed), it works fine.  It also works fine using the ugly and slightly offset heatshield shroud.

Peace.

Link to comment
Share on other sites

On 2018-03-19 at 8:52 AM, theJesuit said:

Hi all, not sure if other people have this issue.  If so then I'll post logs etc @navot

I am in 1.4.1 (also have MH).  Using the decoupler shroud against the 2.5m heatshield, in turn attached to the Mk1-3 pod, the heatshield is ignored by the game when entering the atmosphere.  The decoupler is staged off as the craft hits 70km altitude so only the pod and heat shield remain, but the pod heats up and the heatshield loses no ablator an doesn't show the red flames off the shield. 

Same craft, same staging etc, but without the decoupler shroud enabled this time (mod still installed), it works fine.  It also works fine using the ugly and slightly offset heatshield shroud.

Peace.

Same thing happened to me with the MK1 pod. 

Link to comment
Share on other sites

On 20/03/2018 at 1:52 AM, theJesuit said:

Hi all, not sure if other people have this issue.  If so then I'll post logs etc @navot

I am in 1.4.1 (also have MH).  Using the decoupler shroud against the 2.5m heatshield, in turn attached to the Mk1-3 pod, the heatshield is ignored by the game when entering the atmosphere.  The decoupler is staged off as the craft hits 70km altitude so only the pod and heat shield remain, but the pod heats up and the heatshield loses no ablator an doesn't show the red flames off the shield. 

Same craft, same staging etc, but without the decoupler shroud enabled this time (mod still installed), it works fine.  It also works fine using the ugly and slightly offset heatshield shroud.

Peace.

 

3 hours ago, snkiz said:

Same thing happened to me with the MK1 pod. 

Skiniz, are you in 1.4.1?

EDIT- Of course navot in you aren't planding an update then just say... :)

ORIGINAL -

Hi @navot.  Any idea why this would happen? I'll try and spend some time replicating  with different combinations - would logs help? 

My guess is that within the shroud the atmospheric physics are ignored but when the decoupler is decoupled the physics aren't being reapplied to items that were within the shroud.  Fine for things that are going to land in an atmosphere but not so much for heatshields! 

I'll look at heatshield and easily burnable material too to see if they are affected.  

Peace.

Edited by theJesuit
Link to comment
Share on other sites

@theJesuit thanks for the bug report. The reason this was happening is that I shielded the shrouded part from aerodynamic forces when it is shrouded, but forgot to disable the shielding after decoupling, so your guess was right on!

It should be fixed in the new 1.4.1 version of the mod (v0.3.3).

Link to comment
Share on other sites

Hi, I noticed that part-specific configs for the DLC parts were missing (resulting in auto-size shrouds having a BotWidth only 25% the size it ought to be for the 1.875m and 5.0m decoupler/separator parts) so sorted the base-game parts' configs by size and then added the DLC part configs beneath those, for aforementioned parts as well as the 1.875m strut type (Soyuz-interstage analogue) decoupler. The default thickness 0.08 for the strut-style 1.875m decoupler was because anything larger resulted in see-thru gaps when looking up from below (seeing inside the structure of your shroud, I guess) so I decreased that until the effect stopped happening -- though if your shrouds had a bottom surface like they have a top surface, then this effect could be solved that way too. For the normal 1.875m and 5.0m parts I used a thickness more fitting with the steadily-increasing values seen in the rest of the size series. Below is the full text of my version of 'DecouplerShroud.cfg' if you want to sanity check it:

@PART[*]:FOR[DecouplerShroud]:HAS[@MODULE[ModuleDecouple]]
{
	MODULE
	{
		name = ModuleDecouplerShroud

		//Amount of faces every cylinder of the shroud has
		nSides = 24

		//If the shroud is enabled by default
		shroudEnabled = false

		//If size detection is on by default
		autoDetectSize = true

		//Default Thickness
		defaultThickness = 0.15

		//Default bottom width for auto detecting size
		//0: checks the collider size
		// != 0: value will be default bottom radius
		defaultBotWidth = 0

		//Default vertical offset for auto detecting size
		defaultVertOffset = 0

		//Default texture that will be used
		textureIndex = 1

		//Error margin for snapping to standard size (as percentage of the radial size)
		radialSnapMargin = .05

		//Size of the bottom Edge
		bottomEdgeSize = .1

		//Size of the top bevel
		topBevelSize = .05

		//Size increase to top and bottom radius to avoid Z-Fighting
		antiZFightSizeIncrease = 0.01

	}
}

// CONFIGS FOR 'Squad' PARTS

@PART[Decoupler_0]:FOR[DecouplerShroud]{
 	@MODULE[ModuleDecouplerShroud]{
 		%defaultBotWidth = 0.63
		%defaultVertOffset = 0.01
		%nSides = 24
		%defaultThickness = 0.08
		%bottomEdgeSize = .05
		%topBevelSize = .02
	}
}
@PART[Separator_0]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
 		%defaultBotWidth = 0.63	
		%defaultVertOffset = 0.01
		%nSides = 24
		%defaultThickness = 0.08
		%bottomEdgeSize = .05
		%topBevelSize = .02
	}
}
@PART[Decoupler_1]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 1.25
		%defaultVertOffset = 0.06
		%nSides = 24
		%defaultThickness = 0.12
		%bottomEdgeSize = .08
		%topBevelSize = .03
	}
}
@PART[Separator_1]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 1.25
		%defaultVertOffset = 0.0
		%nSides = 24
		%defaultThickness = 0.12
		%bottomEdgeSize = .08
		%topBevelSize = .03
	}
}
@PART[Decoupler_2]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 2.5
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.15
		%bottomEdgeSize = .12
		%topBevelSize = .04
	}
}
@PART[Separator_2]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 2.5
		%defaultVertOffset = -0.01
		%nSides = 24
		%defaultThickness = 0.15
		%bottomEdgeSize = .12
		%topBevelSize = .04
	}
}
@PART[Decoupler_3]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 3.75
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.2
		%bottomEdgeSize = .15
		%topBevelSize = .05
	}
}
@PART[Separator_3]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 3.75
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.2
		%bottomEdgeSize = .15
		%topBevelSize = .05
	}
}

// CONFIGS FOR 'SquadExpansion' PARTS

@PART[Size1p5_Strut_Decoupler]:FOR[DecouplerShroud]:NEEDS[SquadExpansion]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 1.87
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.08
		%bottomEdgeSize = .05
		%topBevelSize = .04
	}
}
@PART[Decoupler_1p5]:FOR[DecouplerShroud]:NEEDS[SquadExpansion]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 1.87
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.14
		%bottomEdgeSize = .10
		%topBevelSize = .04
	}
}
@PART[Separator_1p5]:FOR[DecouplerShroud]:NEEDS[SquadExpansion]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 1.87
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.14
		%bottomEdgeSize = .10
		%topBevelSize = .04
	}
}
@PART[Decoupler_4]:FOR[DecouplerShroud]:NEEDS[SquadExpansion]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 5.00
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.2
		%bottomEdgeSize = .18
		%topBevelSize = .06
	}
}
@PART[Separator_4]:FOR[DecouplerShroud]:NEEDS[SquadExpansion]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 5.00
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.2
		%bottomEdgeSize = .18
		%topBevelSize = .06
	}
}



// =============================
// === OLD DECOUPLER CONFIGS ===
// =============================

@PART[stackDecouplerMini]:FOR[DecouplerShroud]{
 	@MODULE[ModuleDecouplerShroud]{
 		%defaultBotWidth = 0.63		// assuming bent edges
		%defaultVertOffset = 0.01
		%nSides = 24
		%defaultThickness = 0.08
		%bottomEdgeSize = .05
		%topBevelSize = .02
	}
}
@PART[stackSeparatorMini]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
 		%defaultBotWidth = 0.63		// assuming bent edges
		%defaultVertOffset = 0.01
		%nSides = 24
		%defaultThickness = 0.08
		%bottomEdgeSize = .05
		%topBevelSize = .02
	}
}
@PART[stackSeparatorBig]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 2.5
		%defaultVertOffset = -0.01
		%nSides = 24
		%defaultThickness = 0.15
		%bottomEdgeSize = .12
		%topBevelSize = .04
	}
}
@PART[size3Decoupler]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 3.76
		%defaultVertOffset = 0
		%nSides = 24
		%defaultThickness = 0.2
		%bottomEdgeSize = .15
		%topBevelSize = .05
	}
}
@PART[decoupler1-2]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 2.5
		%defaultVertOffset = 0.03
		%nSides = 24
		%defaultThickness = 0.15
		%bottomEdgeSize = .12
		%topBevelSize = .04
	}
}
@PART[stackSeparator]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 1.28
		%defaultVertOffset = -0.04
		%nSides = 24
		%defaultThickness = 0.12
		%bottomEdgeSize = .08
		%topBevelSize = .03
	}
}
@PART[stackDecoupler]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 1.28
		%defaultVertOffset = 0.06
		%nSides = 24
		%defaultThickness = 0.12
		%bottomEdgeSize = .08
		%topBevelSize = .03
	}
}

Imgur album of the before/after of my changes: 

Album a/XiS5p will appear when post is submitted

For the "engine plates" I'm not sure if that can be accomplished within the cfg file directly or not, or if that would require changes to the plugin. Would need a way to look down rather than up to get the automatic shroud diameter (pre-defined topWidth and auto-detected bottomWidth, the opposite of a decoupler), and then to extend the shroud down from the decoupler by a height taken from the variant 'node_stack_bottom' 2nd value for the plate itself, rather than worrying about the distance between top/bottom nodes of the engine(s) attached to by the plate's 'ModuleDynamicNodes' nodes. I'm interested in assisting with that how I can, but I'm still really new to mods (never made my own, only tweaked others' mods) so it probably makes more sense to you what needs to be done to get this mod to work with the engine plates. One thing I did notice is that the engine plates have both the "decouple" and the "jettison" module, whereas decouplers only have "decouple", so it seems like that might be a key part of differentiating between the two part types, based on my reading of the engine plate config files.

Edited by wookiee_goldberg
Link to comment
Share on other sites

First off, big thanks for providing the configs for the expansion, which I currently don't have!

The engine plates will be a bit more difficult to fix. The issue is, that until now I got away with assuming, that the shroud should go from the top attach nodes to two parts up, which isn't the case for the engine plates. Another problem is that the shroud is added to the decoupler and just stays there after decoupling, which will look bad on the engine plate. This will require some bigger changes to the plugin...

For now I think I'll make a new version with your new config patches, and temporarily remove the decoupler shroud from engine plates (I don't think it makes sense to have them enabled in the current state of things), until I work on fixing it, which probably won't be before the weekend. In order to do that, it would be great if you could provide me with the names of the engine plates (the config part names).

Link to comment
Share on other sites

7 hours ago, navot said:

First off, big thanks for providing the configs for the expansion, which I currently don't have!

The engine plates will be a bit more difficult to fix. The issue is, that until now I got away with assuming, that the shroud should go from the top attach nodes to two parts up, which isn't the case for the engine plates. Another problem is that the shroud is added to the decoupler and just stays there after decoupling, which will look bad on the engine plate. This will require some bigger changes to the plugin...

For now I think I'll make a new version with your new config patches, and temporarily remove the decoupler shroud from engine plates (I don't think it makes sense to have them enabled in the current state of things), until I work on fixing it, which probably won't be before the weekend. In order to do that, it would be great if you could provide me with the names of the engine plates (the config part names).

The plate names are:

  • EnginePlate1p5
  • EnginePlate2
  • EnginePlate3
  • EnginePlate4

The way that the plates drop their fairing is by using a jettison module (almost identical to the one in, for example, the stock LV-T45 engine):

// LV-T45 engine, as an example
	MODULE
	{
		name = ModuleJettison
		jettisonName = fairing
		bottomNodeName = bottom
		isFairing = True
		jettisonedObjectMass = 0.1
		jettisonForce = 5
		jettisonDirection = 0 0 1
	}

// engine plate also has these 2 additional parameters in the module
		stagingEnabled = false
		useMultipleDragCubes = false

I plan to play with this some to see if i can at least get the EP fairings to behave properly, even if their size is horribly wrong.

As for how to do the sizing, I was thinking if you add a boolean for "%isEnginePlate = true/false" and assume "false" if no part-specific answer is provided. And changing the names of bottom/top variables to base/remote, respectively, and then let the plugin assign top-ness and bottom-ness based on the value of "%isEnginePlate".

  •         %defaultBotWidth -> %defaultBaseWidth
  •         %bottomEdgeSize -> %baseEdgeSize
  •         %topBevelSize -> %remoteBevelSize

That way the "base" size will always be the size of the decoupler/plate itself, and the "remote" size will always be the one you fetch from other parts. And perhaps also for "%isEnginePlate" to inverse the directions of height and vertical offset such that a positive value is always "away from the base, towards the remote", rather than "from bottom to top".

For the height, you only have to check against the decoupler itself, rather than worrying about what's attached to it. I'm not sure if i'm actually allowed to copy/paste large sections of the stock configs to someone who doesn't own the DLC though (as one could do for base-game parts), but I'm gonna read through your existing code and try and get an idea how this stuff works so I can maybe provide some better info about that part of it. Or maybe I'll actually learn C# in the process, who knows... I've done some programming before, bash scripts, a tiny bit of JS, and some VisualBasic 6/.Net back in the day... and your code is already developed enough I might be able to figure out its workings just by reading through it.

Link to comment
Share on other sites

I have added your making history configs and the patch to remove the engine plates to the current version.

Having a bool isEnginePlate to differentiate is a good start. Also the base/remote sizes seems will be good if we have it all in one class.

However, I've been thinking about it for a bit, and I think it might be better to have an own module / inherit the class specifically for the engine plates, since there would be a bunch of places where there would be different cases for isEnginplate or !isEnginePlate. However, I'm still not quite sure if this option would be easier to implement (I'm also not exactly the most experienced mod dev).

Link to comment
Share on other sites

  • 2 weeks later...
On 22/03/2018 at 9:08 AM, navot said:

I have added your making history configs and the patch to remove the engine plates to the current version.

Having a bool isEnginePlate to differentiate is a good start. Also the base/remote sizes seems will be good if we have it all in one class.

However, I've been thinking about it for a bit, and I think it might be better to have an own module / inherit the class specifically for the engine plates, since there would be a bunch of places where there would be different cases for isEnginplate or !isEnginePlate. However, I'm still not quite sure if this option would be easier to implement (I'm also not exactly the most experienced mod dev).

I would have thought it was fine if the code works without the dlc? Modders can use it in their own parts which would be downloadable with or without the dlc.  You aren't necessarily distributing assets right? Add a line - 'designed to work with dlc but may work without.'

Link to comment
Share on other sites

11 minutes ago, theJesuit said:

I would have thought it was fine if the code works without the dlc? Modders can use it in their own parts which would be downloadable with or without the dlc.  You aren't necessarily distributing assets right? Add a line - 'designed to work with dlc but may work without.'

Nobody should be under the impression that the DLC is required for the mod to work. The mod isn't even fully supportive of the DLC yet (the mod ignores EnginePlate parts for now), and even when it is, that will be "in-addition-to" the existing non-DLC support; it's not an "either/or" situation. So the 'designed to work with dlc but may work without' disclaimer you requested really isn't accurate to the present or future of the mod, it's just far more effective to put the DLC-specific code into the main mod instead of forking it into two separate mods (one with DLC support and one without).

He's not distributing any unnecessary assets - the only assets included are the texture and normal-map for the shroud, which are different from any of the ones included in the game itself. The stuff you see in DecouplerShroud.cfg does not include any assets, it's just condition-handling code (a list of known parts and their associated default parameters). Compare the complete Squad-provided config file for the now-obsolete (pre-1.4) TR-XL Stack Separator with the corresponding code in the DecouplerShroud.cfg file:

@PART[stackSeparatorBig]:FOR[DecouplerShroud]{
	@MODULE[ModuleDecouplerShroud]{
		%defaultBotWidth = 2.5
		%defaultVertOffset = -0.01
		%nSides = 24
		%defaultThickness = 0.15
		%bottomEdgeSize = .12
		%topBevelSize = .04
	}
}

All that the mod's configs do is allow pre-defined sizing/positioning parameters for the shroud-building code, instead of falling back to the "best guess" code - code which doesn't necessarily guess correctly, as you can see in the imgur album I posted with my config updates for the DLC conventional decouplers/separators. Compatibility for any HAS[@MODULE[ModuleDecouple]] part could be added this way, like parts from other mods, if those modders (or other community members) create the relevant configs and submit them to the navot. You actually see this quite a lot in the KSP community, for example there's a whole load of other-mod configs in ConnectedLivingSpace's configs folder for inter-mod compatibility.

As for the pending DLC-specific support (engine plate compatibility), the idea is that the isEnginePlate variable will be false by default for unknown parts, and false in the config file for all base-game stock parts as well as all the currently-included (normal decoupler) DLC parts. When it's false, the mod will behave the same way it already does, so non-DLC players won't notice a thing. The only time it will be true is for config-file-specified DLC engine plates, so that's the only time the new functionality will be seen.

Link to comment
Share on other sites

7 minutes ago, wookiee_goldberg said:

Nobody should be under the impression that the DLC is required for the mod to work. The mod isn't even fully supportive of the DLC yet (the mod ignores EnginePlate parts for now), and even when it is, that will be "in-addition-to" the existing non-DLC support; it's not an "either/or" situation. So the 'designed to work with dlc but may work without' disclaimer you requested really isn't accurate to the present or future of the mod, it's just far more effective to put the DLC-specific code into the main mod instead of forking it into two separate mods (one with DLC support and one without).

Yea, sorry - I thought @navot was wondering about using the .cfg code that so far has only been found used in Squad's DLC parts, and was responding to that question. I think we are singing from the same sheet.

Thanks for working with navot to keep this awesome mod relevant!

Peace.

Link to comment
Share on other sites

Just now, theJesuit said:

Yea, sorry - I thought @navot was wondering about using the .cfg code that so far has only been found used in Squad's DLC parts, and was responding to that question. I think we are singing from the same sheet.

Thanks for working with navot to keep this awesome mod relevant!

Peace.

The 'variant' code exists in other non-DLC parts in 1.4 as well (like the skin-switcher for the fuel tanks), just none of those non-DLC parts matter for this mod, that I'm aware of, since the only engines and decouplers that change depending on variant are DLC parts. So he can still use fuel tank configs for research and debug logs in the meantime, to get a feel for how to detect variants, and then apply that knowledge to the length-switcher variant logic in the engines/plates for the DLC-support code.

Link to comment
Share on other sites

Is there a way to use a MM config to change the textures used? I know I can change the ShroudTexturesConfigs.cfg, but would rather be able to implement my change outside of your folder so I don't lose my changes after a mod update.

Thanks!

Edited by Tyko
Link to comment
Share on other sites

@Gordon Dry I'm not quite sure what is happening there. I only use the default KSP Specular shader... Are you using a self made texture?

@wookiee_goldberg thanks for clearing up confusion. Also, I don't think that engine plate support will come any time soon...

@Tyko You don't even need MM for that. You can add your own textures by simply creating your own text file somewhere in the gamedata folder (so it doesn't get changed by updates) with a ShroudTexture node inside (this for example):

ShroudTexture {
	name = ExampleTexture
	texture = CustomTextures/Example
	normals = CustomTextures/Example_Normals
}

Also, if you have some good textures and want to share them, let me know.

Link to comment
Share on other sites

Also, I just put a new version of the mod on GitHub. The main difference is that the texture is now split into 3 textures (inside, top and outside texture). This should make making custom textures easier. I actually made this a while back, but didn't publish it because I got frustrated with my terrible texturing skills. The textures on that version are still test textures...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...