FactoryPlanner icon indicating copy to clipboard operation
FactoryPlanner copied to clipboard

New solver

Open B-head opened this issue 3 years ago • 8 comments

For now, release it with only minimal UI changes.

Features:

  • Support production loops.
  • Support for bottom-up design.
  • Support machine limit.
  • Respects the list in order and sub-floor structure like the traditional solver.
  • No need to specify free items.
  • (Calculations are slow.)

Not yet implemented:

  • Production percentage.
    • Plan to implement instead an limits will be supported for items.
  • Product prioritize.
    • Plan to implement instead an external product and external ingredient as virtual recipe.
    • It is also improvement of the free items feature.
  • From the reference item, add a recipe that consumes it.
  • Predicting the amount of machines needed when switching machines.

Changes:

  • The solver is now specified using the drop-down menu.
  • The default solver for new subfactories is now the interior point solver.
    • Solvers for existing subfactories will not be changed.
  • Add name and timescale to subfactory_data.
  • Hide the percentage column when using matrix solver.
  • Add and change locale strings.
  • In recipe_line, the item button is displayed even if the amount is zero.

Additional note:

  • The solver has been modified to specify a reference instead of a production goal.
  • Reference is the minimum amount of items to use in a sub-factory. It is used to specify the items you want to produce or consume.

B-head avatar Sep 30 '21 09:09 B-head

I will try this in my SE playthrough and let you know if I find anything.

raiguard avatar Sep 30 '21 15:09 raiguard

image

Well it almost immediately crashes when I load it in my SE save. I tried removing it then re-enabling it but that doesn't help.

~~It must be crashing in on_configuration_changed somewhere, because it doesn't do this on a new game.~~ I'm stupid, it says the event right there in the stack trace!

The Final Frontier.zip

factorio-current.log

raiguard avatar Oct 01 '21 02:10 raiguard

Existing saves need to be migrated. We have changed the version of json.info to 1.1.26.

Oh, I seem to crash with the latest version of Factorio (1.1.41). During development, it was reverted to 1.1.39, so I'll check it out.

Adding a factory planner to an existing save seems to cause a crash. It doesn't seem to be related to the solver, but I'll try to fix it.

It might have something to do with the solver. nil seems to be a state. (I need documentation.)

B-head avatar Oct 01 '21 04:10 B-head

Fixed. (The bug was related to the solver.) @raiguard Please try again.

B-head avatar Oct 01 '21 05:10 B-head

Hello, thanks a lot for this. I haven't had time to look at it yet, and since it is so big, I don't know when I will have time. I want to focus on some other things first. So just FYI, can't make any promises related to this atm.

ClaudeMetz avatar Oct 27 '21 19:10 ClaudeMetz

@B-head Completely forgot to respond, but that did fix my issue. I haven't had much opportunity to play Factorio recently (been spending my time making mods instead) but when I pick up my SE playthrough again I'll continue testing :)

raiguard avatar Oct 27 '21 21:10 raiguard

As far as I'm concerned, an LP solver is basically the raison d'etre of a factory planner for a pack like, e.g., Seablock. I would absolutely love to see this solver merged.

qdbp avatar May 25 '23 01:05 qdbp

Yeah I agree it makes sense to have one, and I'm sorry I haven't really gotten to any of the proposals so far. I plan on working on the solver side of things at some point.

ClaudeMetz avatar May 25 '23 10:05 ClaudeMetz