Double Assembling Machine

This is the place to request new mods or give ideas about what could be done.
Post Reply
Mecejide
Fast Inserter
Fast Inserter
Posts: 170
Joined: Mon Sep 23, 2019 8:12 pm
Contact:

Double Assembling Machine

Post by Mecejide »

It’s like https://mods.factorio.com/mod/DoubleFurnace, except it’s an assembling machine. This means it assembles one type of item, such as copper cable, and then uses that type of item to assemble another, such as electronic circuits. In the example I gave, the overall recipe would be 3 copper plate+2 iron plate+2.5 seconds->2 electronic circuit.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Double Assembling Machine

Post by darkfrei »

Mecejide wrote:
Sat Nov 28, 2020 11:21 pm
It’s like https://mods.factorio.com/mod/DoubleFurnace, except it’s an assembling machine. This means it assembles one type of item, such as copper cable, and then uses that type of item to assemble another, such as electronic circuits. In the example I gave, the overall recipe would be 3 copper plate+2 iron plate+2.5 seconds->2 electronic circuit.
The whole mod code:

Code: Select all

data:extend({
	{
		type = "recipe",
		name = "electronic-circuit",
		energy_required = 2.5,
		ingredients =
		{
			{"copper-plate", 3},
			{"iron-plate", 2}
		},
		result = "electronic-circuit",
		result_count = 2
	}
})

Mecejide
Fast Inserter
Fast Inserter
Posts: 170
Joined: Mon Sep 23, 2019 8:12 pm
Contact:

Re: Double Assembling Machine

Post by Mecejide »

darkfrei wrote:
Tue Dec 01, 2020 10:00 pm
Mecejide wrote:
Sat Nov 28, 2020 11:21 pm
It’s like https://mods.factorio.com/mod/DoubleFurnace, except it’s an assembling machine. This means it assembles one type of item, such as copper cable, and then uses that type of item to assemble another, such as electronic circuits. In the example I gave, the overall recipe would be 3 copper plate+2 iron plate+2.5 seconds->2 electronic circuit.
The whole mod code:

Code: Select all

data:extend({
	{
		type = "recipe",
		name = "electronic-circuit",
		energy_required = 2.5,
		ingredients =
		{
			{"copper-plate", 3},
			{"iron-plate", 2}
		},
		result = "electronic-circuit",
		result_count = 2
	}
})
That code looks like it only adds a single recipe.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Double Assembling Machine

Post by darkfrei »

Mecejide wrote:
Wed Dec 02, 2020 1:03 am
That code looks like it only adds a single recipe.
Yes, you are need to define what pairs of recipes must be compound. You cannot say: "do all recipes!"
You are need defined pairs, same as by your example. No example - no recipe.

User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 416
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Double Assembling Machine

Post by kirazy »

darkfrei wrote:
Wed Dec 02, 2020 8:07 am
Mecejide wrote:
Wed Dec 02, 2020 1:03 am
That code looks like it only adds a single recipe.
Yes, you are need to define what pairs of recipes must be compound. You cannot say: "do all recipes!"
You are need defined pairs, same as by your example. No example - no recipe.
You could probably make a gnarly recursive algorithm to do this, but... it would be gnarly.

Take a given recipe, read the ingredients.

Search existing recipes for each ingredient.

If recipe exists, replace the ingredient in the first recipe with the ingredients in the second.

Repeat until you can't find a recipe.

Subject to unforseen obstacles, of course. Like when the ingredient is from multiple recipes.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Double Assembling Machine

Post by darkfrei »

kirazy wrote:
Wed Dec 02, 2020 9:50 am

Repeat until you can't find a recipe.
Now you build rocket parts from ore and crude oil.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Double Assembling Machine

Post by Deadlock989 »

It's the recycling/scrapping algorithm in reverse. Break all ingredients down into the ingredients from their recipes. Continue until nothing can be broken down further. Add all the constituent ingredients together. In this case you could maybe stop it after just one or two iterations so that you avoid the ore -> rockets effect, but since the original poster has a history of posting incredibly terse, vague requests and then complaining when people don't read his mind, I'm not going to try and guess what it is he wants.
Image

Mecejide
Fast Inserter
Fast Inserter
Posts: 170
Joined: Mon Sep 23, 2019 8:12 pm
Contact:

Re: Double Assembling Machine

Post by Mecejide »

What I want is an assembling machine that crafts the equivalent of two assembling machine recipes at a time. For example, it could make an engine unit from a steel plate, iron plates, and pipes or from a steel plate, iron plates, and an iron gear wheel but not iron plates, an iron gear wheel, and pipes (because steel plates aren’t made in an assembling machine); from a steel plate and iron plates (because that would be three recipes, not two); or from a steel plate, an iron gear wheel, and pipes (because that would be one recipe, also not two, and it would be a waste of resources since the double assembling machine should be pretty expensive).

User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 416
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Double Assembling Machine

Post by kirazy »

Mecejide wrote:
Wed Dec 02, 2020 6:26 pm
What I want is an assembling machine that crafts the equivalent of two assembling machine recipes at a time. For example, it could make an engine unit from a steel plate, iron plates, and pipes or from a steel plate, iron plates, and an iron gear wheel but not iron plates, an iron gear wheel, and pipes (because steel plates aren’t made in an assembling machine); from a steel plate and iron plates (because that would be three recipes, not two); or from a steel plate, an iron gear wheel, and pipes (because that would be one recipe, also not two, and it would be a waste of resources since the double assembling machine should be pretty expensive).
So you'd need an algorithm that decomposes ingredients into their constituents, subject to filtering, e.g. you don't decompose a steel plate, and you'd only apply it on the ingredients of the item you're intending to make.

I think trying to make an assembling machine that you pick a recipe and you can input the ingredients from one step removed would be much harder.

User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 416
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Double Assembling Machine

Post by kirazy »

darkfrei wrote:
Wed Dec 02, 2020 10:58 am
kirazy wrote:
Wed Dec 02, 2020 9:50 am

Repeat until you can't find a recipe.
Now you build rocket parts from ore and crude oil.
You could make a whitelist of which components should not be decomposed, everything made in furnaces for example.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Double Assembling Machine

Post by darkfrei »

kirazy wrote:
Wed Dec 02, 2020 8:35 pm
You could make a whitelist of which components should not be decomposed, everything made in furnaces for example.
Now you build rocket parts from iron plates and copper plates (and crude oil).

User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 416
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Double Assembling Machine

Post by kirazy »

darkfrei wrote:
Wed Dec 02, 2020 10:31 pm
kirazy wrote:
Wed Dec 02, 2020 8:35 pm
You could make a whitelist of which components should not be decomposed, everything made in furnaces for example.
Now you build rocket parts from iron plates and copper plates (and crude oil).
Which is where you don't apply the algorithm generally. He's not asking to make everything from their base components, only to be able to do a two-step recipe process in one-step, so rather than an assembling machine for copper cables into an assembling machine for electronic circuits, you'd have one machine for electronic circuits taking the inputs for copper cables in addition to its normal inputs.

For something like rocket parts, you'd have intermediaries at one remove, not all the way to maximum decomposed.

Post Reply

Return to “Ideas and Requests For Mods”