Implement Supply, Fluid, and Buffer Depot Priority#50
Open
Bloodyaugust wants to merge 2 commits intoKlonan:masterfrom
Open
Implement Supply, Fluid, and Buffer Depot Priority#50Bloodyaugust wants to merge 2 commits intoKlonan:masterfrom
Bloodyaugust wants to merge 2 commits intoKlonan:masterfrom
Conversation
When creating a request, request and buffer depots now ask depots on the network for their priority. All types of depot except fuel and request implement a priority getter, which checks for an attached circuit writer. If it exists, the signal "0" is read from both wires and merged. This signal is returned as the priority. If no circuit writer exists, or if the signal "0" is not present, 0 is returned. The highest priority group whose contents satisfy the minimum request size is chosen to receive the request, and the normal heuristic is run against this group to determine the specific request target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using the network writer, I think I was able to implement workable priority setting for the various types of supply depot. See commit messages for detail, but basically, you send an amount on signal "0" to a circuit writer attached to a depot, and that becomes the priority for the depot. Higher priority depots get pulled from first by requesters and buffers. Normal heuristic applies to depots with the same priority. PR also adds a tip screen to explain, although only translated to English.
PS: This is my first delve into Factorio modding, and I haven't touched Lua in years... let me know if there are code quality concerns.