Advice Wanted: Improving My Robot Mall's Production Logic

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
kuguma
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Nov 22, 2024 1:56 am
Contact:

Advice Wanted: Improving My Robot Mall's Production Logic

Post by kuguma »

Hello! I’m playing Factorio again for the first time in 8 years.
(The last save I played was on version 0.12.33...)

I’m amazed by how much has improved, and I’m really enjoying Space Age.

Now, I’m posting here to seek advice from everyone about a Robot Mall I’ve been working on recently.

I’ve built a mall like the one shown below, but it doesn’t work well under certain conditions.
Do you have any good ideas on how to fix this?

Image

------------------------------------------------------------
0eNrlWk+P67YR/yqELkkKebGS/+x6gVcgKJqHAG1RbNPT24VAS7RNrEQqJLWO8bBA00WA9NB7DznkUPSWQ75SHlA036IzpP7Zlndt7XtvX9obLVFDcmZ+M78Z+rU3SwuWKy6Md/Ha47EU2rt49drTfCFois8EzZh34Sk5k7lUxrvzPS4S9pV3Edz5HRMTFvOEqUEssxkX1EjV+iS8u/Y9Jgw3nLmF7I91JIpsxhTI9HcW9L1cavhAClwFhIwnvreGqadnIFixLwumTTTnqWFK4xTNYpzt5Fd79b16xsbTcrVULrg2PB7gsrjmlwVNYWPwSkiVwQl9D06UU2VPdOG9sA8K1Fs4RkVUJ6xFoi6NKuxe+ogdo64WShY5PP/5m7///Jev39z/8Ob+uzf392/uv/3Pv77+949/9e6u73D1LTVu7YIK07bHrkbHJ+NSp9MTOA1+ZZRMoxlb0luOO2urtaeK6exIBZx26pUr0OeCUTVYLRlLnyBzWMtkKRwI5IIDxFzFBTdPEDtqKT/PEQp0lrInCBzXAo2iQiMqBjOWHr/Ha+stXp7SNVNRwnSseO78wPutANORXMnEuSwpkaWvxKdkViyIjONCaQJKF2QtC8LsBxTmxTxnxCypITEVQhoyY0QzQ7iAp4zEis4NFwuS0XjJBTvxOjy2scWMLwbOHmCNXFrNbfvrtPTW8y7nb/RPFTfLjCGuH3T/6YbzJ1w597aiuqDQyI3gdcJrXMy5gljUxES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aGADq/yH6+E8xIBqQhPFPc+7y5GMDdvkE3oGTaGvi8SScjqbT8ehsGJ4OgcP8F3tzKws=
------------------------------------------------------------

This mall is designed to automatically resolve item dependencies and produce items accordingly.
The mechanism is simple:

First, it randomly selects one item from a list of missing items.
Then, it tries to produce the selected item. If there aren’t enough materials in stock, the production is canceled, and a new item is selected at random.
This system works fine in normal cases, but it runs into problems when item stocks are low or when trying to produce items that require large amounts of materials (e.g., rail signals).

To check stock availability, the system refers to the logistics network’s inventory count.
Here’s where the issue arises: when a producible item is found and the request chest is set, robots start transporting the materials, reducing the logistics network’s inventory count.
Because of this decrease, the system concludes there aren’t enough materials, and the assembler cancels production.
As a result, when the stock is insufficient, the mall repeatedly cycles through selecting and canceling items at high speed.

How would you handle this situation? I’d appreciate your advice!
Attachments
cd31000c087a96431de88d8507216e35.mp4
(18.29 MiB) Downloaded 14 times
BaggyK
Inserter
Inserter
Posts: 43
Joined: Fri Mar 01, 2019 12:22 pm
Contact:

Re: Advice Wanted: Improving My Robot Mall's Production Logic

Post by BaggyK »

A couple of general suggestions.

Rather than immediately canceling the craft if the required ingredients drop below the required level, have a delay before canceling. The length of the delay will probably need some experimentation.

Or have two different checks for ingredient levels, an initial check that multiplies the number of items by say 5 before allowing the request for the initial number of items, and then monitor the levels for the actual level in case something else is using them.
Tertius
Smart Inserter
Smart Inserter
Posts: 1167
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Advice Wanted: Improving My Robot Mall's Production Logic

Post by Tertius »

With a mall that simple you're unable to handle recipes that require complex ingredients you usually create in such a mall as well. The best example is robots. They require a flying robot frame, which require an electric engine unit, which require an engine unit, which require pipes.
If you remove the parent recipe from your assembler, there is no trace in the system which complex dependent ingredients are required, so your mall is just able to create items with simple ingredients you provide from elsewhere. If this isn't fine for you and you intend to implement crafting dependent items as well, I suggest you don't seek to fix the current behavior but instead design a fresh approach that includes dependent items.
kuguma
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Nov 22, 2024 1:56 am
Contact:

Re: Advice Wanted: Improving My Robot Mall's Production Logic

Post by kuguma »

I think checking the inventory in a different way is a great idea. I’ll give it a try right away. Thank you for the advice!

As for recipes that involve liquids, I’m also struggling with those.
If the items can be made using assemblers, it might be possible to handle them by pre-placing pipes, but I haven’t tried that yet. (Since liquids would go to waste every time the recipe changes, some clever use of pumps might be necessary.)
The same applies to items that require chemical plants.

For other materials, even those with dependencies, this mall should be able to produce them on its own. (For example, modules.)
Tertius
Smart Inserter
Smart Inserter
Posts: 1167
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Advice Wanted: Improving My Robot Mall's Production Logic

Post by Tertius »

About fluids: they don't go away if you change the recipe. They're pushed back into the pipe. And for an automated mall, in case you intend to support recipes with different fluids such as blue belts (lubricant) and concrete (water), you need to flush (pump back) the previous fluid. Only if the previous fluid is flushed completely, a different fluid will be allowed to enter the pipe.

Prepositioning pipes works, by the way. If the rotation is correct, they connect to the assembling machine if a recipe is set that requires fluid.

In case you're looking for examples, there are some dynamic mall examples in the "Show your creations" part of the forum: viewforum.php?f=193
Post Reply

Return to “Gameplay Help”