MarkusBordihn / BOs-Adaptive-Performance-Tweaks

Adaptive Performance Tweaks is a collection of Minecraft Forge server-side Mod which automatically adjust specific settings on the server to allow a more balanced TPS/FPS.
Other
4 stars 2 forks source link

[1.18.2]doesn't spawn mobs #46

Closed lodest-game closed 1 year ago

lodest-game commented 1 year ago

Sorry,my EN is too bad,so,I'll be Detailed description,but...you know If the quantity limit is reached, Whether chunks is load or unload, the mobs will not be generated. this is server's issues. The rule does not seem to recognize the difference between a block loaded and a block unloaded, resulting in the mobs on the block being judged by the module to be on the plugin-limited generation total even after the block unloaded. I think maybe an unmount block and automatic mobs removal feature should be added?

MarkusBordihn commented 1 year ago

Thanks for the report. There is already a clean up which happen from time to time which checks for removed entities. This includes entities which are killed, discarded, unloaded_to_chunk, unloaded_with_player or changed_dimension.

See: https://github.com/MarkusBordihn/BOs-Adaptive-Performance-Tweaks/blob/4360057d3a29f8b3beaf61796a5082dcc4d8d923/core/src/main/java/de/markusbordihn/adaptiveperformancetweakscore/entity/CoreEntityManager.java#L388

I will check if I could expand this, but 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 removed by the clean-up after a chunk unload and the exact reason if any of the mobs are blocked by the mod. Thanks.

lodest-game commented 1 year ago

Now there are not enough players on my server, it seems that this bug cannot be triggered, when there are only two players, my player told me that he did not generate mobs there, but I did generate MOBS here, I cannot judge the specific situation, later when there are more than 3 players (it seems to trigger this bug easily), I will generate a new log according to what you said and then send it to you. Thank you for your reply. By the way,I was in nether,my friend was in overworld.

lodest-game commented 1 year ago

a part of debug.log debug.log picture: me: 2023 05 27 13 2940 my friend: 2023 05 27 13 2945

lodest-game commented 1 year ago

The top left map shows the difference

MarkusBordihn commented 1 year ago

Thanks a lot for the details. I was able to spot the issue in the logs and will working on a fix.

I implemented some optimization which will lower the spawn radius if you are "underground". Because the Nether is surrounded by blocks the optimization thinks you are "underground" which is not really the case and so it's over optimize stuff.

lodest-game commented 1 year ago

I would be glad to help you! Good luck!

lodest-game commented 1 year ago

I'm sorry, but the problem still hasn't been solved. Is it the mobs distribution rule problem I updated the ATPC and APTS. But things didn't get better. 2023 05 29 164345

Now,My friends and I are in the same world. 20230529165417 20230529165339

I,think,Is it the mobs distribution rule problem? All the MOBS are generated on my side, So,The other player's side will not spawn?

MarkusBordihn commented 1 year ago

Thanks for the feedback. Strange, the change has a 25% greater area (in the nether) for mobs to spawn and allow about 50% more nether mobs than before.

Could you please run the /aptweaks playerPositions command and check if the player coordinates are correct or if they are complet off from the actually player position. image

If this looks fine you can disable the view area optimization in the spawn.toml file with:

["View Area"]
    #Enable/Disable view area optimization.
    viewAreaEnabled = false

If after disabling the view area optimization and after a restart the issue still happen, I would need a new debug.log with the former steps.

lodest-game commented 1 year ago

is Coordinate error 20230529183142 this is me 20230529183426 this is my friend his coordinate display:991,3,52 but command coordinate display:2400,94,-2070

MarkusBordihn commented 1 year ago

Perfect. Thanks for the confirmation. By disabling the view area optimization in the config file it should be work until I have a fix for this.

lodest-game commented 1 year ago

Wait for your good news and Can you add a config reload directive? I have to restart the server for every tweak...

MarkusBordihn commented 1 year ago

I just released an update as 1.18.2-3.22.1 which has a forced update of the position every 15 seconds and take the position directly from server player over the server. This should also fix any issue with modified or hybrid forge servers.

If you still get a different position with this update as expected, it's unfortunately related to your server, which is not updating the player positions (maybe an other optimization mod or so).

A reload directive is unfortunately not working, because I pre-calculate a lot of data during the start. So the only save way is to restart the server to make sure all changes are considered as expected.

lodest-game commented 1 year ago

In the last 3 hours, there was a small time when No Spawned Mobs occurred, but I suspect it was due to the server performance caused by map loading, because the map seed was deleted once and there were signs of map tearing, but when I went there the second time, No Spawned Mobs are no longer happening, just more slowly. During this time, there are three players on the server, in three worlds, and most of the time Mobs are being generated. Thank you very much for your work. I will continue to give feedback if there are any corresponding questions in the future.

MarkusBordihn commented 1 year ago

Thanks. Will close the issue, fell free to open a new issue report if you get the same or similar issues.