Fluid recipes hold up all machine processes when backed up
antrobot1234 opened this issue ยท 3 comments
GregTech CEu Version
2.4.1
Modpack Used
Nomifactory CEu
Addons Installed
Gregicality Multiblocks 1.1.4
Environment
Singleplayer
New Worlds
Unsure
Cross-Mod Interaction
No
Expected Behavior
Even if a machine is backed up with a fluid recipe, item proccessing recipes should still be allowed
Actual Behavior
If a machine that can process fluid and item recipes (E.G. lv centrifuge) get's full up on a liquid (E.G. nitrogen) and the fluid input has the ingredient in it enough to "craft" the fluid recipe (E.G. air), then the machine will not proccess any recipe, even recipes that do not interact with oxygen or output fluids at all)
Steps to Reproduce
- fill centrifuge with air until output and inputs are backed up
- attempt to proccess an item-based centrifuge recipe
- it will not work
Additional Information
No response
Thank you for your time reporting this issue. It is something that is regrettable, but fixing it would have other consequences.
Currently a machine tries to run the first recipe it finds, and stalls if it cannot run it. Your proposed idea would imply that a machine should find and list all the recipes available from the given inputs, and then try to run them one by one until one works.
This would potentially cause a lot more lag for machines with big input buses, which would be going backwards in terms of all the performance improvements that have been made over GTCE.
If there is a clever and lag free way to implement this, we will most likely take it.
What about caching whether a recipe is are potentially runnable, run them, remove from cache on failure, stall if cache empties, update cache on new item/fluid input (potentially not on removal due to recipe start and not on receipe completion to reduce lag).
This idea might not be feasible, could massively increase ram usage, i've not looked into how inputs and receipes are handled.
Here is a decent solution :
If the machine is processing a recipe, keep processing that recipe as long as input items/fluids are available and there
is room for output. Once the machine cannot process further, enter idle state.
In Idle state perform the following :
- Pick a random input item/fluid (not sure if you need to pick a random input bus/hatch too, shouldnt be a problem)
- lookup recipes that involve this input item/fluid, pick one at random (this should be very fast if data structure for recipes is
properly implemented, ie. perfect hash or at least equivalent to a balanced tree search) - if no recipe is found or the found recipe cannot be processed, stay in idle state and do nothing until next update,
maybe even wait for a few update cycles if you really want to dilute processing time - if the recipe can run, start processing that recipe and leave idle state
Of course I assume you have access to a stable uniform rng with high performance