Jump to content

[Min KSP 1.12.X] Sandcastle: 3D printing for parts and vessels


Angelo Kerman

Recommended Posts

13 minutes ago, Angel-125 said:

People are having issues with 1.12 EL? Eek! The idea is that EL's plugin will drive the 3D printer such that you don't need kerbals to print up a vessel. Just select the craft you want to make as you do now, and let the robots do the work. This is similar to NASA's 3D habitat challenge where robots build the homes for astronauts before they arrive.

Yup seems the EL  GUI won't work hence questioning whether it was Sandcastle that you select the craft file and hit build through.

That's my plan although it is for a EL to build a colony part that is 350tons on the ground anchor

Link to comment
Share on other sites

I'm looking  into the configs for SIMPLEX Assembly, which will be a mixture of RocketParts and MaterialKits with CRP, or MetalParts and CustomParts with SIMPLEX Resources.

I have a question though @Angel-125, what other mods to I need so that the Playa part isn't a grey cylinder?

Link to comment
Share on other sites

48 minutes ago, theJesuit said:

I'm looking  into the configs for SIMPLEX Assembly, which will be a mixture of RocketParts and MaterialKits with CRP, or MetalParts and CustomParts with SIMPLEX Resources.

I have a question though @Angel-125, what other mods to I need so that the Playa part isn't a grey cylinder?

The Playa is a test part that I made for Sandcastle and is by no means complete. You can safely ignore it. :)

Link to comment
Share on other sites

@Angel-125 I'm looking at these configs (nicely commented on thank you!)  and I was wondering about  ratios of resources to make parts.

So if I have part, say pods, that I'd like to be 1/2 MetalParts and 1/2 CustomParts, 

MATERIALS_LIST
	{	
		name = Pods
		RESOURCE	
			{
				name = MetalParts
				rate = 1
			}
		RESOURCE	
			{	
				name = CustomParts
				rate = 1
			}
	}

With this, Sandcastle seems to use make the part with the total mass of each resource. effectively making it with double the mass of the resource and producing an  equal amount of waste. 

Against instruction I changed the values to 0.5 but Sandcastle seemed to round them to 1 anyway.

Any suggestions?

Edited by theJesuit
Link to comment
Share on other sites

28 minutes ago, theJesuit said:

@Angel-125 I'm looking at these configs (nicely commented on thank you!)  and I was wondering about  ratios of resources to make parts.

So if I have part, say pods, that I'd like to be 1/2 MetalParts and 1/2 CustomParts, 

MATERIALS_LIST
	{	
		name = Pods
		RESOURCE	
			{
				name = MetalParts
				rate = 1
			}
		RESOURCE	
			{	
				name = CustomParts
				rate = 1
			}
	}

With this, Sandcastle seems to use make the part with the total mass of each resource. effectively making it with double the mass of the resource and producing an  equal amount of waste. 

Against instruction I changed the values to 0.5 but Sandcastle seemed to round them to 1 anyway.

Any suggestions?

Actually, my suggestion (in case I wasn't understood) given that 6 month old hasn't allow much sleep, was to have a ratio setup somehow, maybe part of the rate if the rate can't be less than one?

Also, requiring parts, this also adds to waste, as with the batteries needed for probe cores, the resource + battery is also wastage.  Could this be adjusted please?

Link to comment
Share on other sites

6 minutes ago, theJesuit said:

Actually, my suggestion (in case I wasn't understood) given that 6 month old hasn't allow much sleep, was to have a ratio setup somehow, maybe part of the rate if the rate can't be less than one?

Also, requiring parts, this also adds to waste, as with the batteries needed for probe cores, the resource + battery is also wastage.  Could this be adjusted please?

The idea behind that minimum rate of 1 on the resource is to ensure that, at a minimum, the mass of resources that are required to print the part is to equal the mass of the part. What I can do is change it so that when you specify multiple resources, the total mass required must, at a minimum, equal the mass of the printed part. If there is a shortfall, then the part will require Ore to make up the difference.

As for the batteries, it's meant to be an example of how you can create specialized parts that require other parts as components. I don't consider that wasteful, but rather, a prerequisite for making the part. Since that code is working, I can comment out the battery requirement in the next release.

I have some other changes planned for the next release as well:

  • If a part is on the blacklist, then no 3D printer can print it. If it's a required component, then you'll have to ship it from the homeworld (or cheat and use something like Extraplanetary Launchpads). Ex: The gravitic engine requires a TD Blanket and a Black Box. Because they are a specialized components, you can't print them.
  • Some parts may require a minimum gravity, or need to be printed while in orbit. Ex: the gravitic engine requires a Solar Furnace, but the Solar Furnace needs to be printed while in a high-gravity environment like Tylo or Jool.
  • The requiredComponent entry will morph into a REQUIRED_COMPONENT node with "name" and "amount" fields so that you can require one or more parts as components in the printing process.
Link to comment
Share on other sites

32 minutes ago, Angel-125 said:

What I can do is change it so that when you specify multiple resources, the total mass required must, at a minimum, equal the mass of the printed part. If there is a shortfall, then the part will require Ore to make up the difference.

Sounds great.  If I understand, then it'll be up to the people patching to make sure that their ratios add up to 1 otherwise Ore will be used?  Makes sense.

 

32 minutes ago, Angel-125 said:

.Since that code is working, I can comment out the battery requirement in the next release.

Please do.  I seem to have issues getting it patched out.

32 minutes ago, Angel-125 said:

If a part is on the blacklist, then no 3D printer can print it.

I assumed this was on it's way.  Ultimately, the 3D printer is limited by the amount of inventory volume available, but with a massive inventory part added at some point, then this make sense.

32 minutes ago, Angel-125 said:

Some parts may require a minimum gravity, or need to be printed while in orbit.

I like this!

Another thought to go with blacklist,  what about parts that aren't available on Kerbin?  If a part specified say category = sandcastle, then it wouldn't show in the VAB, but you could still print it.

Edited by theJesuit
Link to comment
Share on other sites

3 hours ago, theJesuit said:

Sounds great.  If I understand, then it'll be up to the people patching to make sure that their ratios add up to 1 otherwise Ore will be used?  Makes sense.

 

Please do.  I seem to have issues getting it patched out.

I assumed this was on it's way.  Ultimately, the 3D printer is limited by the amount of inventory volume available, but with a massive inventory part added at some point, then this make sense.

I like this!

Another thought to go with blacklist,  what about parts that aren't available on Kerbin?  If a part specified say category = sandcastle, then it wouldn't show in the VAB, but you could still print it.

Yup, if the sum of the rate values for each RESOURCE in a MATERIALS_LIST doesn't add up to 1, then Sandbox will add/increase the Ore required until the sum equals 1.

For blacklisted parts, you'll have to add the part to a vessel or vessel inventory while in the VAB/SPH.

Sandcastle only recognizes the stock part categories (Aero, Cargo, Communication, Control, Coupling, Electrical, Engine, FuelTank, Ground, Payload, Pods, Robotics, Science, Structural, Thermal, Utility) So if a part isn't in one of those categories, then it can't be printed. It's too much of a hassle to add custom part categories, community categories, and the like.

Link to comment
Share on other sites

24 minutes ago, Angel-125 said:

So if a part isn't in one of those categories, then it can't be printed

I was thinking that it would be nice if parts weren't able to be produced in the VAB.  Like a special fibreoptics or a science experiement that cant be produced in a gravity... just as you suggested with the gravity option.  Is there a manufacturer on kerbin that has access to microgravity or a high gravity area to produce those parts?

I'm not suggesting the rabbit hole of Community Categories (or kerbalims) , only a unique one that isnt in the VAB only on the 3d Printer.

 

Link to comment
Share on other sites

Wiki is now available.

IsAiPbR.png

Sandcastle 0.3.0 is now available:

Changes

New Part Module

- WBIPrinterRequirements: Added to parts that have a ModuleCargoPart or ModuleGroundPart or a part module derived from ModuleCargoPart/ModuleGroundPart, this part module lists the material requirements and conditions needed to 3D print the part in the VAB/SPH part info panel.

3D Printers

- PARTS_BLACKLIST: You can specify one or more blacklistedPart entries in this node. The value is the name of the part (NOT the title). If a part is on the blacklist, then 3D printers cannot print it. If it's a required component for another part, then you'll have to add the blacklisted part to a vessel or inventory while in the VAB/SPH (or cheat and use something like Extraplanetary Launchpads).
NOTE: You can specify a global PARTS_BLACKLIST, which affects ALL 3D printers, and/or a PARTS_BLACKLIST to a WBIPrintShop which only affects that specific printer. if a part is on the global blacklist but not on the WBIPrintShop's local blacklist, then the part is still banned from being printed.
NOTE: The WBIPrintShop's PARTS_WHITELIST overrides the global/local PARTS_BLACKLIST.
Ex: The Kerbal Flying Saucers GND-00 Gravitic Engine requires a TD Blanket and a Black Box. Because they are specialized components that are listed on the global PARTS_BLACKLIST, no printer can print them. To make a GND-00 Gravitic Engine offworld, you'll need to ship the TD Blanket and Black Box to the printer.

- You can add an optional minimumGravity field to a part config to specify, in m/sec^2, how much gravity/acceleration is needed to print the part. If the printer's vessel is below the minimum threshold, then the part cannot be printed. If you specify a value of 0, then the printer will need to be in orbit, sub-orbital, or on an escape trajectory, and not accelerating. The default value is -1, which means that there are no g-level restrictions.
Ex: The Kerbal Flying Saucers GND-00 Gravitic Engine requires a GN Furnace, but the GN Furnace needs to be printed while in a high-gravity environment like Tylo.

- You can add an optional minimumPressure field to a part config to specify, in kPA, how much pressure is needed to print the part. If the printer's vessel is below the minimum threshold, then the part cannot be printed. If you specify a value of 0, then the printer will need to be in a vacuum. A value > 1 requires atmospheric pressure or the depths of an ocean. The default is -1, which means that there are no pressure restrictions.
Ex: The Kerbal Flying Saucers GND-00 Gravitic Engine requires a GN Furnace, but the GN Furnace needs to be printed while in a vacuum.

- You can add an optional canPrintHiddenPart = true field to a part config to add parts that have a ModuleCargoPart, ModuleGroundPart, or a part module derived from ModuleCargoPart, in their config file. Parts hidden from the tech tree and/or editor that have canPrintHiddenPart = true will be printable with a 3D printer.
IMPORTANT NOTE: The part config must set category = none and TechHidden = true.

- WBIPrintShop has a new part category that it can print from: none. It appears as "Special" in the GUI. Parts marked with category = none and TechHidden = true and canPrintHiddenPart = true will appear in this new part category.

- Removed the optional requiredComponent field, and replaced it with the following config node:
REQUIRED_COMPONENT
{
    // The name of the part that is required as a component in order to print the part.
    name = somePartName

    // The required number of required parts that must be in the vessel's inventory in order to print the part. Default is 1.
    amount = 2
}

- When specifying one or more resources in a MATERIALS_LIST, the sum of each RESOURCE's rate field must be equal to or greater than 1. If that isn't the case, then the 3D printer will add Ore as a material requirement until the total sum of each RESOURCE's rate is equal to 1.

New Part

- Box of Generic Specialized Parts: This 0.625m cube contains various specialized components that were originally created by a heroic individual in a cave with a box of scraps. They are used as required components for some 3D printed parts. The specialized parts themselves cannot be 3D printed and must be shipped to the desired 3D printer.
NOTE: No parts currently require the Box of Generic Specialized Parts. This part is provided for modders who want a generic part that must be shipped in order to complete printing of a desired part.

Sample Config

Creative use of the new options makes it possible to restrict parts from being added in the VAB/SPH and requiring a 3D printer to make them.
Additionally, with the new prerequisite conditions, you can spread part creation throughout the solar system. For instance, maybe a component made from metastable metallic hydrogen needs Jool's unique conditions, while another component needs Tylo's environment.

Below are sample part configs that demonstrate the new features. These parts don't actually exist in Kerbal Flying Saucers- yet. Imagine that they did, and that KFS included these module manager patches.

// We're going to modify the GND-00 Gravitic Engine so that it can only be made in space. It requires specialized components, some of which can't be 3D printed,
// and others that can only be 3D printed.
@PART[wbiGND00]:NEEDS[Sandcastle]
{
    // Hide the part from the VAB/SPH so that it can only be printed from a 3D printer.
    category = none
    TechHidden = true

    // Make sure that the part can be printed from a 3D printer. It will show up in the printer's "Special" part category.
    canPrintHiddenPart = true

    // The GND-00 Gravitic Engine requires a TD Blanket, a GN Black Box, and a GN Furnce in order to be printed.
    REQUIRED_COMPONENT
    {
        name = wbiTDBlanket
        // Remmeber, amount = 1 is the default, so we don't have to include it.
    }
    REQUIRED_COMPONENT
    {
        name = wbiGNBlackBox
        amount = 2
    }
    REQUIRED_COMPONENT
    {
        name = wbiGNFurnace
    }
}

// The GN Furnace can't be bought in the VAB/SPH, but it can be printed.
// Here, we are defining the part- but only if Sandcastle is installed.
PART:NEEDS[Sandcastle]
{
    name = wbiGNFurnace

    // Hide the part from the VAB/SPH so that it can only be printed from a 3D printer.
    category = none
    TechHidden = true

    // Make sure that the part can be printed from a 3D printer.
    canPrintHiddenPart = true

    // The GN Furnace can only be made in a high gravity environment and in a vacuum- like, say, on Tylo...
    minimumGravity = 9.81
    minimumPressure = 0

    // ...And so on with the other config file entries for a typical KSP part...
}

// Blacklist the TD Blanket and GN Black Box so they MUST be sent from the VAB/SPH
// NOTE: You don't need one single global PARTS_BLACKLIST. You can define as many global PARTS_BLACKLIST nodes as you'd like, and Sandcastle will read all of them.
PARTS_BLACKLIST
{
    blacklistedPart = wbiTDBlanket
    blacklistedPart = wbiGNBlackBox
}

// Define the TD Blanked- but only if Sandcastle is installed. We do something similar for the GN Black Box.
PART:NEEDS[Sandcastle]
{
    name = wbiTDBlanket
    ...
}

Link to comment
Share on other sites

53 minutes ago, Angel-125 said:

You can add an optional canPrintHiddenPart = true field to a part config to add parts that have a ModuleCargoPart, ModuleGroundPart, or a part module derived from ModuleCargoPart, in their config file. Parts hidden from the tech tree and/or editor that have canPrintHiddenPart = true will be printable with a 3D printer.
IMPORTANT NOTE: The part config must set category = none and TechHidden = true.

This is great thank you!  Haven't had a chance to test,  hopefully tomorrow.  

Bit nervous about the TechHidden though. Looking forwardto trying it it out.

Peace.

Link to comment
Share on other sites

1 hour ago, theJesuit said:

This is great thank you!  Haven't had a chance to test,  hopefully tomorrow.  

Bit nervous about the TechHidden though. Looking forwardto trying it it out.

Peace.

Take a look at how Squad deprecates parts. What they do is set category = none and TechHidden = true. Existing craft are unaffected, but newer craft won't use that part anymore- they'll use the newer version. Hidden parts that still can be printed work the same way. You won't see them in the editor, but you can still print them.

Link to comment
Share on other sites

33 minutes ago, Angel-125 said:

Take a look at how Squad deprecates parts. What they do is set category = none and TechHidden = true. Existing craft are unaffected, but newer craft won't use that part anymore- they'll use the newer version. Hidden parts that still can be printed work the same way. You won't see them in the editor, but you can still print them.

Also means you can print Squads depreciate parts?

Link to comment
Share on other sites

Just now, taniwha said:

I can't promise a release date, but it turns out my work on EL last year has paid off big time: EL (dev branch) compiled for 1.9.1 seems to work in 1.12.2 (still testing).

That's amazing  thank you for your hard work last year!

Peace.

Link to comment
Share on other sites

I updated SIMPLEX Assembly 0.6 to include ratios.  This is great thanks!

I'm going to also include an option to allow for Community Resource Pack MaterialKits and Specialised Parts.

I'm also going to change the inventory parts that I have included.  Instead I'm thinking of using Mk3 cargo bays without the opening and closing doors though :), welded possibly with the original Mk2landercan  if this still exists in the Squad files.

Then there will be a small, medium and large and all 2.5m tanks will be able to be printed.  Each craft will have a limit on what it can create.  Some parts will be blacklisted to only  be made with the lab, like science parts, probes, and parachutes.  Still not sure what I want to do with parachutes - making them out of metal seems a bit wonky.

That will be in the 0.7 release.

Link to comment
Share on other sites

11 hours ago, theJesuit said:

 @Angel-125 quick question now that EL is looking good :) does Sandcastle calculate the EL recipe requirements from its own configs?

 

@taniwha added recipes to EL a few years ago, so there's no need for Sandcastle to do that. The Sandcastle materials list is only used for 3D printing parts, not whole vessels. They're two different systems- Sandcastle will just add a robotic printer or two specifically to work with EL.

I'm also considering a small, modular part set that lets you make something like this:

dcnb2um-4e6ffd34-939c-4e8b-af43-884f7224

The idea being that you build it in sections with EL, then position the EL 3D printer crane to create vessels in space.  Functionally, the modular shipyard is just like the existing spacedocks from MOLE:

2iDZs68.png

But unlike the inflatable ones, the modular shipyard can have varying sizes and shapes with just a few parts. Given the refocus of Sandcastle, the modular shipyard mini-mod would be perfect.

Link to comment
Share on other sites

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