Jump to content

[1.7.3] Real Battery v1.7


Blackline

Recommended Posts

I still don't get it.

From reading the OP and several pages of this thread I guess that the "EC part" should be recharged by the "SC part" of the mod and solar panel outputs should go to SC first and SC charges EC - so stock and other mods always "see enough EC" to know that there is some charge left ...
Am I totally wrong?

But in my actual vessel I got 0 EC, 1.99 of 2.00 SC and there is no recharging in process.
The small solar panels do some output, but this is going nowhere...

In this example the mod Kerbalism will not work because there is no EC - of course.

I really don't understand the purpose of this mod - still not ...

btw I removed the :FOR[VenStockRevamp] in the GameData\RealBattery\RealBattery_mm.cfg

Spoiler

ax0ZqZI.png

 

Edited by Gordon Dry
typo
Link to comment
Share on other sites

  • 2 weeks later...
On 24.3.2018 at 11:06 PM, Gordon Dry said:

I still don't get it.

From reading the OP and several pages of this thread I guess that the "EC part" should be recharged by the "SC part" of the mod and solar panel outputs should go to SC first and SC charges EC - so stock and other mods always "see enough EC" to know that there is some charge left ...
Am I totally wrong?

But in my actual vessel I got 0 EC, 1.99 of 2.00 SC and there is no recharging in process.
The small solar panels do some output, but this is going nowhere...

In this example the mod Kerbalism will not work because there is no EC - of course.

I really don't understand the purpose of this mod - still not ...

So, my parts are doing the following stuff (simplified)

  • if the total EC is above 90%, the realbattery charges up, consuming EC and storing it in that part as SC(I assume 1EC as 1kJ and 1SC as 1kWh, thus 3600EC are needed for 1SC)
  • if the total EC is below 80%, the realbattery discharges, "creating"EC while depleting its SC

there is no direct conversion from sunlight to SC.

BUT, lucky you, i found a bug, that might explain your problems: i released 1.4.1, get it!

btw I removed the :FOR[VenStockRevamp] in the GameData\RealBattery\RealBattery_mm.cfg

i did that with the new version as well. Maybe I'll bring VSR support later.

Edited by Blackline
Link to comment
Share on other sites

2 hours ago, Blackline said:
  • if the total EC is above 90%, the realbattery charges up, consuming EC and storing it in that part as SC(I assume 1EC as 1kJ and 1SC as 1kWh, thus 3600EC are needed for 1SC)
  • if the total EC is below 80%, the realbattery discharges, "creating"EC while depleting its SC

Now I get it.

I guess I could nerf it by changing these values to 80% for upper limit and 20% for lower limit, like the suggestions how to treat the typical smart phone battery regarding charging / discharging...

Link to comment
Share on other sites

3 minutes ago, Gordon Dry said:

Now I get it.

I guess I could nerf it by changing these values to 80% for upper limit and 20% for lower limit, like the suggestions how to treat the typical smart phone battery regarding charging / discharging...

Thats right, but should not be needed. Please give it a try with stock values first, because if it doesn't work, i'd rather fix it in the sourcecode, than band-aiding stuff.

Edited by Blackline
Link to comment
Share on other sites

  • 2 weeks later...

@Blackline I did some tests and there is something I don't understand.

Let's say I got this block:

	@RESOURCE[ElectricCharge]
	{	
		@name = StoredCharge
		@amount = #$/EC_maxAmount$
		@amount /= 1000
		@maxAmount = #$/EC_maxAmount$
		@maxAmount /= 1000
	}

This makes me believe when EC of the part is 200 then SC should be 0.2 - but SC is 20.

Also when I change the divider from /= 1000 to /= 100000 SC still is 20.

I wanted to balance it out, as you said 1 SC is kinda 3600 EC - so when the part got 200 EC it got 20 SC what is likely the same as 72,000 EC - too much!

Could it be that the mod just hardcoded divides EC by 10 and that's SC ? So the lines in the config are just for the cosmetics? :D

Link to comment
Share on other sites

@Blackline Now I'm getting really confused, comparing what's inside the ModuleManager.ConfigCache and what's shown in the VAB ...

Let's start at the beginning.

First I just edited the GameData\RealBattery\RealBattery_mm.cfg for a test run:

@PART[*]:HAS[@RESOURCE[ElectricCharge]]:HAS[!Module[ModuleEnginesFX]]:FINAL
{

	EC_amount = #$/RESOURCE[ElectricCharge]/maxAmount$
	EC_maxAmount = #$EC_amount$

	MODULE
	{
		 name = RealBattery
		 
		 BatteryType = 3 // 1 = Lead_Acid; 2 = Lead_Acid_singleUse; 3 = Li_Ion

		 HighEClevel = 0.8
		 LowEClevel = 0.2
	}

	@RESOURCE[ElectricCharge]
	{	
		@name = StoredCharge
		@amount = #$/EC_amount$
		@amount /= 1000
		@maxAmount = #$/EC_maxAmount$
		@maxAmount /= 1000
	}

	@title ^= :$: (Real Battery):
}

@PART[*attery,*attery*]:HAS[@RESOURCE[StoredCharge]]:FINAL
{
	@thermalMassModifier = 2
}

 

This is the Bluedog DB Mercury Personal Rentry Capsule after all patching (Bluedog real names patch included) as it's represented inside the ModuleManager.ConfigCache:

UrlConfig
{
	name = bluedog_mercuryPod
	type = PART
	parentUrl = Bluedog_DB/Parts/Mercury/bluedog_mercuryPod
	PART
	{
		name = bluedog_mercuryPod
		module = Part
		author = passinglurker, Tantares, CobaltWolf
		rescaleFactor = 1
		scale = 1
		node_stack_top = 0.0,  0.364695, 0.0, 0.0, 1.0, 0.0, 1
		node_stack_bottom = 0.0, -0.3679815, 0.0, 0.0, -1.0, 0.0, 1
		CenterOfBuoyancy = 0.0, 0.0, -0.3
		CenterOfDisplacement = 0.0, -0.3, 0.0
		buoyancy = 1.75
		buoyancyUseSine = False
		CoPOffset = 0.0, 0.3, 0.0
		CoLOffset = 0.0, -0.3, 0.0
		CoMOffset = 0, 0, 0
		TechRequired = engineering101
		entryCost = 1000
		cost = 1000
		category = Pods
		subcategory = 0
		title = Mercury Personal Rentry Capsule (Real Battery)
		manufacturer = Bloeting Areospace Corporation
		description = Our Mercury is to Alnair's Almach capsule what the Joker is to Batman. Smaller, spunkier, more colorful, and has a higher number of fatalities under its belt. Erm... Scratch that last part.
		attachRules = 1,0,1,1,0
		mass = 0.5
		dragModelType = default
		maximum_drag = 0.20
		minimum_drag = 0.15
		angularDrag = 2
		crashTolerance = 10
		maxTemp = 3400
		skinMaxTemp = 3400
		heatConductivity = 0.1
		thermalMassModifier = 1.0
		vesselType = Ship
		CrewCapacity = 1
		bulkheadProfiles = size0, size1
		tags = mercury crew pod hermes 1.25 125
		EC_amount = 50
		EC_maxAmount = 50
		MODEL
		{
			model = Bluedog_DB/Parts/Mercury/bluedog_mercuryPod
		}
		INTERNAL
		{
			name = Hermes_Crew_A_Interior
		}
		MODULE
		{
			name = ModuleCommand
			minimumCrew = 1
		}
		RESOURCE
		{
			name = StoredCharge
			amount = 0.05
			maxAmount = 0.05
		}
		MODULE
		{
			name = ModuleSAS
		}
		MODULE
		{
			name = ModuleReactionWheel
			PitchTorque = 5
			YawTorque = 5
			RollTorque = 5
			RESOURCE
			{
				name = ElectricCharge
				rate = 0.24
			}
		}
		MODULE
		{
			name = ModuleScienceExperiment
			experimentID = crewReport
			experimentActionName = Crew Report
			resetActionName = Discard Crew Report
			reviewActionName = Review Report
			useStaging = False
			useActionGroups = True
			hideUIwhenUnavailable = True
			rerunnable = True
			xmitDataScalar = 1.0
		}
		MODULE
		{
			name = ModuleScienceContainer
			reviewActionName = Review Stored Data
			storeActionName = Store Experiments
			evaOnlyStorage = True
			storageRange = 2.0
			canBeTransferredToInVessel = True
			canTransferInVessel = True
			showStatus = True
		}
		RESOURCE
		{
			name = MonoPropellant
			amount = 10
			maxAmount = 10
		}
		MODULE
		{
			name = ModuleAnimateGeneric
			animationName = mercury_window_anim
			startEventGUIName = Lights On
			endEventGUIName = Lights Off
			actionGUIName = Toggle Lights
			defaultActionGroup = Light
		}
		MODULE
		{
			name = ModuleDataTransmitter
			antennaType = INTERNAL
			packetInterval = 1.0
			packetSize = 2
			packetResourceCost = 12.0
			requiredResource = ElectricCharge
			antennaPower = 5000
			optimumRange = 2500
			packetFloor = .1
			packetCeiling = 5
		}
		MODULE
		{
			name = ModuleLogisticsConsumer
		}
		MODULE
		{
			name = AYA_Science
		}
		MODULE
		{
			name = AYA_SAS
		}
		MODULE
		{
			name = Kaboom
			delay = 0
		}
		MODULE
		{
			name = ModuleSYPartTracker
		}
		MODULE
		{
			name = ModuleCrewRandR
			crewComposition = Pilot, Engineer, Scientist
		}
		MODULE
		{
			name = HotSpotModule
		}
		MODULE
		{
			name = ModuleTorqueController
		}
		MODULE
		{
			name = ModuleTCA
		}
		MODULE
		{
			name = TrajectoriesVesselSettings
		}
		MODULE
		{
			name = MechJebCore
			MechJebLocalSettings
			{
				MechJebModuleCustomWindowEditor
				{
					unlockTechs = start
				}
				MechJebModuleSmartASS
				{
					unlockTechs = start
				}
				MechJebModuleManeuverPlanner
				{
					unlockTechs = start
				}
				MechJebModuleNodeEditor
				{
					unlockTechs = start
				}
				MechJebModuleTranslatron
				{
					unlockTechs = start
				}
				MechJebModuleWarpHelper
				{
					unlockTechs = start
				}
				MechJebModuleAttitudeAdjustment
				{
					unlockTechs = start
				}
				MechJebModuleThrustWindow
				{
					unlockTechs = start
				}
				MechJebModuleRCSBalancerWindow
				{
					unlockTechs = start
				}
				MechJebModuleRoverWindow
				{
					unlockTechs = start
				}
				MechJebModuleAscentGuidance
				{
					unlockTechs = start
				}
				MechJebModuleLandingGuidance
				{
					unlockTechs = start
				}
				MechJebModuleSpaceplaneGuidance
				{
					unlockTechs = start
				}
				MechJebModuleDockingGuidance
				{
					unlockTechs = start
				}
				MechJebModuleRendezvousAutopilotWindow
				{
					unlockTechs = start
				}
				MechJebModuleRendezvousGuidance
				{
					unlockTechs = start
				}
			}
		}
		MODULE
		{
			name = RealBattery
			BatteryType = 3
			HighEClevel = 0.8
			LowEClevel = 0.2
		}
	}
}

As you can see, EC should be 50, so SC should be 0.05

But inside VAB this is shown to me:
iwGoTxM.png
You also can see it says "Discharge Rate" and "Charge Rate" 1000.00 EC/s - it's always the same value as the max. EC, so 1000 in this case. I don't know if this is intended.

It really seems that the values in the GameData\RealBattery\RealBattery_mm.cfg are not everything what is taken into account, there is some "phantom" value and I guess this only could be found inside the mod code itself.

 

Edit:

I found something that makes me believe that there is really something weird hardcoded.

I compared a few other parts with ModuleCommand that have been altered to be a RealBattery part, for example the Bluedog DB Explorer 1 - it should have 30 EC and 0.03 SC, but ingame it got 25.2 EC and 2.5 SC.
Or the Taerobee CU-47WS Control Unit, it should have 5 EC and 0.05 SC, but it got 40 EC and 4 SC.

  1. it doesn't matter which values are inside the GameData\RealBattery\RealBattery_mm.cfg
  2. somehow 2000 is multiplied with the part's mass and then rounded to one decimal place, this is the EC*
  3. the EC is divided by 10 and also rounded to one decimal place, this is the SC
  • BluedogDB Mercury one: Mass 0.5 -> 2000*0.5=1000 EC -> 1000/10=100 SC
  • BluedogDB Explorer 1: Mass 0.01258 -> 2000*0.01258=25.16 -> rounded to one decimal place -> 25.2 EC -> 25.2/10=2.52 -> rounded to one decimal place -> 2.5 SC
  • Taerobee CU-47WS Control Unit: Mass 0.02 -> 2000*0.02=40 EC -> 40/10=4 SC
Edited by Gordon Dry
Link to comment
Share on other sites

SC ist defined by part mass * energy density, which is dependent on the battery tech level. In this instance, the realbattery module is not supported to be used on anything but batteries, like command pods you are using. The SC in the cfg is, as you saw, useless, you can even delete that part entirely, it's old and unused. So it's totally irrelevant how much EC a part had before it's concerted to a realbattery.

You can see the used energy and power densities in the sourcecode on GitHub.

I'm on mobile, so can't give you many links for now.

Link to comment
Share on other sites

@Blackline That's okay, how could I know that obsolete stuff is inside the config? Also the first lines which are commented out made me think this still should work. I always guess that the configs of mods have stuff in them that got a purpose. If I would not, this would mean I don't trust any mod... :P

Link to comment
Share on other sites

@JPLRepo @Blackline I got either a design problem or a mod conflict.

I reverted RealBattery to the defaults and also (re-)added AmpYear.

In space I wanted to transmit science data (stock transmission because Kerbalism actually is borked), the (real) batteries together with the probe core got 50 EC - and 4 SC.

When transmitting, some data blocks are too big for 50 EC, so the transmission is interrupted - no EC was "sucked" out of the SC which made me wonder what could be wrong.

The AmpYear reserve power also didn't help.

When this is intended during transmitting data, then the whole SC thing has no purpose, because I just need moar batteries to have enough EC then ...

Log:
https://www.dropbox.com/s/q3dbpwhleal5fwy/2018-04-21_1 KSP.log.7z?dl=1

Link to comment
Share on other sites

Yes, you need a big enough EC buffer to be able to send data as 1 big chunk.

Alternatively, In your case I would enable partial data transmission, it works for me, and is more realistic too. We don't have multiple gigabit per second in our space probes, but rather send and receive data in a long timespan. One reason for that is the available electric power.

Edited by Blackline
Link to comment
Share on other sites

8 hours ago, Blackline said:

partial data transmission

I also tried that, but the ground station was picky and always regretted and just replied "incomplete, start from the beginning, please", like a foobar ul.to download.

I just re-added the latest build of Kerbalism, knowing that there is this stock issue triggered by MM and so missing a MM config cache, but then I works because the transmission speed / EC usage is different than stock.
So I also removed AmpYear again, but the save file still got the dead AmpYear modules in it, so only the next build and launch will provide better data.

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

@Blackline Could you help out in creating Kerbalism compatibility regarding background processing and/or time warp?
https://github.com/steamp0rt/Kerbalism/issues/50

The man to talk with who got this on his schedule is @PiezPiedPy

And regarding this I also want to know if BackgroundResources by @JPLRepo is "only" compatible to RealBattery or for real is a dependency (also when not stated to be so):
https://github.com/KSP-RO/TacLifeSupport/tree/master/GameData/REPOSoftTech/BackgroundResources
aka.
https://github.com/JPLRepo/REPOSoftTechKSPUtils/tree/master/BackgroundResources

Is this also needed to have a full compatiblity of RealBattery to Kerbalism?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...

seems to be having a bug in 1.4.5 where Real Batteries are switching to discharge or charge after using time warp. The percentage reads correctly but when power drops past the threshold nothing happens and the same for charging. F5 then F9 resets the issue and Real Battery works as expected until time warp is used again.

 

Link to comment
Share on other sites

  • 4 weeks later...
On 10/30/2016 at 12:01 PM, Blackline said:

Stock batteries are currently cloned and enhanced with the new behavior 

Why not remove the useless old batteries? :P I don't like my menu being spammed up with duplicates of everything so I may end up uninstalling this but I figured I'd ask first if you have plans for adding an option for removing the duplicates and such.

Link to comment
Share on other sites

24 minutes ago, Vas said:

Why not remove the useless old batteries?

I you have tested this uncared* mod, you would have recognized that the quote is not right.

The stock batteries are cloned and then pruned, so only the cloned ones are in game.

*yes, indeed, please fix this mod as promised months ago

Link to comment
Share on other sites

4 minutes ago, Gordon Dry said:

I you have tested this mod, you would have recognized that the quote is not right.

The stock batteries are cloned and then pruned, so only the cloned ones are in game.

unknown.png

Looks duplicated to me.

Link to comment
Share on other sites

2 minutes ago, Vas said:

Looks duplicated to me.

Oh damn, you're right.

I just forgot that I created my own MM patch instead of the shipped one - two years ago.

GameData\RealBattery\RealBattery_mm.cfg

@PART[*attery*,*attery]:HAS[@RESOURCE[ElectricCharge]]
{
	@thermalMassModifier *= 2
	EC_maxAmount = #$/RESOURCE[ElectricCharge]/maxAmount$

	MODULE
	{
		 name = RealBattery
		 
		 BatteryType = 3 // 1 = Lead_Acid; 2 = Lead_Acid_singleUse; 3 = Li_Ion

		 HighEClevel = 0.8
		 LowEClevel = 0.2
	}

	@maxTemp = 2000 // no overheat explosions
		
	@RESOURCE[ElectricCharge]
	{	
		@name = StoredCharge
		@amount = #$/EC_maxAmount$
		@amount /= 1000
		@maxAmount = #$/EC_maxAmount$
		@maxAmount /= 1000
	}

	@title ^= :$: <color=green>(RealBattery)</color>:
	@description ^= :$: <color=green>(pimped by Real Battery Inc.)</color>:
}

 

Link to comment
Share on other sites

1 hour ago, Gordon Dry said:

Oh damn, you're right.

I just forgot that I created my own MM patch instead of the shipped one - two years ago.

GameData\RealBattery\RealBattery_mm.cfg

I'll wait till the author replies and updates the mod. I don't like manually installing things, I use CKAN only.  If a mod doesn't use CKAN, it doesn't exist as far as I'm concerned. I used to do things manually way back, never again will I return to that.

Link to comment
Share on other sites

4 minutes ago, Vas said:

I used to do things manually way back, never again will I return to that.

Other way around.

  • I use bitwise syncing with Total Commander to manage my files - instead of open explorer windows all over the place.
  • Total Commander can open a lot of archives, and write into them.
  • So I can compare left side, last downloaded zip - right side, my archive
  • or left side, my GameData - right side, my archive

But everybody got own taste.

Link to comment
Share on other sites

10 minutes ago, Gordon Dry said:

Other way around.

  • I use bitwise syncing with Total Commander to manage my files - instead of open explorer windows all over the place.
  • Total Commander can open a lot of archives, and write into them.
  • So I can compare left side, last downloaded zip - right side, my archive
  • or left side, my GameData - right side, my archive

But everybody got own taste.

CKAN allows me to see suggested mods and required mods and such.  I don't need to download 90 zips that all have 38 different versions of Module Manager included in them.

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