Skip to content

Implement Supply, Fluid, and Buffer Depot Priority#50

Open
Bloodyaugust wants to merge 2 commits intoKlonan:masterfrom
Bloodyaugust:master
Open

Implement Supply, Fluid, and Buffer Depot Priority#50
Bloodyaugust wants to merge 2 commits intoKlonan:masterfrom
Bloodyaugust:master

Conversation

@Bloodyaugust
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant