Jump to content

Part Reconstructinator Mod - Convert your useless Mun debris into a base!


Hexicube

Recommended Posts

Finally managed to create a fully functioning prototype of my mod, I now only need to create nodes on most stock parts (some parts will not be disassemble-able), create more components (only metal/solar so far, both sharing the same model), and create the part itself (module was tacked onto another part).

Also, for those who have seen it, I'm aware this is similar to OSE-Workshop. I had a chat with the author of that mod and they felt that, at the current time, making parts break down into multiple components was too much hassle. I created this primarily as an alternative for those who didn't want to be able to break down girders to create an ion probe, which would be an alternative that I want to use.

The basic premise is this:

- Attach a Part Reconstructinator and some KIS containers to a vessel

- Launch the vessel INTO SPACE (or wherever you need it, really)

- Put the unwanted parts into the KIS container (via normal means)

- Disassemble those parts through the Part Reconstructinator to get components

- Assemble parts that you actually want through the Part Reconstructinator using those components

- Build TEH LEET BASE using your new parts

Here's a diagram to help explain how this generally works:

ix50Jeb.png

Functional notes about the mod:

- The Part Reconstructinator is only capable of processing one item at a time. I may add a queue in the future, but for now you'll have to keep track of it.

- The Part Reconstructinator works anywhere within physics range, and also respects time-warp. The GUI works with time-warp on but only shows for the active vessel.

- The Part Reconstructinator checks if an inventory is internally accessible, ignoring those which are not. With only the default KIS inventories, that would be the in-line container only.

- Components are stored inside KIS containers, they probably end up taking less volume than the part that was disassembled but should have the same mass. They also stack.

- The Part Reconstructinator will stop functioning if it can't store an item (an assembled part, or components). It will remember those items through save/load cycles, and will tell you on the GUI if it's stopped and what needs storing.

- When taking or storing items, the Part Reconstructinator will always attempt to do so on it's own inventory first, if it has one. When the mod is finished, it will have a small container primarily for storing components.

- Storing parts into containers respects container volume limitations, and will also try to add those parts onto an existing stack in that inventory before taking a free slot (currently only components check for stacks).

- The mod will not be balanced for career mode, it's flat-out impossible to remove all loopholes (LV-1 vs LV-1R for instance). I will balance it for science/sandbox when it's almost finished.

Things I'm considering changing for the mod, but haven't decided:

- ISRU creation of some components (i.e. gravel from ore to create ground pylons)

- Compound components (metal + electromagnet = motor)

Any part with the following node will be added to the list of parts that are recognised by the Part Reconstructinator:

HEXI_RECYCLE
{
canCreate = true
timeToDismantle = 60
costToDismantle = 600
metal = 100
}

- "canCreate" determines if the part can be assembled, all parts with the HEXI_RECYCLE node can be disassembled

- "timeToDismantle" determines how many seconds it takes to disassemble a part

- "costToDismantle" determines the total ElectricCharge needed to disassemble a part (currently assembly requires double, will change that)

- Every other line dictates a component that the part is made of (provided that component actually exists)

Any part which should be a Part Reconstructinator requires this node:

MODULE
{
name = HexiRecycler
}

Nothing complicated. There isn't a need for specific logic yet, and all the inventory shenanigans will be handled by KIS, so there's nothing you can tweak there. In the future I'll add options for if the part can (dis)assemble (cheap one-way alternatives to the big unit), cost/speed multipliers (smaller unit that processes slower, advanced unit that processes at 2x speed for 3x cost), and perhaps a limit to the volume of parts that can be (dis)assembled (as determined by KIS).

Things that I need to do (things with a + are done but not in the download yet):

- Create rest of component models

- Create a proper part for the Part Reconstructinator module (will probably be similar to the ISRU unit, in terms of size and mass)

- Display part quantities in the disassembly section of the Part Reconstructinator GUI

- Attempt to add created parts to existing stacks, assuming it's stackable in the first place

- Prevent using the Part Reconstructinator if the vessel lacks control capability

Known issues (same drill with +):

+ Creating any part that has a command module on it causes bad things to happen

- Created fuel tanks are magically filled (bug is with FSfuelSwitch, doesn't occur without it, can't fix)

- Really bad things happen to the GUI after a quick-load (NRE hiding somewhere in the render code)

- Mass isn't accounted for on items stored inside the Part Reconstructinator (not sure why, might need to call something)

Download: https://dl.dropboxusercontent.com/u/13281778/KSP%20Mods/Part%20Reconstructinator%20Mod%20V0.2.zip (V0.2)

Note that you'll have to do some config editing to make use of that download (adding the module onto a part).

The module should be bug-free, however I haven't done extensive testing on it. I'm also unsure on the CPU impact, considering there's a lot of iterative tasks going on per physics step it might actually be a little bit excessive.

Source code comes with the download, however the VS2013 project uses some absolute paths to the referenced KSP libraries. Vanilla KSP is installed on my E drive (mod area is on C), so you'll have to change them to match your install location.

My license of choice is CC BY-SA-NC 4.0 International. That can be found here: https://creativecommons.org/licenses/by-nc-sa/4.0/

Edited by Hexicube
Link to comment
Share on other sites

Pictures or Diagrams (preferably the latter, I personally like diagrams better) please, Visual learners, like me have trouble grasping a concept from just a big wall of text.
I added a diagram to the main post (tad oversized but w/e), did that help?
Link to comment
Share on other sites

Starting the tedious task of making 'recipes' for pretty much every stock part, should be fun.

One thing I have noticed, the radial xenon tank has a dry mass of 31.43. What a fun number 3143 is, the product of 7 and 449, both of which are primes. That means to have my metal component (which is filler) not need HUGE quantities (like, actual millions) for most parts, I'll be changing that to 31.5 with ModuleManager (which is also adding the recipe node to EVERYTHING), allowing the metal component to have a mass of 500g (0.0005) instead of 10g (0.000001) to perfectly mass-match all parts (all other parts have masses to a half-kilo).

For those interested, the components will end up working like this:

- Metal = Filler component for most parts

- Plastic = Filler component for some parts

- Thruster = 1 per 2kN of thrust, rounded up

- Battery = 1 per 5 ElectricCharge storage

- Solar = 1 per 5? ElectricCharge generation

- Electromagnet = 1 per ? torque

- Blutonium238 = Don't need a rule as only 2 parts need it

- Computer = Added to any part with a controllable function (gimbal, reaction wheel, actual wheel) excluding the ability to throttle

So far, most parts are pretty simple. Engines end up just being metal and thrusters (need to include computers for those that gimbal), and fuel tank and structural parts are 100% metal. I'm contemplating if having the plastic filler is required, as nothing would really be lost by just using the metal filler instead.

Edited by Hexicube
Link to comment
Share on other sites

Uploaded another test version, this one has a bunch of new things (if I can remember them):

- All stock parts (more-or-less) have recycle recipes attached, making the module fully functional once it's added to a part

- Mousing over a part in either the assembly or disassembly screen shows information about that part

- Other stuff (can't remember, first bullet point took up most of the time on this)

I've also fixed a couple things:

- Changed how I constructed a KIS_Item for information gathering, on some parts this was waking the kraken

- Fixed issues with low power and 100% completion detection (float vs double shenanigans)

Just pop a HexiRecycler module onto another part with this new version and you'll get an idea of what I want the end product to be like! This is also a good time for balancing feedback.

https://dl.dropboxusercontent.com/u/13281778/KSP%20Mods/Part%20Reconstructinator%20Mod%20V0.2.zip

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