Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch lathe jobs #2798

Merged

Conversation

whatston3
Copy link
Contributor

@whatston3 whatston3 commented Jan 28, 2025

About the PR

Items in a lathe's queue now represent some number of the same item to be printed multiple times. This is useful when more than one item is requested (can be done easily with any lathe, since the Amount field is available on all of them.

If nothing else, this reduces the size of the queue which is sent in the lathe BUI state updates in pain points (many many items of the same type).

Why / Balance

Fixes #2792.

How to test

  1. Insert a bunch of glass into an autolathe.
  2. Queue up a job for some quantity of beakers. They should batch into one item with the amount listed (note: currently listed even for batches of one)
  3. Queue up another job for more beakers. It should join into the previous job.
  4. Insert the materials required to make droppers.
  5. Queue up a batch of droppers, it should spawn a new job.
  6. Queue up another batch of beakers, it should spawn a third job.
  7. You should now have one request for large beakers (X/Y), one for droppers (0/Z), and one for beakers (0/W).

Media

image

Requirements

Breaking changes

Changelog

🆑

  • add: Lathes now batch jobs of the same type.
  • fix: Lathes should behave better when queueing large batches of the same item.
  • tweak: Printing material sheets now takes about 60 ms a sheet.

@whatston3
Copy link
Contributor Author

whatston3 commented Jan 28, 2025

One more thing with the issue here:
Zero time jobs can recurse, so a batch of 1000 jobs recurses into TryStartProducing->FinishProducing->TryStartProducing... 1000 times.
Best solution might be to make all lathe recipes take some minimal amount of time, even if just a tick.
Alternatively we could limit recursion so maybe only 10, 20 jobs would be enqueued per process call (enqueue/update).
I really don't think a small timeout for ore processing is a dealbreaker.

@dustylens
Copy link
Contributor

My only fear is that a qol improvement like this one will simply lead to more qol demands in the future.

But seriously this is a grand addition. Tested making batch medkits and it was really nice and easy to take a look at what orders I was putting together.

@github-actions github-actions bot added the YML label Jan 28, 2025
@whatston3 whatston3 added S: Awaiting Changes This PR has changes that need to be made before merging and removed S: Needs Review This PR is awaiting reviews labels Jan 31, 2025
@whatston3 whatston3 added S: Needs Review This PR is awaiting reviews and removed S: Awaiting Changes This PR has changes that need to be made before merging labels Jan 31, 2025
Copy link
Contributor

@arimah arimah left a comment

Choose a reason for hiding this comment

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

Works fine, code looks sane, no complaints. :)

@arimah arimah merged commit 52b346d into new-frontiers-14:master Feb 1, 2025
12 checks passed
FrontierATC added a commit that referenced this pull request Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Large lathe requests cause performance issues.
4 participants