RayTrace082 / untamedwilds

GNU General Public License v3.0
14 stars 11 forks source link

[1.16.5] [1.5.7] Mobs potentially chunk loading #164

Closed Subthy closed 2 years ago

Subthy commented 2 years ago

Describe the bug If a player loads a chunk with a mob from the mod, it will be chunk loaded in a server.

Steps To Reproduce Steps to reproduce the behavior:

  1. Add mod to a server
  2. See loaded chunks when no chunk are loaded
  3. Load new chunks
  4. Go the the same spot and check the loaded chunks again.

Screenshots 2 players in the same chunk without untamed wilds in unknown

2 players loading in new chunks unknown (1)

2 players in the same chunk after loading new chunks in a server without untamed wilds mod. unknown (2)

2 players in the same chunk after loading new chunks with untamed wilds in the server. unknown (3)

This is screenshot when the server has been running for a while with people playing on and off. It dropped to 20k chunks when we reloaded the chunks, but 20k still isn't normal. unknown (4)

Version (please complete the following information):

RayTrace082 commented 2 years ago

What the fuck? That's a really nasty issue, sweet Jesus

As a request, would you mind checking if the issue persists when you set burrows = false in the Config? (instead of generating burrows, critters will just spawn in the world) I have no experience in server hosting outside of IDEA's dev environment

Subthy commented 2 years ago

I disabled burrows and the issue still persists.

Subthy commented 2 years ago

I disabled the master spawner and then loaded in new chunks without the Untamed Wilds entities, and there appears to be no chunk loading. However, when me or other player load old chunks with the Untamed Wilds entities, the chunks seem to stay loaded.

We also used the mod Crash Utilities to find all of the loaded chunks, and every chunk that was being loaded (not by a player) contained at least 1 Untamed Wilds entities. I think it's only the non-critter mobs though, as I didn't see any critters being loaded or loading the chunks.

Tylertron1998 commented 2 years ago

Is there any update on this/any ideas for a fix? (: I currently help run a large modded server and I'd rather not get rid of this - however having almost 500 chunks loaded while only a single player is online is definitely not ideal 😆

Subthy commented 2 years ago

Is there any update on this/any ideas for a fix? (: I currently help run a large modded server and I'd rather not get rid of this - however having almost 500 chunks loaded while only a single player is online is definitely not ideal 😆

I just disabled spawns, till the issue is fixed.

antibang commented 2 years ago

I experience this as well :) I had to turn off the master spawner, as there would be nearly average of 80,000+ chunks right before my server restarts (every 12 hours). There'd only be a few people online and there'd be a horrendous amount of chunks loaded for the number of people. Once the player left, the chunks continued to stay loaded. The spawn weights of the mobs are even lower than the default.

Again, I turned off the master spawner, and now chunks do not stay loaded unless someone visits chunks that already had Untamed Wilds entities. Then, they appear to stay loaded if visited.

RayTrace082 commented 2 years ago

Have been a bit absent from modding due to work, but I can give an update

This has been a complete nightmare to debug due to the nature of it being a server-side issue (which means that the smallest change needs a full reboot of both server and client instances just to test it). As it stands, I have found out that it's the act of finding/storing "Home" coordinates that causes it (which mobs do use to, given the chance, claim a sheltered spot to return there to sleep)

Removing that functionality fixes the issue, however, mobs will just fall asleep anywhere if they are outside of their active time (they did that before in the event they couldn't find a valid shelter, since shelter checks are rare and random for the sake of performance). Don't think I will get around to re-implementing that functionality, since it's very minor and I honestly have no clue about how storing a BlockPos variable could ever cause chunks to lazy-load

Will release a fix for 1.16 shortly, and test whether 1.18 suffers from the same issue

Subthy commented 2 years ago

Thank you very much. I can't imagine how much time you spent on this. I kind of feel sorry that I found that issue. Hands down you are one of the best mod developers out there, most would just say that they stopped supporting that version of the mod, but you are a real chad. <3

RayTrace082 commented 2 years ago

Awww, thank you New version has been released and should be shortly available, which SHOULD fix this issue, will close this issue in a few days if everything seems fine Keep in mind, however, I can't guarantee whether the fix applies retroactively to pre-exisiting mobs (hope it does), without altering NBT data which would delay even more this update

Subthy commented 2 years ago

Form the looks of it everything is looking good. There are no chunks being loaded. Can't really say about already loaded entities, as we got rid of them, when the issue happened. Good job

RayTrace082 commented 2 years ago

Have tested a bit, and 1.18+ versions of the mod don't seem to be affected by this issue

Closing, since it seems servers are useable again