BuildCraft|Core

BuildCraft|Core

7M Downloads

Improve quarry chunk loading

SpaceToad opened this issue ยท 7 comments

commented

See http://mod-buildcraft.com/forums/index.php?topic=762.0. In particular, quarries should operate when all chunks they need are loaded, whether or not they're forcing loading.

commented

It looks to me that QuarryPlus "soft" loades the chunks it is working in. This means it is using Minecraft built in mechanisms to load chunks instead of forge. A little bit like when a piston push a block into a new chunk.

Chunks that are loaded that way are normally not unloaded again unless a player comes along to trigger "real" loading. The chunks are unloaded when the player leaves the area.

This type of loading creates "orphaned" chunks. They require the same amount of memory as "really" loaded chunks, but they are less performance demanding because the chunk is passive. Nothing is growing etc.

A mod can force an orphaned chunk to unload. I know that chickenchunks does, but it is configurable. It can be terrible for performance if a system is constantly reloading a chunk that is being unloaded because it is orphaned. It could be that Quarry plus unload the orphaned chunks to save on memory. As you usually don't build a lot of piping system in the same chunks as a quarry you won't run into performance issues related to rapid loading and unloading.

PS This is where you point out that everything I said is wrong. I honestly don't understand everything that is going on.

commented

SpaceToad, I would like to refer you to Quarries Plus. It is an addon for Buildcraft that basically makes it so you can have 4X the size of a BC quarry. The reason I wanted to point this out is that they have implemented something similar to the Ender Quarry chunkloading. The only chunks that are loaded are the chunk that the actual quarry block is in and the current chunk that the quarry is mining and it still mines the area similar to a BC quarry...frame and all. I imagine they had to do this to make this even a small bit viable on a server since you can have literally a 256X256 block area to quarry with the QuarryPlus. Anyways, the mod is open source so if you want to see it's insides...here is a link!

https://github.com/denoflionsx/QuarryPlus

I think if you could implement something like this for the BC Quarry then you could kill 2 birds with 1 stone!

  1. Using less resources (Every server Admin's dream...yes, I run a server)
  2. Stops people from using Quarries as a chunkloader for their base (which is another reason server admins blacklist the thing in the first place!)

Hope the information is helpful!

commented

While I am not a programmer, the main reason I even recommended this is because when I used Waila in 1.6.4 to see how many chunks it was force loading I was amazed to see that it was only loading the 2 chunks. I expected these things to take down the server, but they caused less lag than the BC Quarries that were literally 1/16th their size. A friend and I were competing with resource gathering and literally had 16 of these 256x256 block quarries running simultaneously with no significant hit to the server. As for the orphaned chunks, I am not sure if WAILA shows those on MapWriter, so I couldn't tell you if that is the case or not.

All I can say for sure is that if we had of used 16 of the BC Quarries at max size (64x64) then we would have noticed a much larger drain on the tick rate. Again, I only posted this as a possible source to gain an alternative idea for the chunkloading mechanics of the current quarry since it seems to handle a much larger quarry area with less of a hit to performance....and the fact that it is open source so someone with programming experience can take a look to see if it may be helpful to solve some of the issues that server admins face when a lot of players are running quarries...or just using them as an alternative chunk loader for their bases.

You may or may not be right about the way it handles loading and unloading of chunks, I am in no position to really argue. I also run a script on my server to back up every 30 mins and restart the server every 4 hours due to the fact that I run a LOT of buggy beta mods in my pack most of the time that can over time cause the server to bog down, the restart keeps this from becoming an issue and would more than likely unload all those orphaned chunks if that was the case. So if that was happening, I may not have noticed it anyways.

commented

@psychofad @SandGrainOne thanks for the insights. Soft loading is definitely an option to investigate, at least as an experimental option at first. Maybe just load the one chunk where the quarry is located, and soft load the rest?

commented

Added an option to disable quarry chunkloading. A quarry will only function if all the chunks it needs are loaded, though.

commented

@asiekierka So it works like QuarryPlus now? Cool. Finally the Quarry is less laggy.

commented

@RagaRBM not by default though