Applied Energistics 2

Applied Energistics 2

137M Downloads

Fluid container filling and emptying.

Technici4n opened this issue ยท 2 comments

commented

Add an item-only mode to the fluid annihilation and formation planes.
When in item-only mode, they will not place or pickup fluids from the world, but they will instead fill or empty fluid containers. For example, an annihilation plane in item mode will suck out the water from any water bucket that touches it and leave an empty bucket behind.

An example of a powerful fluid bucket emptying machine:

  • Formation plane that places full buckets.
  • Fluid annihilation plane in item mode that will suck the fluid out of the bucket.
  • Item annihilation plane with a storage bus + interface to whitelist empty buckets only.

A similar bucket filling setup is easy to imagine.

PS: inspired by a similar botania feature.

commented

While this sounds interesting on paper it has some glaring problems, which cannot be really solved without a major change in how planes work. Which in return will also lead to various problems that are fine in the context of botania but not really AE2.

The first one is that planes only react to collisions. This means the empty bucket to be filled has to sit on a fluid plane (same way for emptying). Once it is done, it will just sit there forever as it will never come into contact with an item plane to get sucked up.

On attempt here would be to transport them with a water stream, but that is extremely random. Which means the empty bucket can easily pass the plane before the fluid is even passed to the plane. Or it uses a long stream to give it more time, meaning in return it might run out of storage space for the fluid and can only process 4 buckets every 5 secs. Trying to tune it further will most likely run into problems with our dynamic ticking, so while testing it initially might work, once it runs at full speed it might break down again.

So overall very inconvenient compared to drop the bucket, pick it up with a plane to dump it into a fluid transposer and then spit it out the other side with another plane just to pick it up (or just export the item directly into a fluid transposer)

Other problems will be massive performance problems. Filled buckets do not stack as item entity like seeds or similar to 64. So requesting 1000 buckets of water will have 1000 entities floating around in the world. While 1000 seeds would ideally combine into like 16 entities. I guess this is fine for botania as they won't scale that massively but with AE2 we have to plan accordingly.

Which is one reason why planes operate on collisions and not scan for entities in front of them. Fetching entities in a specific AABB is not free and on top we then have to iterate over potentially thousands of entities every tick to filter them. We can probably use a similar approach as now and break immediately once we encounter something neither white or black listed and then stop costly network insertions. But it still leaves aquiring all entities in an area every tick and knowing minecraft, this probably means iterating over all entities in all chunks the AABB spans and then comparing every entity against the desired type and position. Meanwhile the collisions will happen, too, and we can just hook into them.

Further it would require the annihilation plane to get a UI, which was always rejected as it is pretty useless and limited in the scope of AE2. As already stated this is mainly to take massive scaling into account. So it is mostly designed for someone having a 25 by 25 area with planes. Say for a botania miner with orechids and instead of having around and configure 1250 planes to place stone and break everything but stone each by itself including dropping 625 crafting cards into the formation planes so the supply of stone is guaranteed and placing 625 inverter cards into the annihilation ones and adding stone to the filter, instead just place down a single export bus with a crafting card and a single storage bus with an inverter card and be done. And that scales from 1 plane to pretty much infinite (ignoring channels for now).

So yes, the initial setup is a bit more complicated than it could be, but that can be pretty much neglected once you add more planes, which will either just work directly. Or worst case needing to add a controller for the subnet and then just add more.
But without having to configure every single plane on its own. With like a 100% chance to miss a single plane, which then causes the whole build to fail because all it will now do is to place stone and immediately turn into cobble again with a few ores scattered around everytime the orechid converts a stone to an ore.

So while I certainly see adding something to fill or empty fluid containers as a must in the long term, we shouldn't pick the option which will result in the most annoying option with the worst performance when scaling up.

commented

Probably not gonna happen. Bucket filling/emptying is already automatable with AE2 only through dispensers, and most mods have their own way of filling or emptying containers. Adding another way in AE2 itself would be redundant.