Jump to content

[1.x+] Community Resource Pack


RoverDude

Recommended Posts

Hi,

I have noticed that when this mod is installed we get the below error:

[ERR 20:18:58.778] Error: Empty part config file

[WRN 20:18:58.797] Cannot create config from file 'D:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\CommunityResourcePack\AsteroidScannerSetup.cfg'.
 

I understand that this is nothign to worry about as this config file is empty, though would be nice if you can remove/update it so as to avoid having errors during loading. That will help in debugging other mod issues :):):)

Thanks,

Tsuvekio

Link to comment
Share on other sites

  • 2 weeks later...

So I believe I need to have some comprehensive changes to the distributions of atmospheric resources. It's all very nice to put "real" numbers in the config files and all, but my recent testing has essentially shown that abundances below 0.001 do not show up as harvestable in the game at all. This means that things like this beautiful distribution:

GLOBAL_RESOURCE
{
	ResourceName = XenonGas
	ResourceType = 2
	Distribution
	{
		PresenceChance = 50
		MinAbundance = 0.00000005
		MaxAbundance = 0.0000005
		Variance = 5
	}
}

...functionally means 0 abundance everywhere. Feel free to confirm this if you like. So there has to be a key improvement in this for atmospheric harvesting to be useable at all. Namely, all resources have to have atmospheric abundances above 0.001. 

My proposal is that the entire set of resources contained in CRP that are extractable from the atmosphere be recalibrated so that the "lowest' abundance becomes 0.001. This will necessitate a compression of the range of available values. For example, the tiny abundance of LqdHe3 (0.00000000072) becomes 0.001. We then recalibrate the other values so that the relative abundances are preserved. 

The obvious counterargument to this is that it might make some resources too abundant. That's pretty easy to fix... apply the efficiency parameter properly to this and it'll reduce the effective extraction rate.It's important to note that this also only affects people who use the stock atmo resource system. I don't know who that is beyond me and @RoverDude in Karbonite. These people should chime in. 

Important note: I haven't tested this with exoatmospheric resources so far, but I expect the same behaviour.

Link to comment
Share on other sites

I was under the assumption the stock resource system was able to handle any value between 0.0 and 100, like which is mentioned in every resouce defintion file:

//
//Resource types:  
//	0 = Crustal			(Stuff you dig up)
//	1 = Oceanic			(Stuff in the oceans)
//	2 = Atmospheric		(Stuff in the air, varies with pressure)
//	3 = Interplanetary	(Stuff you find between planets)
//
//Express all numbers as percentages 0.0-100.0, not 0.0-1.0!
//

 

Edited by FreeThinker
Link to comment
Share on other sites

40 minutes ago, Nertea said:

Is it too much to ask for a solution that doesn't involve another plugin dependency (and thus maintenance and bugfixing thereof) and can be accomplished using the system provided to us? 

I'm afraid so. The Stock resource collectors was clearly not mend for any realistic resource collection, their main purpose was the add some basic ISRU functionality to  KSP.

Despite all it flaws, the stock resource system is good for one thing, and that is to serve as a shared persistent random distribution generator.

2 hours ago, Nertea said:

The obvious counterargument to this is that it might make some resources too abundant. That's pretty easy to fix... apply the efficiency parameter properly to this and it'll reduce the effective extraction rate.It's important to note that this also only affects people who use the stock atmo resource system.

1

Perhaps you are trying to treat everything as a nail that must be hammered. Sometimes you need another tool for the Job.

 

Edited by FreeThinker
Link to comment
Share on other sites

I'm fairly certain that you're incorrect about the size of the minimum value. Let's take the definition of LqdHe3 for example (one of the smallest numbers)

PLANETARY_RESOURCE
{
	ResourceName = LqdHe3
	ResourceType = 2
	PlanetName = Kerbin
	
	Distribution
	{
		PresenceChance = 100
		MinAbundance = 0.00000000072
		MaxAbundance = 0.00000000072
		Variance = 0
		Dispersal = 1
	}
}

100% chance of existence in any save on kerbin with those exact parameters. When I query the ResourceMap with the appropriately formatted request object, the LqdHe3 abundance is returned as 0.0. Other, higher numbers work fine. There certainly is a minimum useful value, and it's lower than the default ModuleResourceScanner will show, but it's there.  

And by the way, worshiping at the altar of realism does not help anyone's case. 

-edit: Trial and error testing the ResourceMap query seems to point to the minimum queryable indeed being 0.001. Care to share your method for getting smaller values? KSPI-E's code is labyrinthine and I can't spare an hour or two to dig. 

Edited by Nertea
Link to comment
Share on other sites

@Nertea - converters can handle any value greater than 0.000000001.  For abundance equations, ResourceMap.GetAbundance does round to 1/1000 as it runs through the RNG and various calculations.  

And you are correct - if you need to deal with smaller numbers, that's the entire reason an efficiency multiplier is included in the base converter class.  But yeah, the constant attacks by @FreeThinker are a pretty good way to get kicked out of this project.

Link to comment
Share on other sites

9 hours ago, Nertea said:

I'm fairly certain that you're incorrect about the size of the minimum value. Let's take the definition of LqdHe3 for example (one of the smallest numbers)

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 

I verified and appears you are right. Regarding you solution of increasing minimum to 0.001, there is a problem with Resources like Hydrogen, which are rare on earth like planets but very abundant in gas giants. How can we possibly differentiate between the two?

Edit: It appears we can use number larger than 100. Maybe we could simply multiply all values by a large number and then compensate with the efficiency multiplier ...

Edit2: There appears to be some upper limit, any number higher than 2147483 gets ignored

 

 

 

Edited by FreeThinker
Link to comment
Share on other sites

11 hours ago, Nertea said:

My proposal is that the entire set of resources contained in CRP that are extractable from the atmosphere be recalibrated so that the "lowest' abundance becomes 0.001. This will necessitate a compression of the range of available values. For example, the tiny abundance of LqdHe3 (0.00000000072) becomes 0.001. We then recalibrate the other values so that the relative abundances are preserved.

 

 
 
 
 
 
 
 
 
 

Alright let's re-calibrate, What we could do is multiply all resources with 1 billion , that way 0.00000000072 becomes 0.72

 

 

Edited by FreeThinker
Link to comment
Share on other sites

29 minutes ago, ErevanGaming said:

Hi everybody =)

Just want to ask if I adjust the values of some of the resources, will the change effect my existing game or do I need to start a new career? =">

 

Regards and thanks in advance

Don't, as that kinda defeats the purpose of CRP, and will probably have a lot of unintended consequences.

Link to comment
Share on other sites

@Nertea So we have established the upper and lower bound of stock resource  system, which ranges between 2147483 and 0.001. Now how to proceed?

I propose we make agreements based on it possible rarity:

  • Rare resources which never exist in high concentration like Helium-3, we multiply by 1 billion.
  • Regular resource, which can exist in high concentration like Hydrogen, Helium and CO2, we could multiply by 1000
Edited by FreeThinker
Link to comment
Share on other sites

Okay, sounds good initially, but let's not rush into this. Last time we made modifications to the distributions we didn't test them fully, and this resulted in this mess in the first place. I'm going to put together a shared google sheet on this and we'll work it out over the next week. Stand by. 

Link to comment
Share on other sites

So here's an editable sheet, with values taken from the current CRP. I have used the minimum and maximum values for all distributions here to capture the whole range. 

Some observations that jump out:

  • There's 3 pretty clear scaling factors that can make all values right: 1.0, 100,000 and 100,000,000
  • Some values have a large range that feels like it could be compressed. Namely Xe and LqdHe3.
    • Compressing Xe down to 0.001/0.01 seems like it could be reasonable with a resassignment of what planets are useable. It's scaling factor would then be 1.0
    • Compressing LqdHe3's minimum could also allow it to work in the 100,000 range
    • This would leave us with two clear factors of 100,000 and 1.0. The 'exotic' number pretty clearly only applies to exoatmospheric and super-rare He3 so it minimizes player confusion.

I have noticed that exoatmospheric definitions for antimatter and atmospheric definitions for LqdDeuterium (probably specifically for Jool) are missing, by the way. We should add these. 

Completely Random Alternate Idea

What if... each "abundance" was refactored merely to mean relative abundance, in terms of extractive potential? So all resources have an atmospheric abundance range of 0.001 to 100%. This gives a full set of 6 sigfigs of abundance variation without venturing into strange >100% territory, which might be confusing to the player. It would then be up to the part module to (using the efficiency parameter) define the actual extraction rate. 

Example:

  • Scanning for LqdHe3 on Jool shows an "abundance" of 100% (maximum value that can be mined anywhere)
  • Scanning for LqdHe3 on Kerbin shows an "abundance" of 0.001% (absolute minimum value that can be mined anywhere)
  • The part extractor has an efficiency of 0.0004 (example), so the efficiency scales the mining to a realistic number value. 

I added a third table in the spreadsheet to show what that would look like. There is still compression of ranges required in this one, but it is less arbitrary. The more I think about this, the more I like it, provides the necessary info (relative concentrations) and easily shows where an planet has a "better" atmo than another. 

Edited by Nertea
Link to comment
Share on other sites

@Nertea Good work but I think are overlooking the value of scaling factor 1000. The reason I think this scaling is needed is because even an abundance of 100 multiplied by 1000 = 100000 remains under te  2147483 limit while allowing abundances as low as 0.000001  to be minable. This is very relevant for the resource Hydrogen in earth atmosphere which has an abundance of 0.00005%. Hydrogen would therefore not work with either the default 1.0 scaling factor or the higher 100,000 scaling factor

Edited by FreeThinker
Link to comment
Share on other sites

I only included the definitions from the CRP cfgs, which only define LqdHydrogen in Jool atmo and as an exoatmospheric resource. If you want to add a bunch more definitions that's of course not included in the sheet. 

Plus, I'm going to heavily push that Alternate approach up there. I think it's cleaner. 

Link to comment
Share on other sites

14 minutes ago, Nertea said:

 

Plus, I'm going to heavily push that Alternate approach up there. I think it's cleaner. 

 
 
 
 
 

As long as information isn't lost, this might be possible. We could accomplish this with a logarithmic scale or exponential scale.

Edit: I added a section where I apply exponent 0.2 . By calculating Exponent 4, I get get the original values again to reasonable degree

Edited by FreeThinker
Link to comment
Share on other sites

How would you go about applying an exponential approach to this bit?

2 hours ago, Nertea said:

Completely Random Alternate Idea

What if... each "abundance" was refactored merely to mean relative abundance, in terms of extractive potential? So all resources have an atmospheric abundance range of 0.001 to 100%. This gives a full set of 6 sigfigs of abundance variation without venturing into strange >100% territory, which might be confusing to the player. It would then be up to the part module to (using the efficiency parameter) define the actual extraction rate. 

Example:

  • Scanning for LqdHe3 on Jool shows an "abundance" of 100% (maximum value that can be mined anywhere)
  • Scanning for LqdHe3 on Kerbin shows an "abundance" of 0.001% (absolute minimum value that can be mined anywhere)
  • The part extractor has an efficiency of 0.0004 (example), so the efficiency scales the mining to a realistic number value. 

I added a third table in the spreadsheet to show what that would look like. There is still compression of ranges required in this one, but it is less arbitrary. The more I think about this, the more I like it, provides the necessary info (relative concentrations) and easily shows where an planet has a "better" atmo than another. 

 

Link to comment
Share on other sites

@Nertea  Well it is a relative scaling where a single formula is applied to achieve that all sane values are within 100 and 0.001. The advantage are it simplicity and the fact the original values can be recalculated to a reasonable degree. Of course you lose accuracy with extreme low number but it is within an acceptable range.

Edited by FreeThinker
Link to comment
Share on other sites

47 minutes ago, Nertea said:

That's cool. Can we proceed with that approach then? Redo all atmospheric concentrations to the 0.001 to 100 range, where 100 = highest possible abundance for that resource?

Yes, but I can do even better by also using a fixed multiplier.

I added an addition section where I demonstrate the improved version that will scale between 100 -and 0.001 using the following formula  scaled value = (value*10000)^(1/3)

The big advantage with the improved version is that value in the 100 to 1 range, remain in the double digit. For example, the original value 100% remains 100%, and 97% becomes 98.99

Current CRP
Abundance Range
Min Max
0.001 0.1
0.00003 0.27
0.00002 97
0.001 2
0.001000000000 0.5
0.000000000072 0.00014
0.00005 80
0.00000001 0.00000005
20 0.13
0.00000005 0.01
0.0000000007 0.00003
? ?
Scaled With Multiplier and Exponent
Abundance Range
Min Max
2.154 10
1.442 13.925
0.585 98.99
2.154 58.48
2.154 36.84
0.009 2.41
0.794 92.832
0.046 0.079
58.48 23.513
0.079 4.642
   

 

 
   
   
   
   
   
   
   
   
   
   
   
   
? ?
   
 
   
   
   
   
   
   
   
   
   
   
   
   
Edited by FreeThinker
Link to comment
Share on other sites

@Nertea I have an improved solution for the CRP rounding issue, that is both convenient and powerful

scaled_value =IF(C21>=1, original_value, ROUND(original_value^0.25, 3))

In this formula, all values above or equal to 1% remain the same. Only values below 1% get scaled exponentially.

So effectively from 0 to 1, it grows exponentially and from 1 and 100 it grows linearly.

Here is an example how this works in practice:

    Relative Abundance CRP   Scaled with conditional exponent  
    Abundance Range   Abundance Range
Resource   Min Max   Min Max
ArgonGas   0.001 0.1   0.178 0.562
CarbonMonoxide   0.00003 0.27   0.074 0.721
CarbonDioxide   0.00002 97   0.067 97
Karbonite   0.001 2   0.178 2
Karbonite [exo]   0.001000000000 0.5   0.178 0.841
LqdHe3   0.000000000072 0.00014   0.003 0.109
LqdHydrogen   0.00005 80   0.084 80
LqdHydrogen [exo]   0.00000001 0.00000005   0.01 0.015
Oxygen   0.13 20   0.6 20
XenonGas   0.00000005 0.01   0.015 0.316
LqdDeuterium   0.0000000007 0.00003   0.005 0.074
Edited by FreeThinker
Link to comment
Share on other sites

Now if you want to create atmospheric Helium3 harvest, you should be able to achieve it with the following

  MODULE
	{
		name = ModuleResourceHarvester
		HarvesterType = 2
		Efficiency = 0.000000027
		ResourceName = LqdHe3
		ConverterName = Helium-3 Scoop
		StartActionName = Open Helium-3 Scoop
		StopActionName = Close Helium-3 Scoop
    	ToggleActionName = Toggle Helium-3 Scoop
  	 INPUT_RESOURCE
  	 {
  		ResourceName = ElectricCharge
  		Ratio = 25
  	 }
     HarvestThreshold = 0.0
	}

Notice the efficiency is set to 0.000000027, this will allow you the produce helium3 from earth atmosphere in the correct amount

But you probably want to increase this number otherwise players would have to wait  1204 Kerbal years and spend 123456 GW to harvest 1 unit of LqdHe3 :rolleyes:

 

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