Calculating production

Post all other topics which do not belong to any other category.
Post Reply
SAF
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Mar 05, 2014 8:01 am
Contact:

Calculating production

Post by SAF »

Hi,

Is there a mathematical formula for calculating the optimal number of factories required on a production chain?
For example, producing iron gear wheel:
electric drill has mining power 3, mining speed 0.5 (does this mean 1.5 ores/second?)
electric furnace has smelting speed 1
assembling machine 2 has crafting speed 0.75
and you need 2 plates for a wheel

least integer multiple of assembling machine 2 would be 4x0.75=3
So 3/0.75=4 assembling machine 2 -> 3x2(number of plates)/1(smelting speed)=6 electric furnaces, 6/1.5(ores/second)=4 electric drills.

But that seems wrong, somehow. And it doesn't take into account the crafting time of 0.5 for the iron gear wheel and 100 for the iron plate.

Anyone can shed some light?

Thanks.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Calculating production

Post by ssilk »

No formulas, because on one side they are big integrals, or must be computed by computer, because of different timings of the parts or nasty logistic problems. And with modules everything changes. The afford to write down the formula for every case is the same as just watching how it behaves, and then changing it.

On the other hand it is in most times just easier/more interesting to find the bottleneck, and for the next time you build it you take that as rule of thumb.

Rule of thumbs work much better in factorio than any other game I know. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

xng
Fast Inserter
Fast Inserter
Posts: 165
Joined: Fri Feb 14, 2014 1:04 pm
Contact:

Re: Calculating production

Post by xng »

Even though the exact science is very dependent on circumstance, a mathematical approach can give a good guidance to how much is needed for optimal performance in perfect scenarios.

I myself think it is more fun to not have a template of how I must build to be most efficient, and I like to find that out for myself instead.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Calculating production

Post by ssilk »

I once have calculated it for blue potion. I build exact to my calculations. The result was horrible, because in practice there are the above called effects; especially the logistics, how you transport the stuff from one assembly to the other is not calculable.

Then you have effects like "Every X turn I have one copper wire left at this assembly, which I can use for anything else". It makes sense to use that.

Then the effects, that you have enough iron, but not enough copper and then this behaves suddenly differently, because - even if the buffers between the assemblies are very small - there are buffers and they insert some sort of chaos into the calculations.

And many more effects.

In my opinion there are the
1. logistic bots, which give you suddenly some calculable things, because - when not at the limits - they remove the chaos from the formulas. But you need to calc in total input and total output. The production info (P) is then a good help.
2. There are layouts, which tend to more or less chaotic behavior. There are no rules, which can describe that.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

SAF
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Mar 05, 2014 8:01 am
Contact:

Re: Calculating production

Post by SAF »

Ok, ok, I give up. I'll just play the game :)

User avatar
Zourin
Fast Inserter
Fast Inserter
Posts: 246
Joined: Tue Feb 11, 2014 2:15 am
Contact:

Re: Calculating production

Post by Zourin »

It's really not too hard when you think about it..

A Red pack, for instance, needs 1 copper bar and 1 Gear (2 iron plates) every five seconds at 1.0 speed

Given that a copper bar and an iron plate produces once every ten seconds, you need two copper smelters and four iron smelters running at capacity to meet the material needs of the end product.

However, being that a gear factory produces a gear every 0.5 seconds (Scaled for assembler speeds), you can support a much larger number of gear consuming factories at once. Running a single assembler 2 gear factory at capacity needs ~15 smelters to run at capacity (10 for an assembler 1, and 25 for an assembler 3)

So, that's just one gear factory. Circuit factories, for example, need 1.5 copper and 1 iron every second.. that's ten iron and fifteen copper smelters running constantly to meet demand at a basic level (five and 8 for assembler 1's, 8 and 13 for assembler 2's, 13 and 19 for an L3)

ultimately, where things level out, is that you have some reasonable limit to how much you produce, so that these factories are not all running simultaneously, which will create a material starvation scenario unless you have 50+ smelters and miners running simultaneously for even a core selection of factories.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Calculating production

Post by ssilk »

Yeah. Very nice explained. Because that produces chaotic effects. And I mean chaotic in the sense of mathematics.

Some simple example are the green potion production. Once I built up two identical lines of green potion production.
With circuit network I guarantee, that the production starts for the both lines exactly at the same time.
But for one line there was copper plates the first item, that arrives, and for the other it was iron plates.

The output of both lines wasn't identical, just because of this little piece! Well in the long term there was no difference, but the first bottles come out with some difference.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
Zourin
Fast Inserter
Fast Inserter
Posts: 246
Joined: Tue Feb 11, 2014 2:15 am
Contact:

Re: Calculating production

Post by Zourin »

There are also inconsistencies with some of the listed numbers.

Generally, you want miners and furnaces in a 1:1 ratio (or 1:2 if using stone furnaces), with maybe one extra to ensure load. That will keep them going at a fairliy brisk pace.

The '100' for smelting iron is a misnomer, it's actually much shorter in practice.. although I'd have to manually time it.

ray4ever
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Sun Jan 12, 2014 9:22 am
Contact:

Re: Calculating production

Post by ray4ever »

Zourin wrote: The '100' for smelting iron is a misnomer, it's actually much shorter in practice.. although I'd have to manually time it.
As far as i know the values are only a factor 100 too high. That means that on iron plate needs 1 s to produce.

Sir Nick
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Mon Feb 10, 2014 9:16 pm
Contact:

Re: Calculating production

Post by Sir Nick »

For electric furnaces without modules the ratio is closer to 6 mines per 5 furnaces. As a steel furnace has the same base speed, I'd assume the ratio stands for it too.

I have tried building a factory scaled to produce "everything on the run", so that each part of it receives exactly the needed amount of recourses. I'd have to abmit that I failed miserably :D (that war 0.8.8). SP1 and 2 were fine and working. However, SP3 had too many components with entirely mismatched production speeds. But the main problem of such a factory is that it is EXTREMELY sensitive to any fluctuations. If at any time your raw resources run dry, it rapidly consumes all that are left and then grinds to a spectacular halt.
A much better approach, as I began to understand, is a "construct on demand"-type factory. Its main feature is that most of the time most of the factory is idle, with the most notable exception being smelters (should look into it as well, I suppose). It is best constructed with LogNet, although you can manage with belts (howeverm be prepared for EXTREME convolutedness and tangles). Basically, you wire everything to be constructed up to a certain amount, then let it reach that amount before adding something else using the same set of resourses. The main drawback of this one is that if for any reason you have to produce many different things at the same time (think all 3 modules at a time AND sudden power issues), you run into production capacity problems.

Post Reply

Return to “General discussion”