[MOD 0.17] Crafting Combinator

Topics and discussion about specific mods
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

gridstop wrote:
quote
The module prototype has a list of recipes which it can work with and I'm actually using that to try to determine whether to move the module or not. It must be some problem on my part - I should be able to fix that.

It's good to hear that everything else seems to be fine. To be honest, I expected at least half of the new things to be somehow broken :P

Cheers TRK
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

Version 0.5.1 released.
Changes:
* Fixed that module would be moved even when not necessary which caused duplication ([251542](viewtopic.php?f=93&t=34405&start=20#p251542))
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

So turns out the module bug was there because I assumed that LuaItemProtoype.limitations is nil when the module has no limitations, but it (quite unintuitively) is just an empty table.
Anyway, it should now work as intended - even with other mods that add modules.

Cheers TRK
gridstop
Inserter
Inserter
Posts: 47
Joined: Sun Jul 17, 2016 1:46 am
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by gridstop »

Yep, looks like it stopped doing that. Also I removed every last piece of logic I had to prevent inserter jams, and the hand-emptying stuff works perfectly (at least with stack inserters which is all I tested).

Minor nit: The rocket part signal works just fine but the hover tooltip name shows: Unknown key: "virtual-signal-name.rocket-part"
I think from when I hacked a blueprint string to produce it that rocket part is an item and not a virtual signal?

Also, I know this is a side effect, but the recipe combinator in 'read products' mode is now an amazingly easy way to display arbitrary item signals in a way the user can see them without trying to hover a pole and look at the signals. It's super handy for the stack my factory has so I can see all the sub-components that are queued up when it's building something. So thanks for that too!
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

gridstop wrote:Yep, looks like it stopped doing that. Also I removed every last piece of logic I had to prevent inserter jams, and the hand-emptying stuff works perfectly (at least with stack inserters which is all I tested).
Awesome, I'm happy that there are no other problems!
gridstop wrote: Minor nit: The rocket part signal works just fine but the hover tooltip name shows: Unknown key: "virtual-signal-name.rocket-part"
I think from when I hacked a blueprint string to produce it that rocket part is an item and not a virtual signal?
I'm pretty sure I can fix that, just hang on...
gridstop wrote: Also, I know this is a side effect, but the recipe combinator in 'read products' mode is now an amazingly easy way to display arbitrary item signals in a way the user can see them without trying to hover a pole and look at the signals. It's super handy for the stack my factory has so I can see all the sub-components that are queued up when it's building something. So thanks for that too!
Hmm, that's an interesting idea, maybe I could make a mod dedicated to this? I could also make it so that it doesn't return the signal, so you don't have to deal with that. It would also truly select any arbitrary signal rather than just the recipes.
I could certainly see myself using something like that, but I'm not sure if it's worth having an entire mod for it, so some input on this would be apreciated ;)

Cheers TRK
gridstop
Inserter
Inserter
Posts: 47
Joined: Sun Jul 17, 2016 1:46 am
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by gridstop »

So in relation to that, here's 3 main possible 'enhancements' that are related to the crafting combinator, but perhaps not enough that they should be part of this mod. They might belong in their own mods, I'm not sure. A lot may be particular to the way I'm using it, so take with a grain of salt...

1) The ability to display a signal so the player can easily see the type of signal in the game world, would be really handy for lots of combinator contraptions. Maybe this is more appropriate as a feature request / enhancement for the nixie tubes mod or one of the other circuit-displaying mods. Kind of funny that nixie tubes added the ability to display most of the virtual signals (letters, numbers) but not items, while the recipie combinator can be used to display items but not virtual signals.

2) The ability to arbitrarily select a single signal from a random collection of signals. For my factory, I need to do this to split the ingredients of a recipe in time, so that I can do one, then the other, then the other. Right now you have to build large contraptions to 'prioritize' and pick the first signal that matches a hardcoded list of signals. Then as you select each component you feed that amount back into the input as a negative so it moves on to the next item. This is very particular to what I'm doing though, most people probably will just feed the components into a requester chest and that's it. But a mod that adds a simple 'any number of signals in and we just feed the first one in the list out' combinator could be immensely helpful for a lot of things. Similar things have been requested before: viewtopic.php?t=28946

3) Some way to tie bottleneck mod into crafting combinator. Basically in read recipe mode, it would be nice to see some additional information about the assembler like:
a) The current craft speed of the assembler, as a separate signal from craft time so we can easily do the division and figure out actual craft time for the recipe. Would probably have to make all the times * 100 or even 1000, since you would get craft times down in the 0.04 range for vanilla, and who knows how low for bob's mods.
b) red, yellow, and green signals indicating if the assembler is crafting, blocked on output, blocked on input. (ie the bottleneck mod) This is one that might make more sense as a feature of bottleneck, to get their status into the circuit network somehow. But even ignoring integration with bottleneck, Even a simplified 'on/off' indicating whether the progress bar has moved in the last update interval, regardless whether it's blocked on input or output could be handy in crafting combinator.


Again, I don't know if any of these interest you, the mod I think already does everything it needs to do to fulfill its core purpose. I've really enjoyed using it to make this factory, so thanks again.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

Version 0.5.2 released.
Changes:
* Removed rocket part signal and made the rocket part item not hidden to fix [251643](viewtopic.php?f=93&t=34405&start=40#p251643) and prevent flickering issues
gridstop
Inserter
Inserter
Posts: 47
Joined: Sun Jul 17, 2016 1:46 am
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by gridstop »

An odd mod interaction:

The Crafted Artifacts mod (adds rare earth, superconductors, superconducting wire, and crafted alien artifacts) oddly the recipe combinator works with the rare earth, superconductor, superconducting wire, but not the actual alien artifacts. The crafting combinator works with the rare earth (on chem plants) and superconducting wire (on assemblers) but also cannot set an assembler to make the crafted artifacts.

Normally the mod is used with 'Artifact Retexture' so alien artifacts are named 'Advanced processing units' but whether that mod is installed or not doesn't seem to affect whether it works.

The alien artifacts (or advanced processing units in the reskin mod) take 4 superconducting wire and 1 processing unit. There must be something unusual about the recipe that makes it not work.

Possibly because the recipe it adds has a different name than the item it produces, which seems unusual?

Code: Select all

  {
    type = "recipe",
    name = "advanced-processing-unit",
    enabled = false,
    energy_required = 20,
    category = "advanced-crafting",
    ingredients =
    {
      {"superconducting-wire", 4},
      {"processing-unit", 1},
    },
    result = "alien-artifact"
  }
EDIT: Yeah changing that mod to use name="alien-artifact" as the recipe name makes it work. Not sure if that's something they're not supposed to do, or if crafting combinator should be able to handle it. Also not sure if that's something other mod makers might be doing much.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

gridstop wrote:So in relation to that, here's 3 main possible 'enhancements' that are related to the crafting combinator, but perhaps not enough that they should be part of this mod. They might belong in their own mods, I'm not sure. A lot may be particular to the way I'm using it, so take with a grain of salt...

1) The ability to display a signal so the player can easily see the type of signal in the game world, would be really handy for lots of combinator contraptions. Maybe this is more appropriate as a feature request / enhancement for the nixie tubes mod or one of the other circuit-displaying mods. Kind of funny that nixie tubes added the ability to display most of the virtual signals (letters, numbers) but not items, while the recipie combinator can be used to display items but not virtual signals.

2) The ability to arbitrarily select a single signal from a random collection of signals. For my factory, I need to do this to split the ingredients of a recipe in time, so that I can do one, then the other, then the other. Right now you have to build large contraptions to 'prioritize' and pick the first signal that matches a hardcoded list of signals. Then as you select each component you feed that amount back into the input as a negative so it moves on to the next item. This is very particular to what I'm doing though, most people probably will just feed the components into a requester chest and that's it. But a mod that adds a simple 'any number of signals in and we just feed the first one in the list out' combinator could be immensely helpful for a lot of things. Similar things have been requested before: viewtopic.php?t=28946
Yes, both of these points would be quite useful when working with the circuit network.
I don't think it's too necessary for the 'n to 1 signals' combinator to have the ability to filter by condition (as mentioned in the linked thread) as you could easily achieve that with a simple decider right before it. That would mean that the implementation would be quite simple (especially since I could probably just copy most of the code from this mod).

The problem is, what mod to put these in. There are three options that I can think of:

1) Put both of them into a 'circuit network utilities' mod and call it a day. This would have the advantage that I (or anyone else) could eventually add other similar miscellaneous circuit-related things to it. It is somewhat controversial however, as it removes the option for you to select what functions you want individually, but on the other hand it reduces the number of mods that you need to install and could also make the different utilities somewhat unified.

2) Try to get some authors to integrate them into their related mods. I'm thinking Nixie tubes for the display, but am not sure about the other combinator (that I have no idea what to call yet :P). Maybe I could throw it into my circuit network switch mod? If that was the case tho, it would probably make more sense to go with point 1

3) Make them all separate mods. I don't particularly love this option as it is mostly a polar opposite of point 1, which I'm probably inclined to the most, but it's certainly a way to do it too.
gridstop wrote: 3) Some way to tie bottleneck mod into crafting combinator. Basically in read recipe mode, it would be nice to see some additional information about the assembler like:
a) The current craft speed of the assembler, as a separate signal from craft time so we can easily do the division and figure out actual craft time for the recipe. Would probably have to make all the times * 100 or even 1000, since you would get craft times down in the 0.04 range for vanilla, and who knows how low for bob's mods.
b) red, yellow, and green signals indicating if the assembler is crafting, blocked on output, blocked on input. (ie the bottleneck mod) This is one that might make more sense as a feature of bottleneck, to get their status into the circuit network somehow. But even ignoring integration with bottleneck, Even a simplified 'on/off' indicating whether the progress bar has moved in the last update interval, regardless whether it's blocked on input or output could be handy in crafting combinator.
This is a very interesting idea. I don't use bottleneck myself, but I can imagine how this would be useful to people.
The first point shouldn't be too hard to do. I could possibly even make the 'speed multiplier' a configurable option, so if you get too low values, you could just change that to whatever suits your needs. It would probably be a good idea to do the same for the 'crafting time' signal in recipe combinator, come to think of it.
The other one might be a bit tricky, as I don't feel like redoing what bottleneck does is a great idea for multiple reasons. Maybe if bottleneck exposes an interface to query the current status, I could make it an optional dependency or something...
gridstop wrote:Again, I don't know if any of these interest you, the mod I think already does everything it needs to do to fulfill its core purpose. I've really enjoyed using it to make this factory, so thanks again.
You're welcome ;)
gridstop wrote:An odd mod interaction:

The Crafted Artifacts mod (adds rare earth, superconductors, superconducting wire, and crafted alien artifacts) oddly the recipe combinator works with the rare earth, superconductor, superconducting wire, but not the actual alien artifacts. The crafting combinator works with the rare earth (on chem plants) and superconducting wire (on assemblers) but also cannot set an assembler to make the crafted artifacts.

Normally the mod is used with 'Artifact Retexture' so alien artifacts are named 'Advanced processing units' but whether that mod is installed or not doesn't seem to affect whether it works.

The alien artifacts (or advanced processing units in the reskin mod) take 4 superconducting wire and 1 processing unit. There must be something unusual about the recipe that makes it not work.

Possibly because the recipe it adds has a different name than the item it produces, which seems unusual?

Code: Select all

  {
    type = "recipe",
    name = "advanced-processing-unit",
    enabled = false,
    energy_required = 20,
    category = "advanced-crafting",
    ingredients =
    {
      {"superconducting-wire", 4},
      {"processing-unit", 1},
    },
    result = "alien-artifact"
  }
This does indeed sound strange. Unless I'm missing something, the mod should handle these kinds of recipes just fine. I'll see if I can figure out what's happening there.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

gridstop wrote:
quote
So, I tested this and it seems to behave as expected. What should have probably been my first question tho: Are you using the virtual signal or the item?
Since the recipe is named differently, the mod can't tell that the recipe and the item are related and thus it generates a virtual signal for it and will only react to that signal - I think that's where the problem lies.

Indeed changing the recipe name to be the same as the resulting item name will solve this, but I think I can see the reasoning behind naming this one differently - It's a base game item that is a subject of many other mods so name clashes would occur if multiple mods added a recipe making alien artifacts. Besides, the intention of Crafted Artifacts is clearly to remove the alien aspect from the game, so why use a name that doesn't really go along with the theme ;)

Cheers TRK
gridstop
Inserter
Inserter
Posts: 47
Joined: Sun Jul 17, 2016 1:46 am
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by gridstop »

That makes sense from the name standpoint. I found the virtual signal and it does indeed set the recipe just fine.

The one catch for recipes like this is that the purple packs when fed into the recipe combinator give you the alien-artifact item, not the recipe (which makes sense if you're using it for requester). So you can't chain down. I will have to do a little trick to detect the item and produce the recipe instead. This would be a similar situation for solid fuel where there's 3 recipes, and feeding 'solid fuel' into a crafting combinator does nothing.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

gridstop wrote: The one catch for recipes like this is that the purple packs when fed into the recipe combinator give you the alien-artifact item, not the recipe (which makes sense if you're using it for requester). So you can't chain down. I will have to do a little trick to detect the item and produce the recipe instead. This would be a similar situation for solid fuel where there's 3 recipes, and feeding 'solid fuel' into a crafting combinator does nothing.
Hmm, i didn't think of that...
Maybe I could add some way to find all recipes that produce a given item. In most cases this would just be one recipe so you could chain down quite easily.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

Version 0.6.0 released.
Changes:
+ Settings are saved in blueprints
+ Modules that have been removed due to recipe change can now be requested back into the assembler
* The multiplier for time in recipe combinator can now be changed to any number
* Refresh rate is now configurable from in-game, individually for crafting and recipe combinators
TheCardinal
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue May 27, 2014 6:35 am
Contact:

[MOD 0.14] Crafting Combinator - How do i use it?

Post by TheCardinal »

Could you please explain how to use this mod, step by step? I don't seem to understand how to set the assembler to create something.
I've placed the blue (the green as well) next to an assembler, connected it with a red wire to the system, connected a fixed combinater to signal an object (f.i a power pylon). Nothing happens, so i probably am doing something wrong. What should i do to set/change the object which will be created with an assembler?

Cheers,

The Cardinal
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator - How do i use it?

Post by theRustyKnife »

TheCardinal wrote:Could you please explain how to use this mod, step by step? I don't seem to understand how to set the assembler to create something.
I've placed the blue (the green as well) next to an assembler, connected it with a red wire to the system, connected a fixed combinater to signal an object (f.i a power pylon). Nothing happens, so i probably am doing something wrong. What should i do to set/change the object which will be created with an assembler?

Cheers,

The Cardinal
I'm planning to make some better 'how-to', but here's at least something:

To use the crafting combinator (the blue one):
1) Place it next to an assembler, make sure it's rotated correctly too - only the side with the connection points will detect assemblers
2) If you want to change the settings, you can open the menu by clicking on the combinator, the defaults should do the job for simply setting the recipe tho
3) Connect it to a signal source (a constant combinator for testing)
4) Send in a signal that represents a recipe. For example, a medium electric pole should work just fine.
5) Wait for the combinator to update the recipe of the assembler

To use the recipe combinator (the green one):
1) Place it anywhere in the world
2) Change the settings by clicking on it if you want - again, for getting the ingredients, the defaults should do
3) Connect your input on one wire (red) and your output on the other wire (green) - This prevents input signals from mixing into the output signals
4) Send in a recipe signal (same as in crafting combinator)
5) Wait for the combinator to update it's output

The mod recognizes the following signals as recipes:
1) Items that have the same name as the recipe that produces them (transport belt, for example)
2) The virtual signals from the newly added 'Crafting combinator recipes' tab - these are generated by the mod for recipes that don't have a resulting item matching their name

Note that 'name' refers to the prototype name of the recipe which may be different from the name that is displayed in-game. This shouldn't matter most of the time tho.

Hope that answered your question, if you want to know anything else, ask away, I'd be glad to answer ;)

Cheers TRK
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

Version 0.6.1 released.
Changes:
* Fixed recipes not being enabled again ([4438](https://mods.factorio.com/mods/theRusty ... ssion/4438))
TheCardinal
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue May 27, 2014 6:35 am
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by TheCardinal »

Thank you for the quick and very helpful reply. It's working! Yippee!
I didn't know the connectionterminals should face the asembler. Once I did that it worked like a jiffy. Frankly, i consider this mod a 'must-have' addition to Factorio. It allows for much more flexibility and automation, especially as i'm using assembler complexes to produce items which are in short supply.
Cheers!
gridstop
Inserter
Inserter
Posts: 47
Joined: Sun Jul 17, 2016 1:46 am
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by gridstop »

theRustyKnife wrote:Version 0.6.0 released.
Changes:
+ Settings are saved in blueprints
+ Modules that have been removed due to recipe change can now be requested back into the assembler
* The multiplier for time in recipe combinator can now be changed to any number
* Refresh rate is now configurable from in-game, individually for crafting and recipe combinators
Hot dog! I kept meaning to post a comment about the blueprint issue, but I would always forget. I can't wait to try the tick rate updates. Will that be compatible with existing saves?

So I had some other thoughts about the recipe combinator. There may be a point here where this implements TOO much, so stop me if I go overboard...
1) How about an option to do the quantity/product count automatically. So if you feed in 10 yellow belt it outputs 5 iron plate and 5 gear wheels (since yellow belt recipe produces 2x). You'd have to do the ((desired quanitity + (products per craft - 1)) / products per craft) trick to round up for requests that aren't exact multiples of the produced amount. Thus 11 yellow belt would produce 6 plate 6 gear wheels.

Now you might say why not just have people do this in combinators (and you certainly can and I do right now) but it enables step 2 which is:

2) Consider adding an option to have the recipe combinator process all input signals simultaneously, instead of just picking the first one. So if I feed in yellow inserters and pipe to ground, I get 1 circuit, 1 gear wheel, 6 plate, 10 pipe. The magic is at this point I can chain together recipe combinators up to the max 'depth' of any product chain, with buffers in between so they don't backfeed, to figure out absolutely everything I need to build and sum it all together in one step. It would also compute total raw at the same time.

Not that people shouldn't try to build fantastical stack computers if they want to, but when I look at the thing I built it's obvious most people won't be up for it. This would enable a vastly simplified system where you can just dump a thing and every last subcomponent into a single storage register in one step, and then you just prioritize subcomponents in order (always build wires first until there are no more wires in the register, then green circuits, then.... and so on)
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by theRustyKnife »

gridstop wrote:I can't wait to try the tick rate updates. Will that be compatible with existing saves?
I have done some brief testing for compatibilty back to 0.4 and it seemed to work fine.
gridstop wrote: 1) How about an option to do the quantity/product count automatically. So if you feed in 10 yellow belt it outputs 5 iron plate and 5 gear wheels (since yellow belt recipe produces 2x). You'd have to do the ((desired quanitity + (products per craft - 1)) / products per craft) trick to round up for requests that aren't exact multiples of the produced amount. Thus 11 yellow belt would produce 6 plate 6 gear wheels.
This is actually something I have already been considering. It does sound like a logical addition so I think I'll put it on my todo.
gridstop wrote: 2) Consider adding an option to have the recipe combinator process all input signals simultaneously, instead of just picking the first one. So if I feed in yellow inserters and pipe to ground, I get 1 circuit, 1 gear wheel, 6 plate, 10 pipe. The magic is at this point I can chain together recipe combinators up to the max 'depth' of any product chain, with buffers in between so they don't backfeed, to figure out absolutely everything I need to build and sum it all together in one step. It would also compute total raw at the same time.

Not that people shouldn't try to build fantastical stack computers if they want to, but when I look at the thing I built it's obvious most people won't be up for it. This would enable a vastly simplified system where you can just dump a thing and every last subcomponent into a single storage register in one step, and then you just prioritize subcomponents in order (always build wires first until there are no more wires in the register, then green circuits, then.... and so on)
This is an interesting point of view - I always considered things from a perspective of someone with fairly deep knowledge of circuit networks, so I never thought this might be an issue.
It does make sense in this context, but there might be some issues with implementing it - the recipe combinator only has a limited number of output signal slots, which could cause problems if you feed too many inputs into it. I may be able to set that dynamically as needed, in theory you should only need as many slots as there are items in the game (I think).
I'll do some testing and see if it's a viable idea. I also remember having performace issues with combinators with insane slot counts so I'll need to check that too...

Thanks for all the feedback, I really apreciate it.
Cheers TRK

EDIT: Also wanted to mention that reading the crafting speed will have to wait for 0.15, but I'm planning to add that into the first release after that ;)
gridstop
Inserter
Inserter
Posts: 47
Joined: Sun Jul 17, 2016 1:46 am
Contact:

Re: [MOD 0.14] Crafting Combinator

Post by gridstop »

Well the absolute maximum would be the list of each item that's actually used as a component of something else right? There's lots of things on the combat, logistics, and production tabs that aren't. Not sure how you'd recalculate that every time a new mod was added/changed. Bottleneck does something every time it senses a mod change, so there must be some way.

If you had a practical requirement of one item at a time at the 'top' level, you would probably be safe with max number of components in a given item squared or cubed, since unless they were almost on purpose trying to make a tree that kept expanding, the recipes would start to converge onto the same subcomponent & raw material lists.


There's also some danger with mods that add recycling recipes and the like, since if there was something that say, turned copper plate back into copper ore, you'd get stuck in an endless loop if they named the recipe 'copper ore'. But a person could add filtering after each stage (zero out plates and ores so they stop getting looped back into the recipe combinator, since they're not assembly machine products normally).
Post Reply

Return to “Mods”