Skip to content

Per floor solving - #895

Open
vapopescu wants to merge 93 commits into
ClaudeMetz:masterfrom
vapopescu:per_floor_solving
Open

vapopescu wants to merge 93 commits into
ClaudeMetz:masterfrom
vapopescu:per_floor_solving

Conversation

@vapopescu

Copy link
Copy Markdown
Contributor

Will change target branch when it's created.

Stuff that breaks:

  • Machine limits on floor 2+ for sequential solver
  • Existing Gaussian solver solutions for multi-floor factories

New stuff:

  • All solvers are solved per-floor in a common framework
  • Sequential and Gaussian LineResults now only pass the solved machine amount. The resulting line aggregates are calculated on a common path
  • Machine limits for Gaussian solver for the 1st floor and adjacent lines (top line of floor 2)
  • Auxiliary solver data is also stored per-floor

I re-ordered functions in solver.lua and gaussian_engine.lua in order to make them local. As a result, the changes are quite hard to read. Sorry for that.

@vapopescu
vapopescu marked this pull request as ready for review September 21, 2026 09:38
@vapopescu

Copy link
Copy Markdown
Contributor Author

I implemented my idea of floor status and solver errors. You can check and change as needed.

@ClaudeMetz

Copy link
Copy Markdown
Owner

Nice, I'll do the settings and stuff and then review, might take a few days.

@ClaudeMetz

Copy link
Copy Markdown
Owner

So how does the migration of the gaussian solver work in practice? I guess if there's multiple floors there'll be too many free items in most cases and people will need to unselect some to get things to work again?

@vapopescu

Copy link
Copy Markdown
Contributor Author

This is pretty much correct. The solver also filters free items that only appear on that floor, so the number is also reduced that way.

Since this is a one-time thing, I did not want to do anything more complicated than this. But if you have other ideas, let me know.

@ClaudeMetz

Copy link
Copy Markdown
Owner

No that sounds about right, it's unavoidable that this breaks some setups, and I'll mention that in the changelog.

So technically this doesn't implement per floor solver choice, so we could merge it without that, but it's just a GUI thing to do that right, so we should do it all at once?

The solver architecture if beautiful btw, distilling the solvers as much as possible to what makes them unique and consolidating everything else in one file. It's what I always had in mind but never had the skills to achieve :)

@vapopescu

Copy link
Copy Markdown
Contributor Author

Thanks! I appreciate the compliments

So technically this doesn't implement per floor solver choice, so we could merge it without that, but it's just a GUI thing to do that right, so we should do it all at once?

Your choice. I'll do a small change to prepare the per-floor setting. If everything works well, you only need to change that and it will work.

@ClaudeMetz

Copy link
Copy Markdown
Owner

Btw this crashes when starting a new game, I could have a look at a fix but you probably know the right fix. Go ahead with the preparation too then, we'll do the changes all at once.

@vapopescu

Copy link
Copy Markdown
Contributor Author

Done with the change and the crashes.

@ClaudeMetz

Copy link
Copy Markdown
Owner

I moved the warnings to the solver bar, as the production bar is a bit too crowded on smaller displays potentially.

@ClaudeMetz

ClaudeMetz commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Please have a look at whether the pref makes sense to you and whether the changelog is correct and complete. (I still have reviewing to do but wanted to make my changes now)

@vapopescu

Copy link
Copy Markdown
Contributor Author

The Gaussian solver status looks a bit weird being split into 2 labels. I will adjust it. Adding tooltips to explain the errors may also not be a bad idea.

Other than these, it looks good.

Comment thread modfiles/changelog.txt Outdated
Version: 0.00.00
Date: 00. 00. 0000
Features:
- Rewrote the Gaussian solver to bring it in line with the other solvers. It now treats subfloors in isolation instead of internally combining everything onto a single one. This will break some setups and/or require reconfiguration. The solver now also supports machine limits. (#842) (Thanks vapopescu!)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a change, not a feature. Added machine limits are a feature.

Comment thread modfiles/changelog.txt Outdated
Features:
- Rewrote the Gaussian solver to bring it in line with the other solvers. It now treats subfloors in isolation instead of internally combining everything onto a single one. This will break some setups and/or require reconfiguration. The solver now also supports machine limits. (#842) (Thanks vapopescu!)
- Added a setting to allow you to use distinct solvers for different floors when desired. As a consequence, solver configuration is now always done per floor, not globally per factory (#768) (Thanks vapopescu!)
- Reworked how errors related to the solvers are presented to improve clarity about what is going wrong (Thanks vapopescu!)

@vapopescu vapopescu Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a change for Gaussian, and a feature for simplex.

@ClaudeMetz

Copy link
Copy Markdown
Owner

Adjusted the changelog a bit. Also noticed that this release might be vapo-only changes, impressive lol. Trying to get back to reviewing soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants