BentoBoxWorld / Limits

Limits blocks and entities on islands - for BentoBox
Eclipse Public License 2.0
8 stars 17 forks source link

Bug in Limits with mobs and lower the tps #95

Closed Espantonius closed 3 years ago

Espantonius commented 3 years ago

Description After being several days i have seen that in the public server that i have drops of tps. Doing some research i have seen this problem. With the Limits addon the mob spawn goes crazy. They appear and disappear quickly generating quite a few drops of tps. I have tried to do it with several users at the same time and they got to lower the tps to 10.

Steps to reproduce the behavior: Having the Limits addon, create a large flat area. In low light areas where mobs appear, this problem happens.

Screenshots Here i show the problem visually so that it is understood.

Now we don't have the Limits addon installed and we see what happens: https://gyazo.com/41e6fdea209f81bf95d3ff8cbe8f585a

When we have it installed and mobs start to appear, the problem happens: https://gyazo.com/12354046d22de15b78ce0a1519bc7f6b

Server Information:

Running PAPER 1.16.2.
Plugins (1): BentoBox
BentoBox version: 1.15.0-SNAPSHOT-b1850
Database: JSON
Loaded Game Worlds:
skyblock (SkyBlock): Overworld, Nether, The End
Loaded Addons:
Biomes 1.13.0-SNAPSHOT-b181 (ENABLED)
BSkyBlock 1.14.1-SNAPSHOT-b670 (ENABLED)
Challenges 0.8.4-SNAPSHOT-b428 (ENABLED)
Chat 1.1.0-SNAPSHOT-b33 (ENABLED)
ControlPanel 1.13.0-SNAPSHOT-b41 (ENABLED)
DimensionalTrees 1.6.1-SNAPSHOT-b82 (ENABLED)
Level 2.4.1 (ENABLED)
Limits 1.15.0-SNAPSHOT-b228 (ENABLED)
MagicCobblestoneGenerator 2.2.0-SNAPSHOT-b159 (ENABLED)
Upgrades 0.2.0-SNAPSHOT-b64 (ENABLED)
Warps 1.10.0-SNAPSHOT-b265 (ENABLED)
tastybento commented 3 years ago

@Espantonius Please share your Limit config.yml so I can see it.

Espantonius commented 3 years ago

@Espantonius Please share your Limit config.yml so I can see it.

This is my config: https://gist.github.com/Espantonius/d0c0edd4b8189008e338337e8862386a I have tried removing and putting and the same thing happens with limited mobs.

tastybento commented 3 years ago

Oh wait, so you're saying that even with no limits set, this occurs?

Espantonius commented 3 years ago

If I don't add the addon, this doesn't happen. If for example i limit zombies, skeleton and creepers it happens only with them. With my config as they are all limited it happens with all.

tastybento commented 3 years ago

There are a few things going on here:

  1. The default setting of the server (in bukkit.yml) is to try and spawn monsters every tick (see ticks-per -> monster-spawns: 1)
  2. By limiting monsters with the Limits addon, you are causing the addon to run a count of monsters on an island every time one spawns. This is done async, so does not lag, but you'll probably see excessive CPU usage on your machine.
  3. The flashing you see is just the Limit addon removing the limited monsters. But as the server tries every tick to make more, they arrive and are removed.

I would recommend either not limit naturally spawning monsters (the addon was originally meant to limit hoppers and other big lag producers), increase and/or increase the ticks-per to 4, which will slow down the spawning.

I'll look into trying to prevent monsters from popping up for 1 tick. Even so, the computation will still happen.

Also, can you run this for a while and share your timings report? There may be some plugin that is listening for mob-spawns.

tastybento commented 3 years ago

Please try the latest snapshot build and let me know how it works for you. It removes the mob glitching.

Espantonius commented 3 years ago

The config i modified it a long time ago. The "ticks-per > monster-spawns" i have it at 20.

I'm going to try the last snapshot to see how it goes and in a few hours I'll comment again.

Espantonius commented 3 years ago

Okay. I have tried the last snapshot and that problem no longer occurs.

If it's not intended for the limitation of mobs, i will change the configuration of the base server for the issue of mob generation.

tastybento commented 3 years ago

Good. Unfortunately, this snapshot has duplication issues and so I don't recommend using it in production yet. It'll need more work to prevent exploits. See the parrot bug #97 .