r/CreateMod • • 2d ago

Discussion Microservices-based factory

Hi all!

I attempted to build a universal factory based on a microservices architecture. Each operation involving items constitutes an isolated place, which is linked to others via a system of "frog-based" logistics. Factory gauges define the sequence of operations, while chain transport the results of each microservice.

Overall, the concept is quite workable, but there is one annoying nuance. Since the factory is universal, it should be capable of producing any item, provided the chain is set up correctly. However, the mechanisms within each microservice do not know what specific item they are currently producing; they simply perform their own primitive tasks.

I’ve also run into an issue with getting the results out of the mechanism. Since the item varies each time, I can’t set up filters on the chutes or funnels. A chute can extract both output and input ingredients from a mechanism. In other words, ingredients arrive in a microservice's input buffer and are placed onto a depot, saw, basin or similar component; the output chute then simply picks up those incoming ingredients.

Is there any way to set filters dynamically ? Or perhaps a way to prevent the retrieval of incoming ingredients ? Or perhaps there are other ways to carry out my idea that just haven’t occurred to me?

2 Upvotes

13 comments sorted by

2

u/MrPerson2121 2d ago

the only thing i can think of to "set the filters dinamically" is to move different brass depots with a sticky mechanical piston and sequenced gearshifts, no idea what you mean by "retrieval of incoming ingredients" means and like 40 other words in this post, you really dont need to use complicated words, youre trying to get an answer not write an essay or something

1

u/gonzo_gonzales 2d ago

I use a translation; English is not my native language. I don’t even know which words are complex and which aren't - I just check the back-translation to make sure the meaning is preserved ☺️

Regarding the filters - what I meant was that funnels and chutes pull both input ingredients and crafting outputs out of the mechanisms. And I don’t know how to influence this behavior.

1

u/MrPerson2121 2d ago

maybe try to use smart chutes or mechanical fans pushing air to the bottom of the shutes and use funnels to take stuff out of the chutes

1

u/Chaosfox_Firemaker 2d ago

Im a little bit fuzzy on your goal, let me see if ive got it right. You have a bunch of tiny factories, all hooked togeather with chain conveyers and packaging. What I'm confused by is why you would need any filtering.

Each "microservice" orders its needs via gauge, and then pushes anything it makes to a conveyer accesable buffer. If another microservice needs it, it can just order it via gague.

I suppose im a bit fuzzy what you mean when you say "extract from the mechanism", as "mechanism" could be refering to a few different things here and its getting a bit garbled in translation.

1

u/gonzo_gonzales 2d ago

In this context, a "mechanism" is a specific element the size of a single block - for example, a depot. A mechanism is a component of a microservice. My issue lies within the microservices themselves, not in the communication between them. 

Most often, I insert items into the mechanism - and remove them from it - using funnels or chutes. At the same time, both incoming and outgoing items are being removed from the mechanism. I cannot place filters on the chutes because the items are not static - they change depending on which recipe I happen to be processing at the moment.

In other words, I’ve come up with an interesting challenge for myself, and now I’m heroically trying to solve it using limited functionality :)

1

u/Chaosfox_Firemaker 2d ago

So you've forbidden yourself belts? Otherwise youd be able to leverage the fact that belts hold an item till a machine(press, deployer, spout, etc) is done with it then lets it move on.

Basins also auto output.

I suppose im just not sure how "micro" your meaning your microservices to be

1

u/gonzo_gonzales 2d ago

 I was thinking about refactoring some of the microservices to use conveyors. It’s certainly not as convenient as direct loading and unloading into a block, and the overall dimensions will increase as well. 

But for some operations, this seems impossible. For example, lava blasting. As far as I know, different recipes may require spending different amounts of time in front of the lava. Furthermore, in some recipes, the resulting products might undergo further processing if you stay in front of the lava for longer than necessary.

1

u/Chaosfox_Firemaker 2d ago

With the blasting, the trick is to just use attribut filters. Resmeltables are solved by just having two smelters, one of which permits first smelts, the second of which forbids them. Cobble>stone>smooth stone is actually the only base create/vanilla example

1

u/gonzo_gonzales 2d ago

Could you elaborate a bit on the "two smelters" ? I’m familiar with attribute filters, but I don’t quite see how they can be used to implement a universal smelter. Should I send items to different smelters depending on the specific recipe? Or should I just forget about smooth stone and set up an attribute filter instead? Then there’s also clay-terracotta-glazed terracotta...

2

u/912ehd 2d ago

Im doing this in my creative world right now. There are two options as far as ive figured out.

  1. Instead of each microservice giving results directly to other microservices, it should send it to a central warehouse and the next microservice in the chain should request that item from the central warehouse and not the other microservice.
  • pros: centralized item management, easy extendability
  • cons: inefficient item transfer through each microservice
  1. Or each microservice should own its own seperate warehouse and store its output there, and any other microservices that need that exact item should request from that warehouse specifically.
  • pros: efficient item transfer through each microservice
  • cons: logistics network might be hard to set up, decentralized item management.
  1. Extra tips
  • Use trains for inter micro-service transportation. Since chunks arent loaded between each production site(only the production chunk itself), item routing and transfer must happen through unloaded chunks. Trains, bee ports work through unloaded chunks, but chains, belts and frog ports do not.
  • Check your electricity mod if it transfers power between unloaded chunks. Electro energistics, power grid do. Crafts and additions do not.

2

u/912ehd 2d ago

Extra tip 3. Use attribute filters on saws, basins, if there are multiple outputs for one type of input. For example a log through a saw produces stripped logs or bark. Set it to an attribute of stripped log if you want just that

1

u/Calaquare 1d ago

I built a pretty big system using the centralized design before. It works well enough most of the time (as long as you're not trying too many concurrent operations. It is a very big mess if the chain overloads)

1

u/Real_Individual8075 2d ago

There are Filter Link from addon Factory Controller to set filter dynamically according to gauge target, but it currently cannot handle filters which produce by-products (such as some washing recipes)