MineMaarten / PneumaticCraft

PneumaticCraft source
Other
84 stars 50 forks source link

Drones seem to be causing tps lag when sleeping in unloaded chunk #901

Closed 811Alex closed 7 years ago

811Alex commented 7 years ago

I made a drone 3 days ago, that shoots mobs around my base and then it executes "Standby", until there are more mobs to shoot @ (This is on a semi-heavily modded server running PneumaticCraft-1.7.10-1.12.7-150).

The last 3 days I've been noticing an insane tps drop after I've been offline for a while. If I (and everyone else in by base) went offline for like... 8h and then came back there would be a tps of 4-7, had to restart every time since it didn't seem to recover. After the restart, I would join and the tps would be back to 20. Here's the map of my base:

map before

In the image, the pink dot (middle of the map) is where the drone executes "Standby" and the area within the yellow border is being chunkloaded.

However, I found out that after changing the chunkloaded area like this:

map after

and going offline for 10h, tps was still 20 when I joined again. I'll just be telling people in my server to chunkload their drones, so I don't mind too much, but I thought I'd let you know. Anyway, keep up the good work and have a good one! ^-^

Tekstack commented 7 years ago

If you do chunkload drones, you need to take the "all or nothing" approach. Either you A, chunkload not only the drone but the entire working area with some overlap. Drones use MC pathfinding AI and it may not go in a straight line and stray outside its bounds if say for example a random entity such as a cow is in the drone's path, it could go outside the boundaries to avoid the cow. Option B, is to not chunkload either the drone or the working area. The same concept applies to multi-block structures, you don't want a multiblock such as a capacitor bank overlapping loaded and unloaded chunk boundaries.

811Alex commented 7 years ago

Thank you so much for that info! So I'm guessing that if I chunkload, say, all of my base, I'll be fine, but if I chunkload just a part of the working area - even if the drone isn't included - it's gonna create issues, right?

811Alex commented 7 years ago

Ok, I tested a bit on my server and it seems that loading the entire working area fixes it, as you said. I'm guessing that this isn't an issue concerning this mod in particular, so I'll just close this. If anyone comes across this issue, just chunkload all of the working area or none of it.