capnflummox wrote: Tue Jan 14, 2025 6:18 pm
You can see in the various modding descriptions - like the link you posted - that the information is there. It has a name! You can see the value in the game! But why can't I change it? Where does it get this information from? Why 5? Why 10? Why this complicated bs: "The number of science packs needed for one research unit in addition to the science packs for the number of research units that can be completed during one full inserter swing; but at least the ingredients for 2 research units and at most the ingredients for 100 research units. "??? Why?
The game has complicated logic for this because it has several different design goals that are in conflict:
1. Production buildings should be able to run continuously with no downtime as long as your setup is able to load ingredients fast enough and remove products fast enough, and this should work even for extreme scenarios that can't occur in the vanilla game (e.g. if mods introduce recipes with very low crafting times, machines with very high crafting speeds, more powerful modules/beacons, etc). This includes scenarios where an entire stack of each ingredient may not be enough - it is possible to have recipes that require more than one stack of an ingredient, or for one stack to be consumed so quickly that buffering more is required for continuous operation.
2. Inserters have very simple logic to decide what to pick up to put into a production building: if the building needs more of ingredient A, and there is some of ingredient A available to pick up, then it just goes ahead and does it. The inserters don't have any logic to do something like "pick up whichever ingredient is currently needed most" or "rotate through each ingredient" - they will just keep picking up whatever happens to show up unless the building contains enough of that thing. This also means that inserters always need to be allowed to deposit a maximum-size "handful" into the building even if that would exceed the target amount and even if that would exceed a full stack, because otherwise they could get stuck holding an ingredient that is already full and never be able to pick up a different ingredient to allow the building to start working.
3. Machines shouldn't buffer unnecessarily large amounts of ingredients as this can starve other machines of resources. If the limit was always very large (e.g. a whole stack), then it could take a long time for a newly built production line to "get up to speed": all the resources would go to the first machine until it had an entire stack, then the next, then the next, and you'd only be producing the output at the designed speed once the very last one was reached. It sounds like you have a different idea of what "unnecessarily large" would be than the developers (or most players), but presumably you don't want your inserters to put fifty thousand science packs into a single lab.
Taken together, this means there has to be some limit on how many ingredients are allowed to be loaded by an inserter, and that limit can't really be any one fixed number: anything you picked might be too low for some scenarios, or unreasonably high for other scenarios. So, the game calculates it for each individual machine, taking that machine's crafting speed, recipe time, modules/beacons, maximum inserter hand size, etc into account: a max tier assembling machine full of speed modules surrounded by 16 beacons full of speed modules crafting a very quick recipe gets a very large automatic insertion limit, but more "typical" scenarios get much lower limits.
The maximum amount you can insert by hand is *also* dynamically calculated and depends on the automatic insertion limit, not the other way around: I don't know the actual formula/behavior but you'll notice that you can insert slightly *over* 100 iron plates into an iron gear assembler, and you can insert quite a lot of concrete into a nuclear reactor assembler - I think it's at least "the automatic insertion limit plus one stack", but not sure.
So, yes, there's no unavoidable reason why the game *couldn't* also have a setting that said "regardless of what the formula calculates, the automatic insertion limit should always be at least one whole stack" which it sounds like might be closer to what you want, but it's not possible to just say "the limit is always one whole stack" - that would break even recipes in the vanilla game (like nuclear reactors, which require several entire stacks of concrete to craft one reactor). The developers have not implemented such a setting, presumably because they don't feel it's necessary.
The closest you can get is to write a mod that modifies the utility constants as robot256 referred to. If you set minimum_recipe_overload_multiplier to a larger number (say, 50) then every machine will accept at minimum enough ingredients to craft its current recipe 50 times (unless the recipe specifies a specific overload multiplier, but most recipes do not). This still won't be the same number for every recipe, though, and might have unwanted results for recipes that have large input numbers. I'm also not sure whether this actually applies to things that don't use recipes, like ammo in turrets or science in labs; you'd have to try it.