Applied Energistics 2

Applied Energistics 2

137M Downloads

Annihilation Plane gets stuck

infogulch opened this issue · 4 comments

commented

The Annihilation Plane can get stuck when an item it can't store is placed in front of it, even when other items it can store are available to pick up.

Description

The annihilation plane does not have any way to filter items that it destroys, except by limiting the storage of items in the network itself. If you want to have it only pick up a certain item, don't allow the network to store anything but that item, and it won't pick it up. I think this is great, it encourages subnetworks and makes it more about the layout and design of the system instead of endless gui configuration.

But it can get stuck if there is an item it can't store in front of it that existed before an item it can store.

Steps to reproduce:

  1. Create a network with only an annihilation plane and a storage bus facing a chest, where the storage bus is filtered to one of two items, such that when you drop the filtered item onto the annihilation plane, it is placed into the chest.
  2. Drop the unfiltered item onto the annihilation plane. It will not be picked up, as expected.
  3. Without picking up the unfiltered item, also drop the filtered item.
  4. Note that the filtered item that should be picked up is never picked up, and it despawns.

Here is a short 1 minute clip demonstrating the above steps: https://media.giphy.com/media/5Wky2nhAkW06sxwdjS/giphy.gif

My wording above about the item 'existing before' isn't incidental. It turns out that this issue disappears if you drop the filtered item first, and then the unfiltered item. This is a bit trickier to set up because normally when you drop the filtered item it is instantly sucked up and there's no chance for it to interact like this. I managed to test this by dropping the filtered item into a slow water stream first, and then dropping the unfiltered item directly onto the annihilation plane before the other could arrive. In this case the filtered item is picked up. I demonstrate this setup here

This indicates to me that the annihilation plane's behavior is dependent on the order that the items (entities) came into existence, probably their entity id.

Environment

Environment from above video reproductions:

  • Minecraft Version: 1.12.2
  • Forge Version: 14.23.4.2760
  • AE2 Version: rv6-alpha4
  • No other mods or customization or configuration changes whatsoever.

This also occurs in the Foolcraft 3 v1.5.1 pack which uses AE2 rv6-alpha3, along with many other mods.

commented

This is intentional to avoid performance isues.

commented

I see. I suspected it might be performance related.

Correct me if I'm wrong, but I would guess that by performance issues you mean that you want to avoid O(n) testing every unstorable entity against the network on every tick for potentially hundreds to thousands of items. Is this correct?

Actually I had a look at the code in PartAnnihilationPlane to try to find where this happens and wasn't able to grok how the current behavior manifests. I would like to understand it better, could I ask for a favor to ask for a short description of what's going on or even just a link to the part I should be paying more attention to?

I believe there is an O(1) solution that would still eventually pick up all the items that can be stored (in reasonable circumstances), but I would need a better understanding of the code before I would be able to propose anything.

Thanks for making such a great mod!

commented

I will have a closer look tomorrow. It seems to me there is something strange going on with isAccepting.

commented

Hey did you have a chance to look at this? Were you able to find anything?