Jump to content

[1.8.1 - 1.12.5] Interstellar Fuel Switch (IFS) 3.29.5


FreeThinker

Recommended Posts

10 hours ago, Nertea said:

@FreeThinker: Care to explain this thing I found when debugging a user's install containing IFS?



@RESOURCE_DEFINITION[Actinides]
{
	@isTweakable  = true
}

@RESOURCE_DEFINITION[DepletedFuel]
{
	@isTweakable  = true
	@density = 0.0117
}

@RESOURCE_DEFINITION[LqdCO2]
{
	@flowMode = STACK_PRIORITY_SEARCH
}

@RESOURCE_DEFINITION[Water]
{
	@flowMode = STACK_PRIORITY_SEARCH
}

@RESOURCE_DEFINITION[ElectricCharge]
{
	@unitCost = 0.00002
}

@RESOURCE_DEFINITION[Megajoules]
{
	@unitCost = 0.02
}

@RESOURCE_DEFINITION[Carbon]
{
	@isTweakable = true
	@isVisible = true
	@transfer = PUMP
	@flowMode = ALL_VESSEL
}

@RESOURCE_DEFINITION[Lithium6]
{
	%displayName = Lithium-6
}

Care to explain to me why you're patching common library resources in this also common library mod? Some of these changes will break mods! DepletedFuel density change will break NFT, ElectricCharge cost change will break all batteries' costs.

I don't know why the density of DepletedFuel is modified, it appears to be a (merge) mistake. There is no reason to keep it.  I will remove it ASAP.

The unit cost of Electric charge falls outside the scope of CRP. I have given a small cost to ElectricCharge because it can can be converted into MegaJoules which allows you to generate other resources which are not free. 

Edited by FreeThinker
Link to comment
Share on other sites

42 minutes ago, FreeThinker said:

I have given a small cost to ElectricCharge because it can can be converted into MegaJoules which allows you to generate other resources which are not free. 

Whilst this is probably true of the interstellar mod? there are/were quite a few mods which bundled IFS to use its clever resource switching capability, but they were not trying to buy into having the previously free resource of ElectricCharge suddenly cost.

In my previous games I would have IFS for the very purpose of resource switching, but only IFS as I was playing some fairly basic games with a little Life Support thrown in. Adding ElectricCharge costs to users would greatly impact their gameplay.

I would suggest that this particular part of the patch should remain in the main Interstellar mod rather than IFS?

Link to comment
Share on other sites

2 hours ago, FreeThinker said:

The unit cost of Electric charge falls outside the scope of CRP. I have given a small cost to ElectricCharge because it can can be converted into MegaJoules which allows you to generate other resources which are not free. 

This is kinda up for debate, given it breaks stuff (and whether it even makes sense is an entirely different discussion).  I expect there are other ways of solving whatever problem it is you're looking to solve, without introducing a breaking change to one of the most basic resources in the game.  And I agree with @steedcrugeon - this seems a weird place to put such a sweeping change.  

Link to comment
Share on other sites

1 hour ago, steedcrugeon said:

Whilst this is probably true of the interstellar mod? there are/were quite a few mods which bundled IFS to use its clever resource switching capability, but they were not trying to buy into having the previously free resource of ElectricCharge suddenly cost.

In my previous games I would have IFS for the very purpose of resource switching, but only IFS as I was playing some fairly basic games with a little Life Support thrown in. Adding ElectricCharge costs to users would greatly impact their gameplay.

I would suggest that this particular part of the patch should remain in the main Interstellar mod rather than IFS?

@RoverDude Notice that in a way this is already the case. IFS is split into core (which is used by other mods only interested into switching component) and full IFS which include new parts, MM scripts which modify all stock fuel tanks and a few resource tweaks (This mod can be used stand-alone and is used by KSPI as a soft requirement). What I could do is make the resource fixes optional with Patchmanager

Edited by FreeThinker
Link to comment
Share on other sites

24 minutes ago, RoverDude said:

This is kinda up for debate, given it breaks stuff (and whether it even makes sense is an entirely different discussion). @steedcrugeon

 

Well, I think the term  "breaking stuff" is too strong in this case. Most of the time, you will not notice anything as the cost of a full battery will be the same as before, only  if you modify the battery content in the VAB or return back to KTC you might notice it value is slightly reduced.

24 minutes ago, RoverDude said:

 I expect there are other ways of solving whatever problem it is you're looking to solve, without introducing a breaking change to one of the most basic resources in the game.  And I agree with @steedcrugeon - this seems a weird place to put such a sweeping change.  

 

Of course, there are other solutions but this patch was used making conversion between ElectricCharge and Megajoules easier a besides that it a kind of game balance patch (because electric power is not free in the real world either, and empty battery are worth less than full batteries). I understand you might not agree with it but it is still a choice

Edited by FreeThinker
Link to comment
Share on other sites

See @Nertea's point above.

Screwing with stock resources is kinda a jerk move.  Especially when someone who has a very large and popular mod catalog like Nertea says 'Hey - you're breaking stuff'.  Plus, ridiculously exploitable so it is also a bad design.  

I'm not opposed to bad design... it is how people learn.  I am only opposed to bad design when it messes with other people.

2 hours ago, FreeThinker said:

(because electric power is not free in the real world either, and empty battery are worth less than full batteries)

This is just...  bad.  

I'd seriously reconsider this.  I mean, it is your mod and all...  but there are ways of handling breaking mods, and I'd rather we not head down that path.

Link to comment
Share on other sites

14 minutes ago, DStaal said:

Build ship out of empty batteries and solar panels, launch, wait, recover, profit.

So you can build a solar farm. Given the low value of electric charge, That would be a cheesy way to make a tiny amount of credits. Essentially what you do it trade time into credits. The same happens if you start mining for resources anywhere. 

In my view, the real problem is that stock KSP gives you back the same value as bought it. In the real world, this never happens.  A possible solution would introduce a part module which would decrease the value of a part after being bough. and it would reduce in value after being used longer.

This is indeed a good idea and planned something similar for KSPI reactors which despite getting radiated, still sold for the same value as you bought, which is insane.

Edited by FreeThinker
Link to comment
Share on other sites

4 minutes ago, FreeThinker said:

So you can build a solar farm. Given the low value of electric charge, That would be a cheesy way to make a tiny amount of credits. Essentially what you do it trade time into credits. The same happens if you start mining for resources anywhere. 

In my view, the real problem is that stock KSP gives you back the same value as bought it. In the real world, this never happens.  A possible solution would introduce a part module which would decrease the value of a part after being bough. and it would reduce in value after being used longer.

That's a low-level change to how the entire game is constructed, not something that should be expected by a simple add-on for switching fuels.  (And yes, you have both a 'core' and a 'full release' - but the 'core' points to the full release when it gets updated, and players are likely to just drop it in.)

 

You may have a point.  *Here* isn't the place to demonstrate or argue for that point.  KSP-I or a new mod would be the right place.

Link to comment
Share on other sites

16 hours ago, goldenpsp said:

I would tend to agree with the sentiment of others.  For a mod that deals with tank switching, it seems out of scope to have resource tweaks here.

Although it might have started as a pure fuel switching mod it much more than that. It is slowly growing into something that might be described as a Storage Solution Mod. Perhaps it an idea to split it up into a pure Switch mod, which would be free of any MM script or balance tweaks and separate Interstellar Storage Module for KSPIE.

Edited by FreeThinker
Link to comment
Share on other sites

4 minutes ago, FreeThinker said:

Although might have started as a pure fuel switching mod it much more than that. It is slowly growing into something that might be described as a Storage Solution Mod. Perhaps it an idea to split it up into a pure Switch mod, which would be free of any MM script or balance tweaks and separate Interstellar Storage Module for KSPIE.

Yes I guess based at least off of the description in the OP there is nothing that suggests it does or should have any balance tweaks.  If these balance tweaks etc are primarily for your KSPIE, just out of curiousity why not have those MM scripts and balance tweaks in that mod?

Link to comment
Share on other sites

7 minutes ago, goldenpsp said:

 If these balance tweaks etc are primarily for your KSPIE, just out of curiousity why not have those MM scripts and balance tweaks in that mod?

2

Actually, the reason they are defined in IFS is that they are required to make them function correctly. For instance, the cost of electric charged is used by the  Super Capacitator to automatically convert between ElectricCharge and Megajoules. If I move this modification to KSPI, this part would no longer function.

Edited by FreeThinker
Link to comment
Share on other sites

4 minutes ago, FreeThinker said:

Actually, the reason they are defined in IFS is that they are required to make them function correctly. For instance, the cost of electric charged is used by the  Super Capacitator to automatically convert between ElectricCharge and Megajoules. If I move this modification to KSPI, this part would no longer function.

Would an 'AFTER' or 'BEFORE' statement in the MM patch help?  It seems like the type of thing those are for.

Link to comment
Share on other sites

6 hours ago, FreeThinker said:

@RoverDude Notice that in a way this is already the case. IFS is split into core (which is used by other mods only interested into switching component) and full IFS which include new parts, MM scripts which modify all stock fuel tanks and a few resource tweaks (This mod can be used stand-alone and is used by KSPI as a soft requirement). What I could do is make the resource fixes optional with Patchmanager

Really? Because if i wanted to use IFS for mesh and fuel switching in my own mod and i followed the current instructions within the OP i'd most certainly have have all those resource definitions included as they are within the InterstellarFuelSwitch folder that you state should be included.

Where is this core version you mention?

Link to comment
Share on other sites

@RoverDude Alright, alright, obviously I'm alone in this, I will remove all cost from ElectricCharge and MegaJoule and use an alternative solution.

50 minutes ago, dboi88 said:

Where is this core version you mention?

 

It only applies to CKAN configurations

the core version of IFS is basically only the plugin Folder of IFS, nothing more.

Edited by FreeThinker
Link to comment
Share on other sites

@FreeThinker Based on what you've said here, IMO you should have two different threads with two different mods, or at least clarify your OP. When I used IFS ages ago, it was just a drop-in, better maintained version of FS's fuel switch parts and seems to have grown rather hugely since then. Maybe call it "Interstellar Fuel Management" or something, because it's quite a different scope than the original.

Link to comment
Share on other sites

  • 2 weeks later...

So I found out that BDB along with KSPi creates an issue where IFS makes BDB's LEM only able to use either Liquid Fuel OR Oxidizer, instead of both (which is needed for the descent/ascent engines). I found out where this is being added in and have taken on the task to add in LFO as an option (as opposed to trying to outright make the MM patch skip BDB parts). However, I only have basic MM knowledge and the compatibility file that IFS uses confuses the hell out of me, so I'm reaching out for some help. Basically I've added in LFO to the front of a few lines (using the LiquidFuelOxidizer compatibility file as a reference), however since the LiquidFuel compat. file looks for parts that don't have oxidizer specifically (i.e. parts with only liquid fuel). At some part of the process the default BDB parts get patched to only use liquid fuel, which this MM patch then builds upon. To give some context/an example the file I'm attempting to give the LFO option to looks like:
 

@PART[*]:HAS[@RESOURCE[LiquidFuel],!RESOURCE[Oxidizer],!RESOURCE[MonoPropellant],!MODULE[ModuleTankManager],!MODULE[InterstellarFuelSwitch],!MODULE[FSfuelSwitch],!MODULE[B9PartSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines]]:NEEDS[InterstellarFuelSwitch&!CryoTanks&!ModularFuelTanks&!RealFuels]:FOR[InterstellarFuelSwitch]
{
	%LF = #$RESOURCE[LiquidFuel]/maxAmount$
	+OX = #$RESOURCE[Oxidizer]/maxAmount$
	
	%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$
	@totalCap += #$RESOURCE[Oxidizer]/maxAmount$
	

	
	%onlyLH2 = #$totalCap$
	@onlyLH2 *= 5

	%cryoPower = #$onlyLH2$
	@cryoPower /= 500
	
	MODULE:NEEDS[!WarpPlugin]
	{
		name = InterstellarFuelSwitch
		tankSwitchNames = LiquidFuelOxidizer;LiquidFuel;Oxidizer;MonoPropel;Hydrogen
		resourceGui = LFO;LiquidFuel;Oxidizer;MonoPropellant;LqdHydrogen
		resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;MonoPropellant;LqdHydrogen
		resourceAmounts = #$../LF$,$../OX$;#$../totalCap$;$../totalCap$;$../totalCap$;$../onlyLH2$
		tankTechReq = start;start;start;advFuelSystems;largeVolumeContainment
		tankResourceMassDivider = 8;8;8;6.66666666666;5.5
		adaptiveTankSelection = false
		orderBySwitchName = true
		displayTankCost = true
		hasGUI = true
	}

	MODULE:NEEDS[WarpPlugin]
	{
		name = InterstellarFuelSwitch
		tankSwitchNames = LiquidFuelOxidizer;LiquidFuel;Oxidizer;MonoProp;Hydrogen;Nitrogen;Argon;Methane;Ammonia;Hydrazine;CO2
		resourceGui = LFO;LiquidFuel;Oxidizer;MonoPropellant;LqdHydrogen;LqdNitrogen;LqdAmmonia;Methane;LqdArgon;Hydrazine;LqdCO2
		resourceNames = LiquidFuel,Oxidizer;LiquidFuel;Oxidizer;MonoPropellant;LqdHydrogen;LqdNitrogen;LqdArgon;LqdMethane;LqdAmmonia;Hydrazine;LqdCO2
		resourceAmounts = #$../LF$,$../OX$;#$../totalCap$;$../totalCap$;$../totalCap$;$../onlyLH2$;$../onlyLH2$;$../onlyLH2$;$../onlyLH2$;$../onlyLH2$;$../onlyLH2$;$../onlyLH2$
		tankTechReq = start;start;start;advFuelSystems;largeVolumeContainment;highPerformanceFuelSystems;highPerformanceFuelSystems;specializedFuelStorage;specializedFuelStorage;exoticFuelStorage
		tankResourceMassDivider = 8;8;8;6.66666666666;5.5;8;8;8;8;8
		adaptiveTankSelection = false
		orderBySwitchName = true
		displayTankCost = true
		

Basically I'm trying to add oxidizer back in in order for the LFO option to include both liquid fuel and oxidizer, which is accomplished in the LFO compat file by adding the OX variable, which the resourceAmounts line then reads from. However, I have no idea how to set up this patch to add in oxidizer. I thought about setting the OX variable to use the liquid fuel as a base (i.e. change it so it reads +OX = #$RESOURCE[LiquidFuel]/maxAmount$, however the totalCap line needs oxidizer to read from as well. Can anyone help me with this patch so I can finally get my Apollo 11 mission underway? I'd greatly appreciate it! My only other option as far as I know is to remove IFS and if that goes, then does KSPi (WarpPlugin). The other option I was thinking of going with is omitting BDB parts outright by changing the @PART[*] line to include @PART[!*bluedog,!*Bluedog]. That way it will only use B9PartSwitch as opposed to IFS.

Thanks for your time and any help will be greatly appreciated.

 

*Update*

Found a temporary workaround for it for now. Instead of using the OX variable, changing the LFO resource from: 

resourceAmounts = #$../LF$,$../OX$;

to

resourceAmounts = #$../LF$,$../totalCap$;

This gives you a tank filled with LF and Oxidizer, but they are at a 1:1 ratio, so the levels have to be manually changed in order to drain properly, but it works for the time being.

Edited by shoe7ess
Link to comment
Share on other sites

Version 2.10.0 for Kerbal Space Program 1.3.1 can be downloaded here

Released on 2017-10-07

  • Compiled against KSP 1.3.1
  • Fixed performance cost during flight
  • Fixed change of dry mass when switching in flight
Edited by FreeThinker
Link to comment
Share on other sites

Hi @FreeThinker I'm looking to troubleshoot a parts cfg file with regards to an error that FS is giving regarding the part. I've check the field meaning in the OP and am hoping you might be able to point me in the right direction to self troubleshoot. 

The error is "FSFuelSwitch Mass Discrepancy detected in part xxxx".

Is it as simple as a mismatch between the PART module 'mass' figure and the 'basePartmass' figure in the FSfuelSwitch module? Is the rules that the part mass HAS to be greater or equal to the FSbase mass?

Edited by wile1411
Link to comment
Share on other sites

9 hours ago, wile1411 said:

Hi @FreeThinker I'm looking to troubleshoot a parts cfg file with regards to an error that FS is giving regarding the part. I've check the field meaning in the OP and am hoping you might be able to point me in the right direction to self troubleshoot. 

The error is "FSFuelSwitch Mass Discrepancy detected in part xxxx".

Is it as simple as a mismatch between the PART module 'mass' figure and the 'basePartmass' figure in the FSfuelSwitch module?

Sorry, IFS does not have any message saying "The error is "FSFuelSwitch Mass Discrepancy detected in part xxxx" . But from experience I can tell you this message is most likely  associated with tweakscale which also alters a part mass. Wрat might be happening is that Firespitter is expecting the part to have a specific mass but was altered by tweaskcaling, generating this message. IFS has integrated tweakscale while Firespiter relies on tweakscale configs

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