Page 1 of 1

Please Make Science Packs Less Abstract

Posted: Fri May 10, 2024 8:55 pm
by DrakeyC
This is not a huge issue in end-game megabases, but when playing scenarios or advancing through the tech tree, it becomes quite bothersome to notice the way labs handle science packs is very inefficient, which is annoying to micromanage; or its just that they can appear that way while functioning perfectly, which is also annoying and misleading. Let me try to explain what I mean with examples and observations.

Let's say you have 10 labs all with 10 of each science pack in them. You begin researching a tech that requires 75 science. Eventually the labs will come to a point where they've all used up 7 packs, a total of 70. How do we hit the remaining 5? In my observations, what'll happen is that the labs all begin researching at once, but eventually they'll stop when the progress bar hits 100%, probably around the time they're halfway done this current round of science.

As best I can tell, the progress bar for research is filled by depleting science packs like fuel until it hits 100%, but the individual labs are just a means to provide fuel for that gauge, their own progress bars do not necessarily mean anything. I make this analogy because I've observed research complete when I have a single operational lab that is not yet done its progress nor are the science packs in it depleted. So if the lab reaching 100% is not what ticks up the progress bar, and a science pack being depleted is not what ticks up the progress bar, then the progress bar is being influenced by something that cannot be directly observed.

Back to the 10 labs, now we have 10 labs all with science packs that are 50% depleted. If we pick up those science packs, they "combine" like ammo magazines, so we have 5 full science packs now instead of 10 half-full ones. That would make splitting them up again considerably harder. But, does it matter? Because if the research progress bar is just a fuel gauge and labs are funnels, will the progress bar fill the same if I left those half-full science packs in the labs versus powering only half of them with full packs now? If so, then what is the purpose of the progress bar for the lab? If I build a web of labs where inserters move science packs between them, I notice the labs momentarily begin working when science packs are put in them and before they're removed. Does this mean that by the time the science pack ends up at the end of the line, that final lab receives a science pack that is not quite full while all the labs before it ticked up a tiny bit? If yes, then how do productivity modules fit into this? Will the final lab be unable to complete a research cycle entirely and thus productivity modules in it may not fill the productivity bar?

I leave these questions unanswered because I don't know. When I try to micromanage my labs due to having few science packs, I inevitably notice that over the course of a playthrough that my labs all end up containing science packs in differing stages of depletion, and I don't understand why or how, and if it affects the efficiency of my research or not. Here's a combined screencap of the science packs in three different labs on my current playthrough.

Image

And an anecdote on how this confusion and/or inefficiency can affect gameplay. On another scenario, I had a limited number of blue science packs, so I put them towards laser turrets and calculated that I had just enough to finish the research. I did not - the research progress bar ended up at 99%, the lab's progress bar was at 99%, and I was out of blue science packs. Somewhere along the chain, a tiny tick of progress was lost and I was left without laser turrets before the scenario progressed.

Again, I don't know for sure how science works, I'm not a programmer or coder and haven't looked at the technical aspects of how Factorio handles research. What I do know is what I've observed with my own eyes - I have only one lab actively researching, and research completes when the lab is not yet done its progress cycle and none of the the science packs in it are depleted. As I said before, it seems like labs are funnels used to pour science pack fuel into the progress bar, and the amount left in each science pack or the progress of each individual lab is irrelevant against filling the progress bar. If that is the case, then the true method of researching new technologies, and the impact of limited-duration science packs, labs, and productivity modules, on that process should be made clearer to the player so we can better optimize and micromanage our labs.

Re: Please Make Science Packs Less Abstract

Posted: Sat May 11, 2024 12:01 am
by nethus
DrakeyC wrote:
Fri May 10, 2024 8:55 pm
And an anecdote on how this confusion and/or inefficiency can affect gameplay. On another scenario, I had a limited number of blue science packs, so I put them towards laser turrets and calculated that I had just enough to finish the research. I did not - the research progress bar ended up at 99%, the lab's progress bar was at 99%, and I was out of blue science packs. Somewhere along the chain, a tiny tick of progress was lost and I was left without laser turrets before the scenario progressed.
I've seen that happening as well, and I guess it has to do with rounding errors and the limits of floating point precision (wikipedia). The best way to mitigate is probably to avoid having science packs being transferred from one lab to another.

Re: Please Make Science Packs Less Abstract

Posted: Sat May 11, 2024 10:29 pm
by Hedning1390
For science the progress bar and the productivity bonus progress bars are lies. The only ones in the game. It was probably made that way because even one of each flask has pretty major value and you wouldn't want to lose that the same way you lose resources when mining buildings of any other type (including the rocket silo :shock: ).

So each flask instead instantly supply its research in tiny fractions as long as it is in a working lab, so you can never lose any science.

Re: Please Make Science Packs Less Abstract

Posted: Sat May 11, 2024 11:14 pm
by Ranakastrasz
This is a legacy mechanic. Way back in the ancient past, science was very much all or nothing. If you put a science pack into a lab, it would run a consumption recipe, and when it finished, consume 1 of each science pack, and add 1 to the research process. However, this caused a few issues. For one thing, no overkill protection. If you needed 10 research actions, but had 12 labs, it would consume 12 science pack sets, wasting the extra 2.
Also, productivity and speed differences caused the same issue even if you had perfect math, as would any shortfall.

So they gave science packs heath bars and had them consume at a constant rate, so as to ensure nothing is wasted, and remove the need for exact numbers of labs and make productivity play nice.

That said, there are some slight floating point errors that occasionally rob you of an infinitesimal amount of science. And the progress bars were just never removed, even if they do very little. (They do tell you how fast the lab is eating the science packs, which can vary after all)

Re: Please Make Science Packs Less Abstract

Posted: Mon May 13, 2024 2:35 am
by DrakeyC
Huh, I actually did not know that it was a legacy mechanic, good to know. So productivity modules in labs, do they actually do anything?

Re: Please Make Science Packs Less Abstract

Posted: Mon May 13, 2024 5:28 am
by SoShootMe
DrakeyC wrote:
Mon May 13, 2024 2:35 am
So productivity modules in labs, do they actually do anything?
Putting aside the floating point inaccuracy mentioned, their effect is the same as in eg an assembling machine: increased power consumption, increased pollution rate (but the base pollution of labs is zero so this has no effect), reduced speed, and bonus output. The difference is that the bonus output works as additional (fractional) output each tick rather than an extra set of "results" when the productivity bar reaches the max.

Re: Please Make Science Packs Less Abstract

Posted: Thu May 23, 2024 4:29 pm
by Illiander42
They also put some effort into making sure that you don't lose that infinitesimal tick of science progresson on the early sciences.

Because people were getting really annoyed that you needed 11 packs to do 10-cost techs.

Re: Please Make Science Packs Less Abstract

Posted: Sat Jun 01, 2024 1:47 am
by Ranakastrasz
Illiander42 wrote:
Thu May 23, 2024 4:29 pm
They also put some effort into making sure that you don't lose that infinitesimal tick of science progresson on the early sciences.

Because people were getting really annoyed that you needed 11 packs to do 10-cost techs.
Wait, is that why my tests to try and figure out what caused the infintessimal loss to occur failed? Because it functions differently early on?

Re: Please Make Science Packs Less Abstract

Posted: Sat Jun 01, 2024 12:19 pm
by Illiander42
Ranakastrasz wrote:
Sat Jun 01, 2024 1:47 am
Illiander42 wrote:
Thu May 23, 2024 4:29 pm
They also put some effort into making sure that you don't lose that infinitesimal tick of science progresson on the early sciences.

Because people were getting really annoyed that you needed 11 packs to do 10-cost techs.
Wait, is that why my tests to try and figure out what caused the infintessimal loss to occur failed? Because it functions differently early on?
Possibly. Might also function differently with the cheaper techs.

I honestly can't remember what they said about how they fixed it.

Does someone have a link to their explination?

Re: Please Make Science Packs Less Abstract

Posted: Sat Jun 01, 2024 3:31 pm
by Koub
Illiander42 wrote:
Sat Jun 01, 2024 12:19 pm
[...]
Does someone have a link to their explination?
viewtopic.php?t=20691
That's most probably what you're looking for, but there's not much detail unfortunately.

Re: Please Make Science Packs Less Abstract

Posted: Sat Jun 01, 2024 8:05 pm
by Illiander42
Koub wrote:
Sat Jun 01, 2024 3:31 pm
Illiander42 wrote:
Sat Jun 01, 2024 12:19 pm
[...]
Does someone have a link to their explination?
viewtopic.php?t=20691
That's most probably what you're looking for, but there's not much detail unfortunately.
I'm sure there was another round (heh) of errors and bug-fixing on this, because I didn't get factorio until 0.16, I think.

Re: Please Make Science Packs Less Abstract

Posted: Mon Jun 17, 2024 1:11 pm
by kajacx
I've heard that you lose very tiny amount of progress when not at full power. I guess that makes sence, as long as the labs consume, say, 56% of the science for 56% percent of the result, when at 56% power. The rounding errors could give or take tiny amounts of science progress.

One way to fix this would have to have the labs just buffer those 56% of power while doing nothing, and on the next tick, when they go to 112% power, they do a full tick worth of research and keep 12% power for later. That way, you may lose some electricity due to rounding errors, but never research packs.

Re: Please Make Science Packs Less Abstract

Posted: Mon Jun 17, 2024 4:35 pm
by Silari
Power works the way it does as an optimization. Entities never have to check the power network to perform their task, they work solely off their energy buffer. If it's full enough to cover the entire power cost, they work at 100% speed, their buffer is reduced, and then later on the power network gets calculated and buffers are refilled then. Changing that means lower UPS, which really isn't a good tradeoff to save 0.001% of a pack.