Jump to content

Mass Effect - possible in KSP?


Atlessa

Recommended Posts

(If someone has already done this, I will happily accept a link. Google only turned up ship models taken from the Mass Effect series, which are awesome in their own rights, but not what I'm looking for...)

 

What I'd like to have... and maybe make myself if necessary, is a part in the game that functions as a Mass Effect core from the sci fi series of the same name.

 

For those who don't know (BLASPHEMY!  jk), a Mass Effect core has physics bending properties. Applying electricity to a 'magical' new Element, Element Zero (or Eezo), will change the effective newtonian Mass of everything within. This has multiple applications within the game's lore, from enabling incredibly high yield weaponry (reduce projectile mass to near zero, apply acceleration to a fraction of c, revert to normal mass) to faster than light space travel  (...  how exactly this goes around general and special relativity is never explained.  But hey, it's sci fi.)

 

My thought was to make a 'reactor' of sorts that eats a lot of EC  (upwards of 1000EC/s) to reduce the effective mass of the ship it is attached to by a significant margin (up to 90%)

If this is not possible in engine, maybe the reactor itself could change it's mass to a negative value to offset the other attached parts mass?

If this also doesn't work as intended,  maybe the reactor could adjust the local gravity parameters according to EC consumed?

If that is not possible either, maybe it could temporarily boost the torque strength of reaction wheels and increase the ISP of all attached engines and RCS ports?

 

... or any other way to achieve similar (mass) effects.

 

 

 

If I do end up having to create this myself (yay for learning new skills!), I may actually make this depend on discovering, and mining Element Zero.  Say... on Moho or Dres, like in the Mass Effect games. And maybe I'll add a little something on Duna as a nod to the protheans, too. :D

Link to comment
Share on other sites

There's a handful of warp drive mods around already. 

While the story and functionality of each differs some, they all work on the same principal of "cheating" vessels into different orbits. 

Check some of them out and see if they fit your needs, and if not, use some of their ideas to help shape yours. 

Link to comment
Share on other sites

1 hour ago, Gargamel said:

There's a handful of warp drive mods around already. 

While the story and functionality of each differs some, they all work on the same principal of "cheating" vessels into different orbits. 

Check some of them out and see if they fit your needs, and if not, use some of their ideas to help shape yours. 

That's not what I'm looking for, though, nor does it answer my question, I don't want a warpdrive. And if I did, RoverDude already has me covered. :D

 

I want an 'authentic' Mass Effect drive.  And I'm willing to put in the work of learning the tools and creating the mod myself.  I just want to know if it is even remotely possible in the engine KSP uses.

Link to comment
Share on other sites

26 minutes ago, Atlessa said:

That's not what I'm looking for, though, nor does it answer my question, I don't want a warpdrive. And if I did, RoverDude already has me covered. :D

Understood now.

8 hours ago, Atlessa said:

faster than light space travel

That's the part that threw me off.

 

Sorry, I don't have the answer you are looking for then.   

But the off the cuff un-informed response would be that it would be very hard to do.  I believe everything in the game is loaded at startup, and the masses are determined then, so you probably couldn't alter the masses of the parts during the game without reloading the dbase.

But as you mentioned, if you create a resource that has negative mass, and maybe special tanks that hold that resource, you could make a generator that would create the negative mass to offset the ships mass.    Add a consumption rate of the negative resource, so the generator would have to work harder and harder to create more and more negative mass, that would add a warm up and warm down time for the effect.  

Link to comment
Share on other sites

It is indeed possible and not that hard to change the mass of parts.

It is already done by various fuel switching mods (but for other reasons). You simply have to write a PartModule which implements the IPartMassModifier interface. This interface allows to change the dry mass of parts. It has these two functions.

Quote
float  GetModuleMass (float defaultMass, ModifierStagingSituation sit)
  Return the amount to modify the original part's dry mass by. Returned values are added to the base mass. (0 means no effect) More...
 
ModifierChangeWhen  GetModuleMassChangeWhen ()
  Return under which circumstances the modulemass changes More...

Taken from: https://kerbalspaceprogram.com/api/interface_i_part_mass_modifier.html

An example could look something like this:

class ModuleMassEffectPart : PartModule, IPartMassModifier
{
	private float modifier = 0.0f;
    //Public method the change the mass of a part (e.g. from a "Mass Drive"/"Eezo Core"
	//Set the e.g. -0.9 the reduce the dry mass of the part by 90%
	public void setMassModifier(float modifier)
	{
		this.modifier = modifier;
	}
	
	//Return the modifier of the mass
	public float GetModuleMass(float defaultMass, ModifierStagingSituation sit)
	{
		return defaultMass*modifier;
	}

	//Set when the mass can change (which can by anytime so CONSTANTLY)
	public ModifierChangeWhen GetModuleMassChangeWhen()
	{
		return ModifierChangeWhen.CONSTANTLY;
	}
}

All you'd have to do then is to add this module to all parts via Modulemanager and write another PartModule (e.g. the ModuleMassEffectCore) to activate/deactivate the Mass Effect by calling the setMassModifier function from each ModuleMassEffectPart from each part in the vessel. This can even be enhanced to scale the EC needed to reduce the vessels mass with the overall mass of the vessel.

However this does only change the dry mass of the parts, meaning that any mass from fuel still remains the same as before. You might have to also take the mass of the fuel into consideration in the GetModuleMass function

Edited by Nils277
Link to comment
Share on other sites

On 4/17/2018 at 12:43 PM, Nils277 said:

It is indeed possible and not that hard to change the mass of parts.

It is already done by various fuel switching mods (but for other reasons). You simply have to write a PartModule which implements the IPartMassModifier interface. This interface allows to change the dry mass of parts. It has these two functions.

Taken from: https://kerbalspaceprogram.com/api/interface_i_part_mass_modifier.html

An example could look something like this:


class ModuleMassEffectPart : PartModule, IPartMassModifier
{
	private float modifier = 0.0f;
    //Public method the change the mass of a part (e.g. from a "Mass Drive"/"Eezo Core"
	//Set the e.g. -0.9 the reduce the dry mass of the part by 90%
	public void setMassModifier(float modifier)
	{
		this.modifier = modifier;
	}
	
	//Return the modifier of the mass
	public float GetModuleMass(float defaultMass, ModifierStagingSituation sit)
	{
		return defaultMass*modifier;
	}

	//Set when the mass can change (which can by anytime so CONSTANTLY)
	public ModifierChangeWhen GetModuleMassChangeWhen()
	{
		return ModifierChangeWhen.CONSTANTLY;
	}
}

All you'd have to do then is to add this module to all parts via Modulemanager and write another PartModule (e.g. the ModuleMassEffectCore) to activate/deactivate the Mass Effect by calling the setMassModifier function from each ModuleMassEffectPart from each part in the vessel. This can even be enhanced to scale the EC needed to reduce the vessels mass with the overall mass of the vessel.

However this does only change the dry mass of the parts, meaning that any mass from fuel still remains the same as before. You might have to also take the mass of the fuel into consideration in the GetModuleMass function

 

Ah.  mhmm... yes...  I know some of these words...

 

 

Jokes aside, this sounds like pretty much the best bet to go for it. Looks like I got some learning to do.  Any tips as to where I should start?  (I bet there's a modding tutorial somewhere?)

Can I do a similar script to adjust fuel mass as well?  Or is that more hardcoded?

Link to comment
Share on other sites

  • 3 weeks later...
On 4/19/2018 at 4:27 AM, Atlessa said:

Any tips as to where I should start?  (I bet there's a modding tutorial somewhere?)

Take a look at the link below ... it is for the naval mines in Enemy Mine

I use Ipartmassmodifier in it to adjust the mass of the naval mines so that they will automatically deploy to the selected depth and stay at that depth .... should give you an idea of where to start, just be aware if you use my code or modify it for your use the license on the code must remain as GPLv3

https://github.com/DoctorDavinci/Enemy-Mine/blob/master/EnemyMine_Plugin/Mines/ModuleEnemyMine_Naval.cs

Edited by DoctorDavinci
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...