Project Expansion

Project Expansion

4M Downloads

Large amounts of EMC link item I/O may cause client to hang when opening the Transmutation Tablet

James103 opened this issue · 3 comments

commented
  1. Install all of the mods in the below mod list.
  2. Create a new world with cheats enabled.
  3. Recreate the following setup, as shown in the image.
    • Place a Trash Void from Cyclic.
    • Place a Golden Hopper from Cyclic pointing into the trash can.
    • Place a Final EMC Link from Project Expansion on top of the golden hopper.
    • Set the EMC link to export stone, cobblestone, or any other item with EMC value 1.
    • Accelerate the setup with a Dark Pedestal and activated Watch of Flowing Time on top of the Trash Void.

image

  1. Give yourself a Transmutation Tablet and a Fading Matter, and transmute the Fading Matter to start the process.
  2. No significant lag yet, as there's only two items in the player's knowledge. Give yourself a Tome of Knowledge and insert it as well.
  3. Immediately after the Tome of Knowledge is inserted, the render thread gets stuck updating the player's EMC value on the client and what items the player can learn. Therefore, the next frame on the client will not render until the player's EMC is depleted or the setup is broken or disrupted in any way.

According to the spark profiler results generated at https://spark.lucko.me/HlILvmyN5h, almost all of the time after the first few seconds was spent in moze_intel.projecte.network.packets.to_client.knowledge.KnowledgeSyncEmcPKT.handle

Modlist:

  [✔️] Cyclic-1.18.2-1.7.1
  [✔️] ProjectE-1.18.2-PE1.0.1
  [✔️] ProjectExpansion-1.18.2-1.0.10
  [✔️] spark-1.9.11-forge
commented

Considering this is a bug caused by both tick acceleration and learning every item in the game, the latter of which wouldn't happen in normal gameplay, I'm considering this a non-issue

commented

learning every item in the game, the latter of which wouldn't happen in normal gameplay

Actually, not every item is required to be learned for the hang to occur. The time spent handling the packets is proportional to both the item I/O activity in the EMC links (per real life second) and the amount (not percentage) of items that the player has currently learned.

1,000 is approximately the number of items that is present in vanilla Minecraft.

Some large modpacks may have upwards of 10,000 items or more, many of which have an EMC value. This means that, after some exploration, the player may have thousands of items in their knowledge pool without knowing it. Combine this with an automated setup that is tick accelerated and uses EMC links to input or output items, and the client-side hang behavior originally described may occur without the player realizing beforehand.

commented

I'm not considering the amount of items to not be exclusively not my problem, the tick acceleration is where I'm drawing the line

If you can reproduce this without any tick acceleration, I'll take it on, but otherwise things will lag when you start trying to run 20 ticks in a single tick, which is what the watch of flowing time does