Jump to content

Mod that changes the mass of pods depending on kerbal occupancy.


kahlzun

Recommended Posts

Hi guys!

I am interested if anyone has developed, or is interested in developing, a mod that automatically adjusts the mass of the command pods based on the number of kerbals occupying them. (Possibly also the number of 'sample survey' datas stored within it also?)

As it currently stands, the EAS-1 chair is the only part which changes mass, perhaps the coding for that effect could be "Module Manager"ed onto the other pods?

Thanks for consideration,

Sam

Edit:

*Aqua* has kindly coded a plugin based on my request. Thread is here.

Edited by kahlzun
Link to comment
Share on other sites

I'm currently working on that. But I can't tell you when it'll be released.

There are some things which make me scrach my head (example: Kerbals going on EVA have an initial mass of 3.13 tons - why? I don't know.)

Edited by *Aqua*
Link to comment
Share on other sites

I'm currently working on that. But I can't tell you when it'll be released.

There are some things which make me scrach my head (example: Kerbals going on EVA have an initial mass of 3.13 tons - why? I don't know.)

I'm just happy someone's working on it.

Link to comment
Share on other sites

Wcyce7N.gif

First image: All capsules don't have a crew. CoM in neutral position.

Second image: Capsule has 3 crews (3 x 93.75 kg). CoM moves a bit to the front.

Third image: All capsules are fully manned (3 x 93.75 kg in the front + 3 x 4 x 93.75 kg in the back = 1406.25 kg!). CoM moves back.

I guess some plane engineers are going to be angry with me. ^^

Edited by *Aqua*
Link to comment
Share on other sites

I guess some plane engineers are going to be angry with me. ^^

http://i.imgur.com/Wcyce7N.gif

First image: All capsules don't have a crew. CoM in neutral position.

Second image: Capsule has 3 crews (3 x 93.75 kg). CoM moves a bit to the front.

Third image: All capsules are fully manned (3 x 93.75 kg in the front + 3 x 4 x 93.75 kg in the back = 1406.25 kg!). CoM moves back.

Nice work! good for added realism. Though 93kg seems a bit heavy for a kerbal :P

Link to comment
Share on other sites

A external command seat automatically changes it's part mass by 93.75 kg when a Kerbal boards or leaves it. That's where the number comes from. (I remember there was a discussion about that. People concluded that a Kerbal itself weights about 30 kg. The space suit is the heavy thing.)

You can tweak the Kerbal's mass in a config file if you think it's too much or not enough. I added that to allow modding (had RSS in mind where everything can have a different scale).

I'm almost finished. I still have to test a complete mission with several parts, in the editor, launching and recovering, EVAing and boarding, saving and loading, etc. When nothing goes wrong I'll release this small mod tonight or tomorrow.

Link to comment
Share on other sites

I guess some plane engineers are going to be angry with me. ^^

http://i.imgur.com/Wcyce7N.gif

First image: All capsules don't have a crew. CoM in neutral position.

Second image: Capsule has 3 crews (3 x 93.75 kg). CoM moves a bit to the front.

Third image: All capsules are fully manned (3 x 93.75 kg in the front + 3 x 4 x 93.75 kg in the back = 1406.25 kg!). CoM moves back.

It looks like you just made crew a resource. Does the mass actually change with Kerbal count?

Link to comment
Share on other sites

It's not a resource. I add a new KerbalMassModule to each part which can hold a crew. It changes the part's mass depending on how many Kerbals are in that part. In flight it queries the part's population to work. Ok... in a way it feels like a ressource.

Unfortunately Squad hasn't exposed a public API for the crew assignment in the editor. That's why I added a slider in the context menu to allow a quick and easy way to preview CoM changes. I just needed to do that. For example a MK3 passenger module can hold up to 16 Kerbals, so the difference between fully manned and and empty is 16 * 93.75 kg = 1.5 tons. If you can't preview that difference in the editor people will be bugged.

Link to comment
Share on other sites

There's a switch in the config file to choose one of both behaviors. By default it assumes the initial part mass is without Kerbals.

Currently I'm still trying to figure out how to not save the new module to a save file. The reason for that is to guarantee flawless behavior if the user removed the mod. It already works on the persistence file but not on the VAB save file.

Edit:

I'm sorry, you have to wait a bit more. There is a major problem with saving and loading. The changed mass gets written to the save file. The next time the game loads that save my mod adds more mass to it. So on every saving and loading the part mass increases. My attempts to prevent that didn't work so far.

If this keeps on I'll have to include ModuleManager and rewrite a lot of code. That's a thing I still hope to avoid, even when it has some advantages.

About the switch I mentioned in this post: I'm not sure if it's a good idea to treat the default mass as the total mass including Kerbals. There are some parts like the external command seat which weight less than a Kerbal (50 kg <-> 93,75 kg). Because of the special behavior of parts like the seat (it auto-adds/auto-substracts Kerbal mass on boarding or EVAing) I added blacklist options in the cfg for parts and parts with specific modules. My mod will then ignore them.

I can also add an option to treat these parts in a special way: The mod could reverse what ever that part does with its mass and then apply my mass changes (useful when you change the Kerbal mass in the cfg). Do you want that funtionality?

Edited by *Aqua*
Link to comment
Share on other sites

That would make sense, it would allow changes to Kerbal mass to work as expected.

Though it probably isn't terribly important overall, if its going to be a lot of work, you could always release it 'as is' and have that as a later 'stretch goal'..

Edited by kahlzun
Link to comment
Share on other sites

I guess now we are also able to use kerbals as counter balance weight.

"Kerbals, today you are tasked with an important duty, one that may means success or failure of the entire mission. You must sit here, strap on your seat belt and...remains like that for the rest of the flight. No wiggling in your seat, no taking your seat belt off, and most importantly, no going to bathroom. May the stars bless your souls."

Link to comment
Share on other sites

I am not saying otherwise. It's just that there is not code in the seat module to deal with the mass.

Adding the mass with a part module leads to added complexity since other module might also try to change the mass.

Link to comment
Share on other sites

FYI the seat does not add anything. The mass comes from the kerbal itself, who is attached to the seat.

That means I don't have to change anything of the seats behavior - as long as there isn't a surprise in the the code. I didn't test that out yet. Thank you for your information! :)

Adding the mass with a part module leads to added complexity since other module might also try to change the mass.

The other modules can change the part's mass as they like. That's no problem. I'm only adding or substracting mass on EVAing, boarding and transfering. I do not reset the part's mass to a default value or something like that so other module's changes still have their effect applied.

That's reason why I didn't released yet. I just want to make sure that I don't blow up the game.

Edited by *Aqua*
Link to comment
Share on other sites

I found a surprise in the code. The mass of an EVAed Kerbal is calculated by the KerbalEVA part module. It has an initial mass ('initialMass') of 3.125 tons. That get's multiplied by a factor ('massMultiplier') of 0.03 which results in a final mass of 93.75 kg.

I don't know why Squad did it but that also influences the jet pack. Setting the initialMass to 0.05 and the multiplier to 1 resulted in no more visible RCS exhaust. I didn't test it but I assume the thrust changed also.

Edit: Further test showed it doesn't seam to influence the jet pack. It was another thing I did.

Still I don't know why they came up with this kind of mass calculation.

Edited by *Aqua*
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...