While building TangoTek's Iron Titan I discovered that shooting items into the nether in order to keep the spawn chunks loaded causes massive redstone lag. Normally the Dispenser would emit items about every other tick, but with Forge loaded (no other mobs) the dispense rate is about 1 item per 2 seconds.
To replicate:
Thanks for the report!
That's pretty interesting, I'll take a look.
Just a side note, shooting items into the nether to chunk load it is an awful idea in the first place!
Modded minecraft has all kinds of chunk loaders you can use.
I'm seeing the log spam this:
[07:20:19] [Server thread/INFO] [FML]: Unloading dimension -1
[07:20:19] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@4cc57944)
Can you confirm that this is happening for you too, so we are looking at the same issue?
I actually see some pretty bad lag even in 1.11 vanilla. Have you tested without Forge?
Wrap-up (family got home so I got side-tracked)..
I currently play un-mod:ed due to the beta nature of Forge ;) Once that's sorted I'm going to look into some better way to keep the spawn chunks loaded even when all players are away.
Yes, this is from my log file:
`[15:32:21] [Server thread/INFO] [FML/]: Loading dimension -1 (Survival 1_10) (net.minecraft.server.integrated.IntegratedServer@641929ec)
This is from the testing world I made hence the intense spamming.
I currently play un-mod:ed or with optifine directly patched into the client. The lag isn't too noticeable for me but maybe that's more due to my pretty decent gaming rig rather than lack of lag-causing events.
Do you also see the significant difference between vanilla and Forge?
Both vanilla and forge lag significantly for me with the setup you described.
Ok, For me there's an order of magnitude difference between the emit rates of the dispenser.
Can you take a screenshot of your setup so I can replicate it exactly?
This should work: http://imgur.com/a/vSspz
Ok thanks, I was able to confirm the issue.
Before, I had never walked into the nether so it was lagging on vanilla and forge equally.
After sitting in the nether a bit until it stopped doing chunk updates, forge is much slower than vanilla.
You're welcome. Let me know if you need further assistance or help with testing!
I think this might be happening because when an entity enters a dimension it has to load the World (each dimension is a different World object) and initialize everything for the player (doing basic checks to ensure that the player can spawn there, etc), then the world starts ticking, it realizes that there are no EntityPlayers's in the dimension and unloads it. The logging messages are triggered at net.minecraftforge.common.DimensionManager#setWorld(int, net.minecraft.world.WorldServer, net.minecraft.server.MinecraftServer); which is triggered in net.minecraft.world.WorldServer#WorldServer(net.minecraft.server.MinecraftServer, net.minecraft.world.storage.ISaveHandler, net.minecraft.world.storage.WorldInfo, int, net.minecraft.profiler.Profiler); which is instantiated in net.minecraft.entity.Entity#changeDimension(int); which is triggered somewhere in the Entity's update loop if the variable inPortal is true which is set when you collide with the portal block. You can probably "fix" this behavior by only loading the dimension if the Entity is an instance of EntityPlayer but that may cause the chunk loader for the iron farm to not work. My suggestion would be to only load the dimension if it is a player and to just use a mod based chunk loader.
Wouldn't this break all kinds of things, like sending mine carts through portals? What about pushing villagers and animals into portals? Or are they also EntityPlayer objects?
letting all entities (even non-player ones) pass through portals is an explicit vanilla feature added in 1.4.x. Touching that would not be a good idea :P
I did some basic testing and it looks like Forge has an optimization to immediately unload dimensions when nobody is in there.
I thought Vanilla might do the same, but with a longer delay, but it looks like they might never unload.
The fix here may be to always keep the three vanilla dimensions alive, and only unload modded ones.
@mezz Might it be better to keep them alive once loaded (e.g. Don't load the End until the player finally enters the dimension).
It'd be nice to have a soulution that helps generally, rather than special casing vanilla.
Even just less aggressively loading/unloading dimensions would help.
Why not simply keep the Forge method, but add a delay? (like you assumed vanilla did) As in instead of immediately unloading it, wait about 15 seconds so if more entities are to pass through the portal, it stays loaded for a bit. I feel like keeping loaded for 15 seconds is more efficient than loading and unloading in 15 seconds.
This will keep the overall efficiency of having the dimensions unloaded, while not causing excessive lag if you are sending a large amount of entities through over a few seconds, and prevent the need of special casing.
Most helpful comment
Why not simply keep the Forge method, but add a delay? (like you assumed vanilla did) As in instead of immediately unloading it, wait about 15 seconds so if more entities are to pass through the portal, it stays loaded for a bit. I feel like keeping loaded for 15 seconds is more efficient than loading and unloading in 15 seconds.
This will keep the overall efficiency of having the dimensions unloaded, while not causing excessive lag if you are sending a large amount of entities through over a few seconds, and prevent the need of special casing.