Jump to content

Some questions about resources and their associated .cfg files


Recommended Posts

Hey all.

As of late I've been playing around a bit with module manager and just editing .cfg files, mostly as a way of familiarizing myself more with KSP's back-end, and partly because I do have some interest in maybe developing some kind of mods in the future, even if only for practice/personal use. Anyways, I spent the better part of my afternoon and evening today playing around with resource definitions and modules, and as a practice exercise I've been trying to make a simple set of .cfg files for a resource pack (Stuff like water ice, carbon, uranium ore, and processing these materials into other things with ISRU units). I get the gist of what I'm doing but there are a few things that I've yet to find answers to, and I'm looking for advice. Forgive me if my questions have been asked before. I did some googling, and found next to nothing, so I suspect this isn't a problem, but if so, please feel free to point me to the exisiting posts.

1) in the ResourcesGeneric.cfg file (GameData/Squad/Resources), what is hsp, and is it worth modifying for a new resource?
2) in the Ore.cfg file, I understand that I'm looking at the resource distribution parameters, but I don't know what Variance or Dispersal correspond to, also
3) is the PressenceChance parameter per planet? Per Biome? Per savefile?
4) still in Ore.cfg, what is ResourceType? I've yet to see an example of anything not equal to zero for that parameter...
5) It occurs to me that a few resource parts are configured by default to only work with the standard "Ore" resource, such as the Narrow Band Scanner, and the Drill Parts. Is there a simple way to make either of these function for all available resources, or must I add new modules to the .cfg for every mineable resource?
6) how do these changes apply to asteroids? do I have to use a MM patch to add mineral resource to a roid? Or are all of the other resource definition and distribution cfgs enough?

I'm sure that I'm yet to encounter more questions on the topic of Resources, ISRUs, Drills, and scanners, so If you can think of anything else helpful for working on this kind of stuff, please, don't hesitate to fire your pointers my way!

Happy Launching, happy Modding!

Link to post
Share on other sites

You can check out my answer to a very similar question asked elsewhere. It answers your points 1 through 4.

For point 5: Along with Karbonite, check out the Community Resource Pack "CRP" (included with Karbonite and most mods that add resources to gameplay) and you'll find many resources that already exist which will meet your needs. (Note, Uraninite = Uranium Ore.) Once the Community Resource Pack is installed, many of these resources will be enabled in the stock scanner parts. Nearly none of these mods, however, add to the stock drills and they will tend to add their own harvester parts and have their conversion chains start with Ore, so you will have to mod the stock drills to harvest what other crustal resources you desire. It's also worth mentioning that Karbonite has harvesters for all (4) resource types: Crustal, ocean, atmospheric, exospheric.

For point 6: The CRP will add these various resources to asteroids as well, and enable the stock drills to pick any of the installed resources out of them. However, the asteroid scanner function is broken so you can't tell how much of what is in an asteroid.

Unless you're already aware, here's the syntax page of the MM wiki, so you know how to phrase your patches that they work properly.

Feel free to ask away more. Us kerbals love to share our :science: and help the new person to build him/herself up.

Edited by JadeOfMaar
Link to post
Share on other sites

Hey, Thanks to the both of you. These answers are both super helpful. I don't know why I didn't seek out Karbonite sooner, and the CRP is more or less the same as what I'm doing, just with a few differences. @JadeOfMaar You mention PresenceChance in your other post, but I'm not sure I understand what you mean by each and every biome. Do you mean that this is the chance that the ore will sapwn at all in the save then? Or do you mean that, when the game generates the ore, it "rolls" this chance for each biome on each planet. That seems like a silly wuestion when I type it out, but I'd appreciate any clarification. 

As for MM, I had indeed already bookmarked that syntax page, haha! MM is proving to be quite powerful.

Thanks again for the help!

Link to post
Share on other sites
54 minutes ago, MarcRan17 said:

You mention PresenceChance in your other post, but I'm not sure I understand what you mean by each and every biome

It's fine. I should have made full effort when I wrote that part out. PresenceChance is per biome (On a given planet if inside of a PLANETARY_RESOURCE node, or on every planet if inside a GLOBAL_RESOURCE node, or in the specific biome if inside a BIOME_RESOURCE node). You can do overrides with combinations of these and make every planet except planet X have a resource on it, or make planet X have a certain resource all over it except in biome XY.

Biome_resource overrides Planetary, which overrides Global.

1 hour ago, MarcRan17 said:

MM is proving to be quite powerful.

You've only begun to see the depth of the rabbit hole. :P MM is so epic.

Link to post
Share on other sites

Okay, excellent, thanks! Next question (sorry, I'm full of these): With the BIOME_RESOURCE nodes, I'm not sure what names the biomes go by. I thought that I should be able to make ice caps/poles of some planets contain water and/or nitrogen ice resources, but I'm finding that this hasn't worked as expected. I am about 90% sure that's because I've declared bioimeName incorrectly since I don't actually know what the biomes are called internally by the game (not just their names as shown on the wiki apparently).

And Another thing. I've built a scanner probe and been flying it around using quicksave editing to test resource distributions, and I'm confused by one of my findings. It seems that despite having wildly different distribution definitions, some resources will have an almost identical map to other resources on the same planet. Like, I'll see WaterIce in craters A, B, and C on Mun, and nowhere else, and I'll also see Carbon in these exact same craters and nowhere else, even though the fractions for Carbon and WaterIce are quite different and their distribution rules likewise. What's happening here? And why am I seeing it so frequently? I thought it might just be chance, given that there are often less than a dozen biomes on a planet, it's possible that two resources are selected to appear in the same set of biomes, but it happens too frequently for me to be convinced this is the case.

Anyways, thanks again for your help so far. This is definitely a learning experience.

Link to post
Share on other sites

The same biome name you see when you use a science experiment (or read from the KSP Wiki) will work for BIOME_RESOURCE. Like this. But be aware that you may not get what you're expecting. Kerbin's ice caps are separate biomes now, I think, so "BiomeName = Ice Caps" will not work. And Duna's ice caps maybe simply "Poles."

BIOME_RESOURCE
{
	ResourceName = Water
	ResourceType = 0
	PlanetName = Gael
	BiomeName = Ice Caps
	
	Distribution
	{
		PresenceChance = 1000
		MinAbundance = 80
		MaxAbundance = 90
		Variance = 40
		Dispersal = 10
	}
}

You can make another such node and replace Water with Nitrogen or LqdNitrogen (whichever is appropriate), and change BiomeName into whatever applies for the given planet. (It's apparently safe to include spaces in BiomeName).

If you don't have a GLOBAL_RESOURCE node for your custom resource that might cause a problem. I don't know if that's true because I always include one for a custom resource.

43 minutes ago, MarcRan17 said:

It seems that despite having wildly different distribution definitions, some resources will have an almost identical map to other resources on the same planet. Like, I'll see WaterIce in craters A, B, and C on Mun, and nowhere else, and I'll also see Carbon in these exact same craters and nowhere else,

I see that at times and accept it as a semi-random, semi-natural phenomenon, but in the case of Water, I know that there's a specific config that puts Water on Mun. And some resources, like Water, and most gases, have GLOBAL_RESOURCE settings to make them completely absent by default. There may be an identical config for Carbon to cause it to appear in the same craters as Water.

Edited by JadeOfMaar
Link to post
Share on other sites

Okay I'm pretty sure my non-inclusion of spaces is what's messaged up at least Kerbin's BIOME_RESOURCE definition. 

As for the duplicate resource maps, I'm still not so sure. Keep in mind that I've only used the CRP and other mods as a reference so far. All the actual configs are my own. So unless you mean stock configs (Which would certainly be confusing) then I'm not so sure that's it... I suspect maybe it has something to do with Variance and Dispersal settings. The Munar Lowlands for example, cover a huge portion of the Mun, and so if two resources happened to both roll 'yes' on their existence there (not unlikely) then their maps would look conspicuously similar. The only way I think I could avoid this like I say, is to increase Variance and Dispersal.

Another Thought. I like to use SCANsat, but I've noticed that it's resource maps only list Ore. I suppose there's a cfg somewhere that dictates the resources to show, and since mine are almost all custom, they aren't listed. I imagine a simple MM patch could iron that out, no?

EDIT: One other question: When are resource maps for the planets generated? Is it at the time of orbital survey or is it when the savefile is started? That is, If I add new resources and distribution definitions for them, will they be added to existing saves? And if so, on what conditions? Are already scanned planets SOL?

Edited by MarcRan17
Link to post
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...