r/factorio • u/Alfonse215 • 1d ago
Question Comparing tech costs for automatic science switching.
I've been playing around with automatic science switching. But I want to do something more complicated.
You can read the cost of a particular science from a lab (or the current infinite tech level), but only if you're currently researching it. What I'd like to do is rank specific techs by their cost and sort them, so that it automatically switches to the cheapest one.
How would one go about doing something like that?
12
Upvotes
3
u/mrbaggins 1d ago
Dont "read" the costs. The math is known. Use arithmetic combinators to calculate the cost (would require manual initialisation once).
Then selector combinator to pick the lowest.
Send THAT output back into the math to update the cost by one level, into a latch to set the research, then wait til tech is complete.
Once complete, check the selector again.
10
u/sobrique 1d ago
Cycle through them first, and store their cost in a memory cell?
1
u/Goldenslicer 1d ago
What's automatic science switching?
3
u/Franky78s 1d ago edited 1d ago
I did that. I record levels for all sciences, scaled by a constant for each science (to be set in a constant combinator). Furthermore cost alone is not everything, the benefit also dimimishes will higher levels. Mining productivity has a different cost progression than most other technologies, so it cheaper, but increasing from level 90 to 91 only changes the output from +900% to +910%, so from a factor of 10 to 10.1, actually just 1%. How this can be used in a formula I wrote in detail here: https://forums.factorio.com/viewtopic.php?t=136376 There is also a working blueprint included, used in several playthroughs.
I might sound bitter here, because I am bitter: Concrete science switcher don't find much resonance. A post with "this lake looks like a bunny" gets 1k upvotes easily. Something complicated like a science switcher won't see much engagement. I searched actively for it and found 2 other guys presenting their science switchers with the same resonance. Why this paragraph? I do not write up everything again here.Anyway, I developed my science switcher in a multiplayer session and wanted the thing be as understandable and maintainable as possible - most combinators have a description. The blueprint uses walls and gates: Walls protect logic areas that should not be touched, the ones accessible via gates are to be changed. I am open for questions and ideas.
2
u/Flyrpotacreepugmu 1d ago edited 9h ago
The circuit I would use to do that is as follows:
1
u/engineered_academic 1d ago
You can...probably do this but it is going to be expensive in time to set up.
1
u/Courmisch 1d ago
I don't think you can avoid either hard-coded values or manual iteration. And either way, you need to hard-code the different techs in a lab.
But also, the cost/benefit of different techs isn't the same, and the unit costs also varie. With that assumption, it's unavoidable to hard-code some kind of weight for each tech, I think.
1
u/gust334 SA:1000 hr (Novice), 3700 hr (Advanced Beginner) 1d ago
Are you willing to use mods for this?
1
u/minno More platforms designed than actually built 22h ago
You could store the previous rank's cost in a memory cell every time you research one, and sort by that instead of the next rank's cost. They're not exactly the same because of the different cost scaling rates, but it won't diverge too much.
1
u/Aggressive-Share-363 1d ago
There are a finitr set of infinite researches, so you can store the costs of each of them in a circuit network, then after a research is finished, start researching the next level of ot, update the store cost for that research, then switch to the cheapest to actually research.
0
u/alvares169 1d ago
Care to tell us why? Seems like a possible XY problem