Jump to content

[WIP][KSP 0.24.2] (V0.2R1) Kerbinium Asteroid Mining/RandomResources


PalverZ

Recommended Posts

Kerbinium Asteroid Mining Mod:

Bringing a source of FUNds to roids:

Have you ever wanted to mine an asteroid? or maybe just make a part that has a random amount of a set resource on it? Well I did so I made this and well maybe this mod is for you, maybe not.

Kerbinium is a sought after metal that can be sold for funds. To get it, strap a Kerbinium tank and an AGMU from the utility tab to your vessel, grab, and pump (MOD KEY + Select each part (Tank and roid))

Currently offering

AGMU: A modified Klaw that allows Fuel Cross feed in order to extract Kerbinium from an asteroid

Kerbinium Tank: I am sure you can figure out what this is for.

RandomResource.DLL: a parts module that allows parts to be configured to have a random amount of a resource.

This is my first public mod, this is the first version bugs, balancing issues, and incompleteness are present. Right now I am reusing the Klaw, and the small tank's models.

Feel free to use RandomResource.DLL without the rest of the mod if you like :) and if you use it in your own mod please let me know, not for permission but for my ego :)

Dependency: This mod now has a dependency on Module Manager,

the work of ialdabaoth and sarbian (Included in zip below):

http://forum.kerbalspaceprogram.com/...-6-%28Jan-6%29

My ultimate vision is a mod with no dependencies but many compatibilities, and a few great partners.

=====================

SOURCE CODE AND INSTALL DIRECTIONS INCLUDED:

=====================

http://od.lk/zvar

V.2R1:Fixed a few issues including the tank cost.

V.2: Added Chance of Zero and NotRefillable

(Special Thanks to RoverDude's code on Dynamic Tanks Module for teaching a method of doing this and thus allowing me to do it)

Revision 1: Module Manager usage (Thanks RoverDude!)

License stuff:

Don't redistribute whole package online without asking me first please, you can use/distribute RandomResources.DLL and/or modify just please give credit, and let me know.

====================

The plan: (More stars means less priority)

*Ability to limit parts (so asteroids) to only have a max of X resources, for cases when someone configs them to potentially generate many different (Sidfu Good idea)

*A real mining drill, making the pumping method of extraction no longer work

**A scanning device

**Planetary Deposits (Will not be on Kerbin)

*Real Models (Will have to get help here)

***Fluctuating price

*Mod Cross compatibility (Like to make usable in EL etc)

**Think up other stuff

*** Ween from ModuleManager

*Listen to [good] suggestions

*Learn

====================

Known Issues:

* I need Models

Lets see if this astroid has some..... why yes it does!

efe7c9T.png

Transferring Kerbinium from the asteroid:

dp6cehd.png

Edited by PalverZ
New version
Link to comment
Share on other sites

uhh Pics please?

I will most assuredly post pics when I have new models for the AGMU and Tank(s) right now it looks like stock parts so there is not a huge point to do so but ill come up with a screen shot or two, :) soon just to show what little there is to show.

How do you sell it for fund?

Right now when you recover a vessel the resource is recovered as part of a vessel.

You really should not write over stock parts - use Module Manager for that.

Excellent Good idea I will try to implement that soon, overwriting was/is not my idea of the perfect solution.

Link to comment
Share on other sites

Revision 1 is up a quick patch in order to use module manager as per a good suggestion, hope it doesn't break anything too bad, I hope to not have to use MM for too long I don't like be too dependent. Tested in .24.1 seems to work ok except a cost glitch on the tank I will try to solve in V.2 .

Link to comment
Share on other sites

Some thought from me.

While offworld gathering of valuable resources is lucrative, I feel that Kerbin, as its own body, is under-utilized. A tweak to this mod for finding good ol' planet side resources scattered about in low-value concentrations would be a good mechanic for early resource gathering, or for simply spurring the player along on aerospace design.

For example, I've built an entire fleet of strictly kerbin-only aircraft and ground vehicles ranging from a

for fast recon, to a cargo transport, to fuel trucks and mining vehicles, with no place to send them, and no purpose to doing so. I've got a whole planet under my feet. Lovingly shaped and mapped by the devs, and it's little more than a giant landing pad for my next pod reentry. Why not make Kerbin do more?

What could be done is expanding the 'kerbinium' resource into a few tiers of value. With 'common' resources easy to find on kerbin, and thus not very lucrative in value, while more valued resource are rare planet-side, but abundant in space and on other bodies.

This would give players 'low risk' options for getting income. (Especially for those playing with a lot of the realism mods that inflate the difficulty in unpredictable ways.) And provides players with a soft buffer to make money for more ambitious missions, or even provide trickle income for mods that might introduce operational maintenance costs (salaries, direct maintenance, etc... I think one's already on the table.) without having to depend on contracts with vague(at this point) objectives pulled from a random number gen.

Link to comment
Share on other sites

Some thought from me. While offworld gathering of valuable resources is lucrative, I feel that Kerbin, as its own body, is under-utilized. A tweak to this mod for finding good ol' planet side resources scattered about in low-value concentrations would be a good mechanic for early resource gathering, or for simply spurring the player along on aerospace design. For example, I've built an entire fleet of strictly kerbin-only aircraft and ground vehicles ranging from a
for fast recon, to a cargo transport, to fuel trucks and mining vehicles, with no place to send them, and no purpose to doing so. I've got a whole planet under my feet. Lovingly shaped and mapped by the devs, and it's little more than a giant landing pad for my next pod reentry. Why not make Kerbin do more? What could be done is expanding the 'kerbinium' resource into a few tiers of value. With 'common' resources easy to find on kerbin, and thus not very lucrative in value, while more valued resource are rare planet-side, but abundant in space and on other bodies. This would give players 'low risk' options for getting income. (Especially for those playing with a lot of the realism mods that inflate the difficulty in unpredictable ways.) And provides players with a soft buffer to make money for more ambitious missions, or even provide trickle income for mods that might introduce operational maintenance costs (salaries, direct maintenance, etc... I think one's already on the table.) without having to depend on contracts with vague(at this point) objectives pulled from a random number gen.
A low tier planetary resource of value is a viable idea but I am not sure how far I will work on that idea, the idea has been goring on my since I read this earlier but it was not in the original plan, in fact I was going to stay away from anything on kerbin itself. Your point that some people like to stay planet side though with jets etc, does kinda make me toy with the idea of full fledged planet side mining, esp because that could be a source of funds and purpose for the people who don't want to chase asteroids (which will ultimately have the greatest yield). I most certainly will not completely dismiss this idea as it is growing on me.
Link to comment
Share on other sites

All of those ideas seem good. Wait-can you make a claw that can attach to kerbin? And if so, could you make entire biomes into resource containers?
If it was modified correctly I am sure it could however it is designed to stick to parts, and use of the Klaw like features using the AGMU will be deprecated when I come up with a tool for extraction.
Link to comment
Share on other sites

I'd use something like O.R.S. and stuff from existing mods for a planet.
I am not keen on relying on other existing mods including module manager and I will eventually work out a way where it is not needed. My vision is a mod that plays well with others but can be used alone.
Link to comment
Share on other sites

I am not keen on relying on other existing mods including module manager and I will eventually work out a way where it is not needed. My vision is a mod that plays well with others but can be used alone.

You're handicapping yourself if you do that in a way that isn't logical in the slightest. I understand wanting to keep things as contained as possible, but most, if not everyone are already using a wide array of mods and will not likely be using your mod alone - ever - beyond testing. You're making unnecessary work for yourself to chase such a vision.

In my opinion, you stand more to gain in your project by working with other mods than you do by trying to go it alone. Given the nature of what you want to do, I'd really suggest teaming up with RoverDude for this and developing as a parallel to Karbonite without the two actually being integral to each other. Karbonite is planning to use ORS and new code for randomized generation. ORS has implementation with SCANsat and Extraplanetary Launchpads. And Rover in turn has development going strong for his modular kolonization system and its orbital variant, which in turn also make use of TAC LS.

In this manner, you will have some dependencies in MM and ORS, but you'll have a strong set of complementary mods that you need not concern yourself with, allowing you to focus on the meat of your mod and providing players with your vision of the money-earning capacity of resource gathering that integrates nicely into what they already have. Don't reinvent the wheel for the third time when you don't need to.

To break it down, I imagine this is a cost benefit of working with the other mods are:

Cost:

- Dependencies on Module Manager and ORS.

(The first being one of the most important dependencies for half the mods on this site. It's NOT going anywhere unless the Apocalypse happens. The second is a well built resource distribution system originally for KSPI and other mods. It's not going anywhere either.)

Benefits

- A library of useful module commands you don't have to worry about maintaining, freeing up your work time.

- A resource distribution system ready for you to just plug in and go, already implemented in several other related projects.

- Access through the above indirectly for compatible gameplay with at LEAST the following mods WITHOUT being dependent on them:

1: EL

2: KSPI

3: MKS

4: OKS

5: SCANsat

6: Karbonite (in the near future.)

7: TAC LS

BONUS BENEFIT if you successfully team up with RoverDude.

- There are FAST modelers and texturers already working on Karbonite with RD and he only announced it last week. You would get some awesome models for your work in no time flat before you even have the code going.

Link to comment
Share on other sites

V.2 is coming along tracking down a strange bug that I think is occuring when I try to shrink a max storage.

RandomResource.Dll will contain 2 additional (and completely optional) parts to the part module that allow for stopping resources flowing back into it, and an additional chance to force 0 of the resource type.

Link to comment
Share on other sites

Starting to figure out a foundation for a fluctuating price, ( hope to make it a separate usable plugin like RandomResource so other people can use it if they want), still a low priority item to complete, also working out how I might be able to detect what an asteroid has from a distance.

Link to comment
Share on other sites

Nasty BUG!!!

I have increased the kerbinium value from 50 to 500 in the resource cfg. Whenever I try to create a ship that has kerbinium tanks, the cost of the ship becomes negative. IT GIVES ME MONEY FOR BUILDING THE SHIP instead of generating costs..

Link to comment
Share on other sites

Nasty BUG!!! I have increased the kerbinium value from 50 to 500 in the resource cfg. Whenever I try to create a ship that has kerbinium tanks, the cost of the ship becomes negative. IT GIVES ME MONEY FOR BUILDING THE SHIP instead of generating costs..

This seems to be a inherent issue with modifying a resources and setting a container to 0 of MAX amount, until i find a fix, the way to work around is:

Change the tank cost to act like what you would pay if it was full (in your case 50X500: 25000) Then add the base tank cost (I cant recall off the top of my head I think its 375 so 25375)

That should fix it, with the direction some of my code is going I will have to figure out a fix for this issue, I am not entirely certain there is an easy way for me to fix this so it will be a little before I do find the real solution, however I will most certainly bump that up on my priorities list.

Edited by PalverZ
Link to comment
Share on other sites

maybe having the tank non tweakable would fix it? also is the random recouse thing actualy randomizing whats in the roids? if it is can i add other recouses to it

I tried non tweakable it didnt seem to work it, infact I think it is non tweakble now, if I am not mistaken resources are default isTweakable = False.

AND ABSOLUTELY YES! I am excited someone asked that, it means someone will make use of the flexibility I am working hard on prototyping in :)

Instructions on randomresource.DLL are in the readme and you can just add it into my asteroid.cfg (or any new or customized part) just follow module manager rules for adding things any resource that has a definition can be randomized on any part and I set it up so there can be a forced chance of zero and even a way to determine if its refillable or not.

The plugin will actually shrink the storage if NotRefillable is true. (SEE BELOW ALSO)

I need to work on making it generate its own storage space though, right now you still need to define the max to begin with as a resource container.

Hope that (and this) helps.

MODULE
{
name = RandomResource //Means this will be random
ResourceType = Kerbinium //What resource
Min = 1 // min amount TO GENERATE
Max = 1000 //max amount (these are floats so you can get decimal amounts) TO GENERATE
ChanceOfZero = 10 //this can be 10 or .10 and do the same thing 10% of the asteroids will not have any (This defaults to zero so you can leave it off if you don't want to define it)
NotRefillable = True // this is the auto adjust storage size toggle this defualts to false so you don't have to define it.
}

RESOURCE
{
name = Kerbinium
amount = 0
maxAmount = 1000 //just make this equal or greater than your random max and it will have enough storage and if you have notrefillable as true it will shrink to match.
}


Link to comment
Share on other sites

modifed your .cfg to add other recouses u can post it as a addition. u can consider it a gift hope u keep working on it.

goes to asteroid.cfg


@PART[PotatoRoid]
{
MODULE
{
name = RandomResource
ResourceType = Kerbinium
Min = 1
Max = 1000
ChanceOfZero = 10
NotRefillable = True
}
RESOURCE
{
name = Kerbinium
amount = 0
maxAmount = 1000
}
MODULE
{
name = RandomResource
ResourceType = Water
Min = 1
Max = 10000
ChanceOfZero = 6
NotRefillable = True
}
RESOURCE
{
name = Water
amount = 0
maxAmount = 10000
}
MODULE
{
name = RandomResource
ResourceType = Kethane
Min = 1
Max = 3000
ChanceOfZero = 18
NotRefillable = True
}
RESOURCE
{
name = Kethane
amount = 0
maxAmount = 3000
}
MODULE
{
name = RandomResource
ResourceType = Ore
Min = 1
Max = 8000
ChanceOfZero = 13
NotRefillable = True
}
RESOURCE
{
name = Ore
amount = 0
maxAmount = 8000
}
MODULE
{
name = RandomResource
ResourceType = WasteWater
Min = 1
Max = 1000
ChanceOfZero = 30
NotRefillable = True
}
RESOURCE
{
name = WasteWater
amount = 0
maxAmount = 1000
}
MODULE
{
name = RandomResource
ResourceType = CarbonDioxide
Min = 1
Max = 800
ChanceOfZero = 2
NotRefillable = True
}
RESOURCE
{
name = CarbonDioxide
amount = 0
maxAmount = 800
}

}

and the ResourcesGeneric


RESOURCE_DEFINITION
{
name = Kerbinium
density = 0.010
unitCost = 50.00
flowMode = NO_FLOW
transfer = PUMP

}
RESOURCE_DEFINITION
{
name = Water
density = 0.0010000000
unitCost = 0.0001
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = CarbonDioxide
density = 0.0000019510
unitCost = 0
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = WasteWater
density = 0.0010000000
unitCost = 0
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = Ore
density = 0.0275 // average density of rock is 5.5t/m^3
unitCost = 3.52 // 128/t
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = Kethane
density = 0.002
unitCost = 0.16
flowMode = NO_FLOW
transfer = PUMP
}

reason i added carbondioxide and waste water is that alot of asteroids would have carbondixoide traped and waste water could be considered water that has differnt minerals all mixed with it.

Link to comment
Share on other sites

modifed your .cfg to add other recouses u can post it as a addition. u can consider it a gift hope u keep working on it.

goes to asteroid.cfg


@PART[PotatoRoid]
{
MODULE
{
name = RandomResource
ResourceType = Kerbinium
Min = 1
Max = 1000
ChanceOfZero = 10
NotRefillable = True
}
RESOURCE
{
name = Kerbinium
amount = 0
maxAmount = 1000
}
MODULE
{
name = RandomResource
ResourceType = Water
Min = 1
Max = 10000
ChanceOfZero = 6
NotRefillable = True
}
RESOURCE
{
name = Water
amount = 0
maxAmount = 10000
}
MODULE
{
name = RandomResource
ResourceType = Kethane
Min = 1
Max = 3000
ChanceOfZero = 18
NotRefillable = True
}
RESOURCE
{
name = Kethane
amount = 0
maxAmount = 3000
}
MODULE
{
name = RandomResource
ResourceType = Ore
Min = 1
Max = 8000
ChanceOfZero = 13
NotRefillable = True
}
RESOURCE
{
name = Ore
amount = 0
maxAmount = 8000
}
MODULE
{
name = RandomResource
ResourceType = WasteWater
Min = 1
Max = 1000
ChanceOfZero = 30
NotRefillable = True
}
RESOURCE
{
name = WasteWater
amount = 0
maxAmount = 1000
}
MODULE
{
name = RandomResource
ResourceType = CarbonDioxide
Min = 1
Max = 800
ChanceOfZero = 2
NotRefillable = True
}
RESOURCE
{
name = CarbonDioxide
amount = 0
maxAmount = 800
}

}

and the ResourcesGeneric


RESOURCE_DEFINITION
{
name = Kerbinium
density = 0.010
unitCost = 50.00
flowMode = NO_FLOW
transfer = PUMP

}
RESOURCE_DEFINITION
{
name = Water
density = 0.0010000000
unitCost = 0.0001
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = CarbonDioxide
density = 0.0000019510
unitCost = 0
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = WasteWater
density = 0.0010000000
unitCost = 0
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = Ore
density = 0.0275 // average density of rock is 5.5t/m^3
unitCost = 3.52 // 128/t
flowMode = NO_FLOW
transfer = PUMP
}
RESOURCE_DEFINITION
{
name = Kethane
density = 0.002
unitCost = 0.16
flowMode = NO_FLOW
transfer = PUMP
}

reason i added carbondioxide and waste water is that alot of asteroids would have carbondixoide traped and waste water could be considered water that has differnt minerals all mixed with it.

Cool, sweet, thats great thanks! I'll probably add that in with next release then, (with special thanks), I think I'm close to breaking code on my next segment here soon, just doing a little more research.

Link to comment
Share on other sites

Why not just use TAC life support resources instead of creating your own? Creating your own life support esque resources will no doubt cause some incompatibilities.

I think that he copy and pasted the definitions from TAC [Correct me if I am wrong] and really his intent (as seems to me) was an optional set of cfgs to save myself and others from having to add to the roids. [once again correct me if im wrong sidfu]

As for my own resource, it is such a very important part of this mod [to me] that there will be none, or minimal dependencies with as much compatibilities as I can give, (maybe things wont work together but at least they wont conflict), this project was partly undertook with this goal in order to help me learn to adapt to issues that would develop in this exact kind of project, and handle them well, or at least well enough.

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