-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to throttle spawn attempts after several failures #11099
base: master
Are you sure you want to change the base?
Conversation
It looks a bit like #9400 |
Similar concept, but different implementations targeted at different problems. The other PR relates to spawn attempts that are failing due to plugins cancelling or aborting the PreCreatureSpawnEvent, while this one primarily relates to chunks where mobs have repeatedly failed to spawn for other reasons (e.g. no suitable spawning locations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the general concept of the patch 👍
Keeping this on the chunk presumably also makes sense, I think there is some discussion to be had regarding EnumMap and object Long usage, but beyond that, just some minor nitpicks.
This patch makes creeper farms not work. Can you fix this? |
Do you have a world download/schematic and configuration you could share? The patch slows down spawn attempts in chunks that have repeatedly failed to spawn mobs - it shouldn't be stopping spawn attempts altogether. Make sure you're not configuring |
I have already set it as you said. |
https://www.planetminecraft.com/project/creeper-farm-6175218/ |
I would imagine that anything relying on spawn proofing is generally going to suck hard with this sort of feature, the concepts are pretty much incompatible, IMHO. |
This patch adds an option to use a longer ticks-per-spawn for given mob types in chunks where previous spawn attempts have consecutively failed (e.g. spawnproofed chunks). The ticks-per-spawn and the number of failed attempts before they kick in are both configurable (the setting is disabled by default). The number of failed spawn attempts is stored with the chunk so it persists across unloads. As soon as a mob is able to spawn in a chunk, the failed spawn attempt counter resets and the chunk starts using the default ticks-per-spawn again.
This behaviour is useful on servers where players use mob farms. Mob farms typically require spawnproofing the surrounding chunks to improve rates, which causes the server to waste CPU cycles trying to find suitable spawn locations. By identifying suspected spawnproof chunks and throttling attempts at spawning mobs in them, it is possible to improve performance without noticeably affecting overall mob spawning behaviour.
I've been using a similar patch on my reasonably busy survival server for nearly a year without any complaints from players.
For illustrative purposes I ran a simple test spending 5 minutes AFK at standard spawning-tower mob farm which had been properly spawnproofed.
Without patch (default ticks-per-spawn):
With patch (multiplying default ticks-per-spawn by 10 after 1200 failed attempts):