-
Notifications
You must be signed in to change notification settings - Fork 150
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
Invpipes #1403
base: master
Are you sure you want to change the base?
Invpipes #1403
Conversation
…d in pipes not being persisted (GregTechCE#1357)
…ists for backwards compatibility
The "convert to draft" option doesn't work for me? |
Regarding idea: Regarding implementation: I'm currently a bit busy and cannot really review it properly, but i'm sure LAGIdiot can do it on his own. |
I have added a simple prototype for the energy. The energy works like the fluids in fluids pipes. A downside to this approach is that energy is lost when two networks merge and there is not enough capacity to store all the EU. On a split the energy is just divided up between the two new networks. This initial commit is intended so you have something to play with and discuss how energy actually works. |
I tried doing the idea of using of an external charger/controller. But this runs into complications where during chunk loading, the pipes are loaded before the charger(s), which is pretty much always, because you will have more pipes than chargers. I am not saying it is not doable, but it would need some kind of lazy energy container like what is done for the item handlers of connected inventories. I have a kind of working implementation without the reloading stuff. |
Honestly when I opened this PR I was blown away by size of it. And it may take me a while to go through all of this. First of all I have to acknowledge your bravery to created new system from nearly nothing (I would probably start from getting ideas in issue - but that is me). Regarding your idea I like it. And I can see that you put quite lot of thought to it and even marked parts which need to be expanded. System of pipes which will be able to connect our machines (+ worktable, others) either directly or through cover seems really good. I think your initial idea could be expanded quite a bit and become indispensable part of GTCE. As already Archengius mentioned this system should not work for free and I would like to add it should be scalable (throughput based on pipe size as we have for fluids) also we should have covers for all tiers (but I guess we can generate these later when we have base established and polished). I will need to do deep dive in this to give you more detailed and meaningful comments. (I will try to get to it as soon I get my dev environment working again). |
I have added a hacky prototype of a "keep in stock" cover. TLDR: You add the cover to an item pipe attached to a machine and configure what items you want to keep in stock using the machine. The implementation details are not what I want to discuss, I tried to do it without modifying any other code so it is full of hacks.
|
I have added integration for the inventory pipe network into the crafting station (actually its recipe resolver). I did it by creating a StorageNetworkItemSource, which is kind of meta :-) What this does mean is that if you have 10 crafting tables on an inventory pipe network, any updates to a chest on the pipe network will get processed 11 times;
These updates are actually consolidated and done once every 20 ticks unless the user is actively crafting. |
FYI: I have released a modified version of these changes as an addon project: This will let people play with it and give feedback, instead of it just sitting in limbo. I still plan to integrate these changes into GTCE proper, but I will instead with your agreement do this in a staged manner in separate PRs. The proposed roadmap is;
NOTE: In the addon project I have removed the ability to right click an inventory pipe and see the full storage network. |
I see and I totally understand your action. I am still interested in getting this merged in GTCE but I am barely able to keep up with small PRs to just fill releases. But I am doing some changes on Discord to get more people do reviews. So I expected that I will start having more time in not so far feature to get deep look at this or someone else will join me on it. |
@warjort there should be some kind of Conversion of Blocks when migrating from the Addon that Players don't lose their System when migrating from Addon |
I don't think that is necessary, the 2 systems should be usable in parallel. The main stumbling block for migration is that it is not guaranteed that the blocks/items accepted into GTCE will be 1 to 1 with those that exist in GTCE-inventory. But having the two pipe systems join together into a single pipe network seems unlikely because of the way pipe networks are implemented (e.g. they will be stored in different files in the save data). |
@warjort Another Question: Why this thing before Item Pipes? |
I don't understand your question. |
@warjort I mean, why do u want integrating Invpipes before Item Pipes got integrated into GTCE? |
Invpipes are item pipes. Invpipes is short for inventory pipes. |
Hmm, ok, for me it looked more like Logistics Pipes or Applied Energistics 2 like system because of autocrafting and all that stuff |
That is built on top of it. At its heart, the feature is a consolidated inventory exposed as a capability. |
What:
This is not really a PR, more an RFC. I will try to convert it to a draft PR if I can figure out how do it.
This fixes the inventory pipes so they useable.
TLDR: You can connect inventories together using inventory pipes then use them as one big item source/sink.
I have got the thing working, but I haven't done any real testing in anger.
How solved:
There are few main parts to what I have done:
The inventory pipe has all the usual features like painting, wrenching, covering, etc.
The inventory pipe network already exists in the codebase but it has some bugs (I have fixed the ones I found) but
then it is still unusable as nothing uses the network.
So I have introduced a way to add a UI to any pipe when right clicked (by default it does nothing).
For the inventory pipe this shows the consolidated inventory which you can manipulate.
This reuses the widget created for MetaTileEntityWorkbench.
I have introduced a new capability called IStorageNetwork. This lets you manipulate the consolidated inventory.
I have made the inventory pipes implement this capability.
I have introduced a new cover called the CoverStorageNetworkInterface.
The cover can be placed on anything implements the IStorageNetwork capability, i.e. it goes on the pipe.
This works like a Conveyor (the code is basically a copy) and has all the features of one (including all the item filters), except that it moves between an IStorageNetwork and a normal inventory.
The idea is that you put one in export mode on a machine to move items from anywhere in consolidated inventory then one in import mode to return the outputs.
That's it. This is a basic proof of concept so I can ask for feedback.
Outcome:
N/A
Additional info:
I have spread a number of "Review:" comments in the patch which I will try to summarise here:
The main review is on the gregtech.common.covers.CoverStorageNetworkInterface which is a bit long to reproduce here.
It outlines possible future changes to make the inventory pipes more useable.
How do unique numbers get assigned, e.g. for new metaitems and covers?
I recommend adding something to the README in the project to outline this policy.
Is it ok to change the IPipeTile in the way I have introduced the UI handling?
The new capability IStorageNetwork is basically a simpler version of IItemList which was a gregtech.common interface before. Is the way I did this (including the IItemInfo) ok?
For the rendering, I didn't use the existing renderer since I couldn't figure out what model I needed to create (it missing in the codebase).
Instead I created a pipe renderer based off the fluid pipes, except they are coloured Aluminium.
The new cover reuses the conveyor assets. I didn't want this PR rejected because of my lack of artistic skills.
The cover is only present in LV tier, the other tiers will need creating once it becomes fixed so future changes don't have
be copied multiple times.
Finally there is a big hack to stop an NPE when loading the inventory pipes. see WorldInventoryPipeNet.
To fix this properly will need a change to how pipe nets are deserialized.
I didn't want to do that for this prototype since it means messing with the code for cable and fluid pipes which are currently unchanged by this PR.