Jump to content

[WIP] Variant Mass Effect


Grassland

Recommended Posts

Description:
This is a KSP mod to change mass when choosing variants.
Currently, you have to choose a variant as well as the intended B9PS subtype to make it work, in the part’s Part Action Window by right-clicking in the VAB or SPH.


“Full” and “Shroud” are left unchanged.

“Mid” and “Truss mount” have mass, cost, and max thrust cut by 5%. Gimbal range and crash tolerance are cut by 50%.

“Bare” have mass, cost, and max thrust cut by 10%. Gimbal range and crash tolerance are cut by 75%.

The new Poodle Variant (single bell) also gets 50% more mass, max thrust, crash tolerance and cost, with gimbal cut by 50%.

The Rover Variant of Mk2 Lander Can gets 15% less mass and monoprop capacity.


Dependency:
Module Manager.
B9 Part Switch.
This mod will not work without them.


Contact me at forum thread:
https://forum.kerbalspaceprogram.com/index.php?/topic/196551-wip-variant-mass-effect/&tab=comments#comment-3844770

Source:
https://github.com/Grassland-CN/Variant-Mass-Effect

 

Download:

https://github.com/Grassland-CN/Variant-Mass-Effect/releases/tag/V0.2

 

 

 

 

To-do list:
0. Merge stock variants with B9PS. {Unknown}
1. Add Making History engines support. {Soon}
2. Add feature of more drag when bare/mid/truss instead of shroud/full. {Later}
3. Add “Bare” part variants or subtypes to “Thud”, “Twitch”, “Rhino”. {Later}

 

 

License: MIT

Thanks:

Module Manager and B9 Part Switch.

@michafor giving me a start of touching mods.

@Xt007 and @hemeac for giving me a guide of writing this mod.

Contributors:
@Grassland

 

Changelog:

Spoiler

Changelog of mod Variant Mass Effect.

- Version 0.0 - (2020/08/27, UTC+8)
Originally Written.

- Version 0.1 - (2020/08/28, UTC+8)
Fix issues
Introduc new dependency: B9PS.
Initial Release.

- Version 0.2 - (2020/08/29, UTC+8)
Bugfix.
Add separate config files for Poodle.
Add patch for mk2LanderCabin_v2.

 

I suddenly found out that the wiki does not provide internal part names for MH engines. That is provided for stock ones though.

So I need help. If you would like to contribute, fork me on Github!

See this if you would like to help me with this mod. (Or skip some parts of it if you already know a lot about module manager and B9PS.)

Edited by Grassland
This mod is only tested on KSP 1.10.1. But it should work for versions up to 1.6 if you had the correct version of Module Manager and B9PS.
Link to comment
Share on other sites

I will make a release in Add-on Releases when I succeed to change values as expected, and finish writing MH patches.

I do not own MH and have no intention of buying it. I will read values and config names from the wiki, and turn to YOU to test it.

Link to comment
Share on other sites

10 minutes ago, Stone Blue said:

Sounds interesting...
howver, maybe I'm missing something.. Shouldnt "Bare" have a max thrust *increase*?... due to less mass? vOv

I thought there should be some "penalties" when using variants with less mass, so I chose to lower thrust.

The idea was, I think the shroud also includes robotics parts inside the engine [which is very complex IRL as we all know]. So I thought removing some parts of the engine will lose its capabilities, such as thrust and gimbal. Crash tolerance was because the engine lost shroud and truss for protection.

Thrust decrease should not affect TWR on a large scale as it's just a 90% cut at most. But you could get a little more Delta V and save some cash.

 

Also: issue fixed by testing on the poor terrier, and currently re-writing patches for every enginge.

Link to comment
Share on other sites

28 minutes ago, Grassland said:

I thought there should be some "penalties" when using variants with less mass, so I chose to lower thrust.

The idea was, I think the shroud also includes robotics parts inside the engine [which is very complex IRL as we all know]. So I thought removing some parts of the engine will lose its capabilities, such as thrust and gimbal. Crash tolerance was because the engine lost shroud and truss for protection.

Thrust decrease should not affect TWR on a large scale as it's just a 90% cut at most. But you could get a little more Delta V and save some cash.

 

Also: issue fixed by testing on the poor terrier, and currently re-writing patches for every enginge.

Idk what to feel about this. Would it not be more realistic to tweak the engines aerodynamic properties when one removes the shroud? 

Link to comment
Share on other sites

15 minutes ago, Cattette said:

Idk what to feel about this. Would it not be more realistic to tweak the engines aerodynamic properties when one removes the shroud? 

Well, practically, not now. It may take some time to study how the stock aero system works...

I looked into some engine configs and found out that all have: (This is from Terrier)

dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2

And for docking ports: (This is from the standard port)

dragModelType = default
maximum_drag = 0.25
minimum_drag = 0.25
angularDrag = 0.5

MK3 Cargo Bay Long:

dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.3
angularDrag = 1

The drag feature seems a bit harder to understand than mass, cost and thrust, etc.. I may look into that in the future of several weeks.

Actually, I also first thought about drag tweaks, but I got so confused... I may ask people for help for this. If you know what these values mean and tell me how to edit them, what about I add you to contributors?

Basically and straightforwardly, (I think) Shroud/Full drag < Truss/Mid drag <Bare Drag. Adding it to the to-do list.

 

I have completed editing the patch for stock engines applying the current features, and I will upload it to Github right away.

Edited by Grassland
Link to comment
Share on other sites

The test was worth it.

Only the Ant, the Spider, the Spark, and the Terrier showed changes in mass. The 2.5m parts didn’t work. At least that’s what was seen in the VAB. There seems to be a problem. I’ll still try to upload the files but no release now.

Link to comment
Share on other sites

The issues are fixed with B9PS and I'll upload new patches later. The original post have been updated.

However, the stock variants and B9PS Subtypes are not merged together so you actually have two rows of choices in the VAB now. One for stock variant, which changes the engine graphics, nodes, etc.. Another is B9PS subtypes, for actual numerical changes of mass, cost, etc..

Link to comment
Share on other sites

There are “B9 Part Switch Serious Warnings”. But the intended changes are applied. I suppose there are no bugs with this release.

Spoiler

I couldn’t believe how a program can run without bugs.:)

 

Edited by Grassland
Link to comment
Share on other sites

I will add VME behavior to Mk2 Lander Can and have a version update. Monoprop will be cut according this poll voted by 4 members. And monoprop cut makes more sense than EC cut, anyways. Because there is a "service bay" on either side of the lander can, the mass will be cut by 15% and monoprop cut by 15%.

Spoiler

Mechanics to open/close the door without man power accounts for a significant portion of mass, if this is applied.

 

Link to comment
Share on other sites

I suddenly found out that the wiki does not provide internal part names for MH engines. That is provided for stock ones though.

So I need help. If you would like to contribute, fork me on Github!

See this if you would like to help me with this mod. (Or skip some parts of it if you already know a lot about module manager and B9PS.)

Spoiler

Step 1:

Copy-Paste this code into some sort of blank cfg. Name it VMEMakingHistory.cfg and save it.

Spoiler


@PART[liquidEngine3_v2]					// Terrier engine
{
	MODULE
	{
		name = ModuleB9PartSwitch
		moduleID = EngineSwitch
		SUBTYPE
		{
			name = Shroud
			title = #autoLOC_8007114			// Stock same
			primaryColor = #ffffff				// Stock same
			secondaryColor = #999999			// Stock same
		}
		SUBTYPE
		{
			name = TrussMount
			title = #autoLOC_8007113			// Stock same
			primaryColor = #999999				// Stock same
			secondaryColor = #000000			// Stock same
			addedMass = -0.025				// Stock 0.5
			addedCost = -19.5				// Stock 390
			crashTolerance = 3.5				// Stock 7
			MODULE
			{
				IDENTIFIER
				{
					name = ModuleEngines
				}
				DATA
				{
					maxThrust = 57			// Stock 60
				}
			}
			MODULE
			{
				IDENTIFIER
				{
					name = ModuleGimbal
				}
				DATA
				{
					gimbalRange = 2			// Stock 4
				}
			}
		}
		SUBTYPE
		{
			name = Bare
			title = #autoLOC_8007115			// Stock same
			primaryColor = #d96200				// Stock same
			secondaryColor = #999999			// Stock same
			addedMass = -0.05				// Stock 0.5
			addedCost = -38					// Stock 390
			crashTolerance = 1.75				// Stock 7
			MODULE
			{
				IDENTIFIER
				{
					name = ModuleEngines
				}
				DATA
				{
					maxThrust = 54			// Stock 60
				}
			}
			MODULE
			{
				IDENTIFIER
				{
					name = ModuleGimbal
				}
				DATA
				{
					gimbalRange = 1			// Stock 4
				}
			}
		}
	}
}

 

 

Step 2:

Go to this part of the cfg. At the beginning.


@PART[liquidEngine3_v2]					// Terrier engine

Then change it into:


@PART[InternalPartName]					// BlahBlah engine

The part name should be found in the cfg file of the MH engine. There is a line "name = InternalPartName". The "BlahBlah" should be the (brief) engine name that we often refer to. For instance, "Cheetah Engine"

 

Step 3:

Go to this part of the cfg.


SUBTYPE
		{
			name = Shroud
			title = #autoLOC_8007114			// Stock same
			primaryColor = #ffffff				// Stock same
			secondaryColor = #999999			// Stock same
		}

Change "name = Shroud" into "name = A". A should be the name of the Shroud/Full variant of the engine in ModulePartVariants in the engine cfg. Perhaps "Full" or "Shroud", I don't know.

Change "title = #autoLOC_8007114" into "title = #B" B should be the one fould after the "displayName = #..." in the Shroud/Full variant of the engine in ModulePartVariants in the engine cfg.

Change primaryColor and secondaryColor into the same thing found the the Shroud/Full variant of ModulePartVariants.

 

Step 4: Only needed if there are 3 variants. This is for Mid or TrussMount. If it's just Shroud and Bare, or Full and Bare, Skip to step 5.

Go to this part of the cfg.


		SUBTYPE
		{
			name = TrussMount
			title = #autoLOC_8007113			// Stock same
			primaryColor = #999999				// Stock same
			secondaryColor = #000000			// Stock same
			addedMass = -0.025				// Stock 0.5
			addedCost = -19.5				// Stock 390
			crashTolerance = 3.5				// Stock 7
			MODULE
			{
				IDENTIFIER
				{
					name = ModuleEngines
				}
				DATA
				{
					maxThrust = 57			// Stock 60
				}
			}
			MODULE
			{
				IDENTIFIER
				{
					name = ModuleGimbal
				}
				DATA
				{
					gimbalRange = 2			// Stock 4
				}
			}
		}

Step 4.1

Do the same thing as step 3, but for the Mid or TrussMount variant.

Step 4.2

Find "mass=C" in the MH engine cfg file. Copy the value. Let's call it "C".

Paste C to the "//Stock blah" of addedMass.

Calculate D=C * 0.05, and then change "addedMass = -0.025" into "addedMass = -D".

Step 4.3

Do step 3.2 again for addedCost.

Do step 3.2 again for crashTolerance, but make D=C*0.5 and "crashTolerance = D" (Not minus D.)

Do step 3.2 again for maxThrust, but make D=C*0.95 and "maxThrust = D" (Not minus D.)

Do step 3.2 again for gimbalRange, but make D=C*0.5 and "gimbalRange = D" (Not minus D.)

Step 4.4

Go to the MH engine cfg and look for something like this:


MODULE
{
	name = ModuleEngines
	...
}

If you can find this, then the editing of this subtype is complete.

If you find something like this instead:


MODULE
{
	name = ModuleEnginesFX
	...
}

Then change


IDENTIFIER
{
	name = ModuleEngines
}

into


IDENTIFIER
{
	name = ModuleEnginesFX
}

Step 4.4 is really important or bugs appear.

 

Step 5

Basically, do the same thing as step 4 for the Bare variant, but:

For addedMass and addedCost and maxThrust, D=C * 0.1

For crashTolerance and gimablRange, D=C *0.25

 

Step 6

Add a [NEED:<MH>] to the @PART[...] so that people without MH don’t see bugs. I don’t know MH installation folder, so Please help.

 

Step 7

Do Step 1 to 6 multiple times for all engines with variants in Making History. Your hard work is really appreciated.

 

Step 8

Move this file to GameData/VariantMassEffect/Config/VMEMakingHistory.cfg

Do a test run by starting KSP with only Squad, Making History, Module Manager, B9 Part Switch, and Variant Mass Effect in the GameData folder. You are suggested to start a new sandbox save so it doesn't affect your saves if there are bugs.

Check if changes are applied successfully.

Spoiler

To check, you can go to VAB, select a small LFO tank as the base part.

Then add the engines you have written config files for, under the fule tank, one at a time.

Show all data for the stock Delta V window. Select between subtypes to see if changes are applied.

Then upload the file to your fork of VME on Github and create a pull request!

Thank you very much for helping me with VME!

 

Edited by Grassland
PLS Help me!
Link to comment
Share on other sites

This is a pretty interesting little thing that's going on here. I've entertained the idea of replacing stock variants entirely with B9PS, especially for where some variants very clearly add potential fuel volume.

I just have one piece of criticism. I don't like the idea of touching thrust. For that to logically happen, the turbopumps of a given engine would need to be calibrated. And how would messing with aesthetics end up messing with that?

Some exceptions would be fine imo, such as the dual-bell Poodle revamp vs the ESA uber-Poodle. Same 'part' and yet a world apart. The Isp curve on that would likely change too because the bell shape and size would be sufficiently different between them.

Link to comment
Share on other sites

2 hours ago, JadeOfMaar said:

This is a pretty interesting little thing that's going on here. I've entertained the idea of replacing stock variants entirely with B9PS, especially for where some variants very clearly add potential fuel volume.

I just have one piece of criticism. I don't like the idea of touching thrust. For that to logically happen, the turbopumps of a given engine would need to be calibrated. And how would messing with aesthetics end up messing with that?

Some exceptions would be fine imo, such as the dual-bell Poodle revamp vs the ESA uber-Poodle. Same 'part' and yet a world apart. The Isp curve on that would likely change too because the bell shape and size would be sufficiently different between them.

This mod is currently not complete and I will listen from the community. I’m starting school so future updates will be slow as I will take my time to learn advanced mathematics and also deeper into Physics.The trust cut was to have some sort of “penalty” for less mass. The cut may be lower if I can figure out the best way to deal with drag. I will work on the thrust and Isp curve though. All the figures just came out of nowhere in my brain as of now, and I will examine them after completing most of the mod’s features. That check should be based on the engine’s IRL analogs, if they weren’t created completely by KSP. It could be in late October that I finally release the mod as V1.0 in the release sub forum, and anything can change significantly while a mod is under development.:D But for now I’d like to put things like 3D modeling for parts on the list, since these figures could edited in less than an hour if needed.

Thanks for your advice and I sincerely hope to make this mod better with all you guys!

Edited by Grassland
Link to comment
Share on other sites

I just took a look at the wiki again. Here it shows the mass, thrust, crash tolerance and all the values {temporarily} needed for this mod to function and has some penalty for less mass. I will write the config files myself. Also, I have learned that, in fact, Module Manager can give you a system to get values from config files via “some way”, so I will finish all the necessary cfg editing when I have time, and I shall only need the internal part names to make it work. I will acquire the cfg names later.

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