DarkPacks / SkyFactory-4

SkyFactory 4 offers a brand-new experience never before seen in the series. Full automation, tech, magic, and bacon resources! This iteration offers over 30+ world types so you can play the pack like never before!
https://minecraft.curseforge.com/projects/skyfactory-4/
134 stars 45 forks source link

bonsai hopper + file cabinet = tps lag #363

Open lennert05 opened 5 years ago

lennert05 commented 5 years ago

Bug Report

TPS lag from hopping bonsai pots on file cabinets

Steps to Reproduce (for bugs)

  1. place filing cabinet with folders of the resources form the tree in the bonsai pot
  2. place the bonsai pot on top of the cabinet
  3. place the dirt and the sapling in the bonsai pot

Screenshots

World Information

Server Information

JayJay1989 commented 5 years ago

@sk2048 do you need something specific for this bugreport from our side?

Tellik commented 5 years ago

You'll see this a lot actually in similar situations. There are a lot of mods that do this, where they generate resources and then attempt to push those resources into connected storage units. Cloches are really bad for this, but I've seen it in a lot of other situations like bonsai pots, cobble generators, environmental tech resource/ore miners, etc.

I haven't seen it specifically with cabinets, but the basic idea is:

Resource Generator -> Full storage unit -> Resource generator spends ticks attempting to search for available storage space to push items, doesn't find anything, and then repeats the process. This is the big cause of TPS lag in most of these situations.

The easiest solution I've found is to provide a sort of voiding overflow system to these setups. Such as putting a void upgrade on a drawer, or pipping excess into a trashcan at a lower priority.

I imagine a safer fix would be if the mod author, for the item that generates the resource like Bonsai Trees, made it so that it wouldn't attempt to force items into adjacent inventories. Or at least to build in some sort of redstone comparator type logic that checks if it's full, and if it is full to turn off generation.

JayJay1989 commented 5 years ago

the file cabinets are'nt full, this was a test setup (on a new island) made after we noticed a lot op tps lag. so basically you say they're always full when they're empty?

Tellik commented 5 years ago

So I did some testing. I'd have to look more detailed into the source to figure out what's going on though so this is just based on comparison in a few different situations.

It's possible depending on how the file cabinets handle item insertion. It seems like it would take the source -> file cabinet -> sort into the folder. It also depends on how hopping bonsai inserts into a storage unit.

It also looks like each additional folder in there, takes extra time based on how many folders are in the filing cabinet. (As no folders is a lot less TPS laggy than 8 folders)

andremiller commented 5 years ago

In your LagGoggles screenshot, the filing cabinet only showed Iron Acorn and Iron Resin. Did you only have two files in it? What happens if you also place files in there for the wood, leaves and saplings, does the lag go down?

geleugim commented 5 years ago

I have been trying to figure out some issues and I figured out that if a pot has a hard time inserting an item it causes lag even with regular chests. When I add a folder for each item that a pot drops it significantly lowers the micro units. check out my screenshot. https://www.dropbox.com/s/8xagnk34t80ixes/LagBeforeAfter.png?dl=0