Adaptive Performance Tweaks (Bundle)

Adaptive Performance Tweaks (Bundle)

3M Downloads

Almost no animal spawning

bloodyraoul opened this issue ยท 27 comments

commented

Describe the bug
I used the 1-9.1.0 version in my 1.20.1 server (forege 47.1.47) with RaoulTech modpack
I have removed the mod from the pack because animals were not spawning correctly.

To Reproduce

  1. Create a new world with the mod
  2. Some animals are spawing around the spawn point
  3. Start to explore lot of regions
  4. After a while, no animal spawning at all, but monsters spawn very very quickly

If you remove the mod, spawning is not restored

Expected behavior
Always come back to normal spawn rate
Add a command to check and reset spawnrate

I was using the mod in 1.19 without any issue like this

I guess the spawn rate is reduced when the server is very busy but don't seems to be increased again

commented

Thanks a lot for the report, I haven't experienced any issue in 1.20.1 so far myself, but this doesn't mean that there could be an potential issue.

It would be great if you can provide a debug.log with the following steps:

  1. Load the world which doesn't spawn mobs
  2. Run /aptweaks debug core true and /aptweaks debug spawn true
  3. Move a little bit around the world
  4. Run /aptweaks debug core false and /aptweaks debug spawn false
  5. Exit the game
  6. Share the debug.log which should contains entries like:
[26Mai2023 20:09:09.567] [Server thread/DEBUG] [APTweaks(Core)/]: [Left] Entity minecraft:bat (Bat['Bat'/717, l='ServerLevel[Test World 1.18.2]', x=-246.35, y=25.68, z=-614.77]) leaved minecraft:overworld.
[26Mai2023 20:09:10.564] [Server thread/DEBUG] [APTweaks(Core)/]: [Joined] Entity minecraft:bat (Bat['Bat'/816, l='ServerLevel[Test World 1.18.2]', x=-314.50, y=-34.00, z=-645.50]) joined minecraft:overworld.
[26Mai2023 20:09:10.614] [Server thread/DEBUG] [APTweaks(Core)/]: [Joined] Entity minecraft:bat (Bat['Bat'/818, l='ServerLevel[Test World 1.18.2]', x=-232.50, y=20.00, z=-705.50]) joined minecraft:overworld.
[26Mai2023 20:09:10.614] [Server thread/DEBUG] [APTweaks(Core)/]: [Joined] Entity minecraft:bat (Bat['Bat'/819, l='ServerLevel[Test World 1.18.2]', x=-231.50, y=20.00, z=-703.50]) joined minecraft:overworld.
[26Mai2023 20:09:10.614] [Server thread/DEBUG] [APTweaks(Core)/]: [Joined] Entity minecraft:bat (Bat['Bat'/820, l='ServerLevel[Test World 1.18.2]', x=-228.50, y=20.00, z=-713.50]) joined minecraft:overworld.
[26Mai2023 20:09:10.614] [Server thread/DEBUG] [APTweaks(Core)/]: [Joined] Entity minecraft:bat (Bat['Bat'/821, l='ServerLevel[Test World 1.18.2]', x=-232.50, y=20.00, z=-704.50]) joined minecraft:overworld.
[26Mai2023 20:09:13.717] [Server thread/DEBUG] [APTweaks(Core)/]: ? Removed 110 entries during the verification 

Inside the log it should be easy to see if any mobs are blocked with the exact reason.
You should be also able to see if the spawn for specific monsters was allowed or not.

There are some mods, which are not using the standard spawn events and "bypass" them, which could cause a over population because they will replace the possible spawn of "blocked" mobs and will not be limited.

With the debug.log I could check this more in detail and see if there is any difference between 1.19 and 1.20.1 which is causing this.

In 1.20.1 Minecraft itself is now using mob caps and a similar technic to blocking spawning mobs on higher loads, so if nothing is visible in the logs from the mod and you have the same issue without the mod it could be related to this new features.
See: https://bugs.mojang.com/browse/MC-249304?jql=project%20%3D%20MC%20AND%20affectedVersion%20%3D%201.20.1%20AND%20text%20~%20%22spawn%20mob%22

commented

Thank you for your answer.
I have not keept any world with low spawn. So I need to generate a new one.
Maybe, if I find some time

commented

is it fixed already i have this in 1.20.1

commented

is it fixed already i have this in 1.20.1

There is nothing which I could fix without additional details about the issue.

If you are able to reproduce the issue in 1.20.1, please follow the step from #55 (comment) and share the results with me to see what kind of fix I could provide. Thanks.

commented

I appear to be having this issue in our mod packs public server. I have disabled ALL spawn control for mobs and it's still limiting how many spawn. I attempted to find a discord link to talk further about it but I will just comment here. I will follow the directions above and submit what you asked and see if it shows anything in the logs

I will say I am almost 99% positive I have disabled EVERY config option for spawn control unless there is one I missed. I also do not have any other mods that have spawn control.

The mod pack is called Friends United 2.0 if you wish to download and see the issue for yourself I'd be happy to give creative and whatever else you needed to see the issue.

commented

I didn't include the ENTIRE Debug but here is the time from when I activated the command and flying a bit.... it's blocking EVERYTHING

https://gist.github.com/Zelioth/bbf0d3df8270c9056cc55530bb92104c

MineCraft 1.20.1
Forge 47.2.1
Public Server Environment

And like I said above I disabled all spawn control for everything in adaptive tweaks config and restarted the server so something is bypassing the config

commented

Okay so update. I disabled EVERYTHING except "View Area Optimization" in the spawn control config

I went back and disabled it and now all mobs are spawning. So why would that cause NO mobs to spawn when enabled.

commented

Thanks a lot for the feedback. This helps a lot.

The "View Area Optimization" uses the player position to limiting the spawn of mobs outside their "view area".
In your case it seems that the calculation is not correct like:
[20Oct2023 02:20:13.445] [Server thread/DEBUG] [APTweaks(Core)/]: Forced update player position for ..., l='ServerLevel[haunted world]', x=7492.68, y=63.00, z=5483.17] to PlayerPosition[..., world: 'minecraft:the_nether', x:7492, y:63, z:5483, viewDistance: 12, simulationDistance: 7, viewAreaDistance: 192}, Range{x:8030 to 8452, y:-64 to 255, z:5820 to 6243}, Meta{isOverworld: false, isNether: true, canSeeSky: false, isUnderWater: false}] in dimension minecraft:the_nether

As you could see the position was calculated on x=7492.68 but the mod thinks you are inside the position x:8030 to 8452, the same for z=5483.17 which shows up as z:5820 to 6243.

For this reason the mod thinks that the corresponding spawns are out of your view area and blocks them like:

[20Oct2023 02:20:21.538] [Server thread/DEBUG] [APTweaks(Spawn)/]: [View Area Visibility] Blocked spawn event for LavaSquid['Lava Squid'/935308, l='ServerLevel[haunted world]', x=7602.50, y=102.00, z=5455.50] with 0 entities and 0 players in minecraft:the_nether.
[20Oct2023 02:20:21.539] [Server thread/DEBUG] [APTweaks(Spawn)/]: [View Area Visibility] Blocked spawn event for LavaSquid['Lava Squid'/935309, l='ServerLevel[haunted world]', x=7602.50, y=102.00, z=5451.50] with 0 entities and 0 players in minecraft:the_nether.
[20Oct2023 02:20:21.539] [Server thread/DEBUG] [APTweaks(Spawn)/]: [View Area Visibility] Blocked spawn event for LavaSquid['Lava Squid'/935310, l='ServerLevel[haunted world]', x=7604.50, y=102.00, z=5451.50] with 0 entities and 0 players in minecraft:the_nether.
[20Oct2023 02:20:21.539] [Server thread/DEBUG] [APTweaks(Spawn)/]: [View Area Visibility] Blocked spawn event for LavaSquid['Lava Squid'/935311, l='ServerLevel[haunted world]', x=7603.50, y=102.00, z=5456.50] with 0 entities and 0 players in minecraft:the_nether.

I will try to reproduce this case to understand why the view area calculation is off in this case.

Could you let me know which game mode you used to "fly around" was is "creative", "spectator" or the normal game mode ?
Thanks.

commented

Ok I found the issue and working on a fix.

I added a feature which automatically using a larger range when a player is flying in the nether or the end.
But I made a mathematical mistake by adding the larger range to both the starting values of x and y, instead of subtracting it as intended.

This specific issue only only affects the nether and the end and not in the overworld.

commented

The fix for the the nether and the end is pushed to CurseForge and should be live in the next hours.
You only need to update the "core" module to version 10.1.0 which includes the fix.

For the issues with the overworld I still missing any valid debug logs to check in detail what is happening here.
I will let this bug open for the next days and will close it if there is no other action.

But as always feel free to open a new bug with a corresponding debug log if there is any other issue. Thanks.

commented

Hi, I'm having the same problem, although it doesn't even seem to be attempting to spawn passive mobs.

https://gist.github.com/slickritalin/3855813c93449c08dda3a9206d184d59

I've tried disabling config settings and removing the mod entirely but the spawns don't change, it's too late to restart my server from scratch without the mod so do you have any ideas on how I could reset the spawns or something?

It also seems to have no issue spawning passive mobs in water.

commented

@slickritalin
Thanks for the update, could you please enable the debug mode before providing the debug.log
See: #55 (comment)

This will also show if any mobs try to spawn and the exact reason if it was blocked from this mod. Thanks.

commented

I thought I did, I saw the mod blocking a bunch of hostile spawns in the log

nevermind you're right, it must have been overwritten or something

commented

Sorry my fault the list was truncated ^^ยฐ
Thanks. I will check the debug.log more in detail.

commented

Found something in the debug.log which I will analyze more in detail.

Player Position:
Update player position for ServerPlayer[..., x=-490.38, y=63.00, z=-1696.80] to PlayerPosition[Player{..., world: 'minecraft:overworld', x:-490, y:63, z:-1696, viewDistance: 12, simulationDistance: 10, viewAreaDistance: 192}, Range{x:-682 to -298, y:51 to 255, z:-1888 to -1504}, Meta{isOverworld: true, isNether: false, canSeeSky: true, isUnderWater: false}] in dimension minecraft:overworld

The Range for the Player Position is correct with:

  • x:-682 to -298
  • y:51 to 255
  • z:-1888 to -1504

But this should allow the spawn of:
[View Area Visibility] Blocked spawn event for Creeper['Creeper'/8454, l='ServerLevel[cumcraft]', x=-611.50, y=51.00, z=-1706.50] with 42 entities and 0 players in minecraft:overworld.

With the position x=-611.50, y=51.00, z=-1706.50.

Most of the other mobs are outside of the y:51 to 255 range and a blocked for this reason.
But it seems that mobs at exactly y=51.00 causing an issue and not are considered correctly.

Could you let me know if this is a normal world, a flat world or any other none standard world ?
Just want to see if I need to adjust the y range to consider flat world and other none standard worlds correctly.

commented

It's a standard world, it has terralith generation

commented

I don't mean to bother you, but can you think of a temporary solution that would start animals spawning again? I'm not sure why removing the mod doesn't work but I'm now getting 0 passive spawns besides flies and fish and its halting our servers progress

commented

I don't mean to bother you, but can you think of a temporary solution that would start animals spawning again? I'm not sure why removing the mod doesn't work but I'm now getting 0 passive spawns besides flies and fish and its halting our servers progress

To be clear here. The mod only blocks the spawn events itself but not modifying the world or any other world data itself.
Which mean if the mod is removed and you still not seeing anything spawning it's related to something else (maybe another mod in your mod pack) or to the general spawn limits.
See: https://minecraft.fandom.com/wiki/Spawn#Java_Edition

You could try to temporary increase the view distance which should trigger are recalculation of the spawn data or switching the difficulty between peaceful and hardcore, but this effect is not directly related to the way how this mod is working.

commented

To be clear here. The mod only blocks the spawn events itself but not modifying the world or any other world data itself. Which mean if the mod is removed and you still not seeing anything spawning it's related to something else (maybe another mod in your mod pack) or to the general spawn limits. See: https://minecraft.fandom.com/wiki/Spawn#Java_Edition

I see, thanks for the explanation. I know this is a bit of a shot in the dark but do you have any idea of what kind of mod could be stopping 99% of passive spawns?

commented

It's hard to say, could be anything which is related to the chunk loading or processing.

In general there are two types of mob spawn:

  • Natural spawns happening every x ticks which is controlled by the game rule doMobSpawning
  • Chunk related spawns which are stored in the chunk itself and in some cases are "removed" by some mods for optimization.

First of all you need to find out if natural spawns and/or chunk related spawns are affected by this like:

  • Checking with /gamerule doMobSpawning if natural spawning is enabled.
  • Teleporting to an chunk outside of the already pre-generated chunks to see if any mobs are spawning here.

Depending on the outcome there a different way to fix them.

  • If the gamerule is set to 'false' you can just change back the gamerule to 'true' and it should work as expected.
  • If the chunk related spawn is affected you should re-generate any "untouched" chunk.
commented

I changed the chunk gen modifier in citadel's config from 1x to 5x so now I get decent spawns in new chunks, nothing new seems to be spawning in pre generated chunks though, also that gamerule was set to true. How would I go about reloading the untouched chunks? I really appreciate your help, thank you.

commented

Thanks for the feedback, so it's seems that the chunk related spawns are affected in your case.

Did you use a chunk pre-genereator to generate the chunks or are they naturally generated ?

  • First create a backup of your world and only work on the backup
  • In the case you use a pre-chunk-generator check their documentation if they are offering an option to refresh / regenerate the chunks.
  • If they are naturally generated try first the Minecraft Optimize World options, if this is not working try some World Editor like MCA Selector

For most World Editor there is an option to auto select chunks which are only loaded 1 min or untouched.

No worries, it's good to explore such issues more in detail, so that I could update the documentation.

For example I need to add a warning or disable some optimization if any pre-chunk generator is detected.
This is something I know myself, but I'm sure that a lot of people are not aware that such pre-chunk generator should be only used without any optimization tool in place to make sure that they chunks are generated as expected.

Maybe I will add an additional option to allow at least one mob per chunk.

commented

They were naturally generated, I had a chunk pregenerator installed but I didn't use it.

I couldn't figure out how to use Optimize World so I used MCA Selector, and I'm now surrounded by animals, thank you so much for your help.

Changing Citadel's chunk gen modifier, killing everything in my spawn chunks and resetting the other chunks has definitely done the job.

commented

Thanks for the feedback and good to know that everything works now as expected. ๐Ÿ‘

The "Optimize World" options is available over the "Edit" function like:
image

image

If you don't use the chunk pre-genreator it should be disabled or at least you should disable it's features.
Most of these chunk pre-generator also adjusting the normal world generation with "faster" replacements but which are less accurate compared to the original generator and could cause issues.

commented

There may still be issues with passive mobs respawning in chunks, but for now I'm just happy that there are mobs at all. And thanks for the advice, I've disabled it.

commented

Ok, so I just released version 10.2.0 which should be live in the next hours / days.

This version includes some fixes and new mechanics to avoid some of the reported issues here.

  • It checks if a chunk have at least one mob (regardless of the type) and will allow the spawn if not (and inside the world/server limits) every x chunks to make sure there are no issues with chunk related mods.
  • The spawn optimization will not be active during the server start and a short time after the server is started to make sure other mods have enough time to perform their chunk and spawn related tasks.
  • The View area calculation for the player was optimized and simplified to allow edge cases with non-standard generated worlds.
  • It will show a warning message for pre-chunk generator mods to make sure users are aware to turn off any optimization mods before pre-generate chunks.
  • The FAQ and Troubleshooting guide was updated.

Because the thread is already very long I will close this issue with the latest update.

Feel free to open a new issue report with the corresponding details (debug.log) if any other similar issue came up.

commented

pretty sure "view area" im having the same problem in 1.16.5
is there a way to disable it in that version?