Skip to content
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

Please fix the INFINITE loading of chunks! #53

Open
PaBox opened this issue Feb 23, 2022 · 12 comments
Open

Please fix the INFINITE loading of chunks! #53

PaBox opened this issue Feb 23, 2022 · 12 comments

Comments

@PaBox
Copy link

PaBox commented Feb 23, 2022

I found an article on a paperMC thread:
`The issue looks to be the plugin WorldSchematics. From looking at your 2nd pastebin stack, this plugin is messing with BlockPopulators.

1.13 pretty much broke BlockPopulators in that trying to place a block at the edge of the chunk involved causes it's neighbor chunk to load. 1.14 compounds this behavior by going full async on chunk load/gen in vanilla.

In a nutshell, WorldSchematics is placing blocks in chunks that are loading/generating. This causes those neighbor chunks to load as well. Which since this plugin seems to be using custom generation blockpopulators has to populate those newly loaded chunks. But doing so causes those neighbors to load. Then those, too, have to be populated which causes even more chunk loads. Its a viscous cycle that started back in 1.13 for a few plugins but is now hurting every single world generation plugin that uses BlockPopulators.

Ultimately, what this all boils down to is the developer of that plugin needs to find a better way to populate chunks to not trigger infinite loads on 1.14`

Seems like using the current method may cause some issues. Using PlotSquared with this plugin is therefore impossible at the moment, as the queue will just get longer infinitly until the server crashes... Found at: PaperMC/Paper#2244

@bergerkiller
Copy link
Member

I think this is the wrong project for this issue ticket?

@PaBox
Copy link
Author

PaBox commented Feb 23, 2022

No - the topic may be the same. It is about the problem with world generation, which is causing an infinite loop of loaded chunks for further updated lighting. Even when using /cleanlight 5 the queue will be at 40000 chunks after half an hour. We have a bot atm garbage collecting but thats no solution to the problem... I thought the above error would maybe contribute to the source of this problem. I am looking at the code at the moment.

@bergerkiller
Copy link
Member

bergerkiller commented Feb 23, 2022

Disable the light cleaning on chunkgen. It doesnt work as of 1.14 because the server generates too large amount of chunks around chunks loaded using chunk load tickets. There is also absolutely no point to enabling that feature on 1.14 because light glitches in chunk gen were also fixed around that version.

I have no plan to fix this.
ScreenShot 2022-02-23 04 32 33

its in the notes on the spigot page:

@bergerkiller
Copy link
Member

And if its causing runaway chunk generation with that feature turned off, then this isnt a lightcleaner issue ticket at all, but something the chunk generator plugin or whatever should fix, instead.

@PaBox
Copy link
Author

PaBox commented Feb 23, 2022

There is a point with custom world generators. So you think this isnt your problem, but rather that from multiverse, or plotsquared or what....You plugin is not needed in the normal Version of minecraft, there is fixlight by paper, fawe etc. It is only needed, BECAUSE of the custom world generator. So you want your plugin to become obsolete in the future? And why is it that the plugin cant check if a chunk is a non-loaded chunk? The position shouldnt matter...

PlotSquared is stating to turn the mentioned setting ON - and the generator is coming from their end. Should I write a ticket at their plugin? I dont see how this is the Problem of Plotsquared as this is also not working in my vanilla world on the same server...

@bergerkiller
Copy link
Member

I was not aware that custom chunk generator plugins still caused lighting glitches on chunkgen, so thats disappointing. I guess that feature will have to be fixed then, I guess.

You plugin is not needed in the normal Version of minecraft
people use it for FAWE.

there is fixlight by paper, fawe etc
Who have had various problems over the years while light cleaner carried on.

And why is it that the plugin cant check if a chunk is a non-loaded chunk?
It does.

@bergerkiller
Copy link
Member

bergerkiller commented Feb 23, 2022

Before you start throwing so many assumptions this way, Id like you to re-read the quoted part I posted earlier.

The server generates 25x25 chunks when a single chunk has a 'keep this chunk loaded' ticket created. Light cleaner gets a load ticket, operates on the chunk, and releases a ticket. This prompts the server to generate 25x25 more, neighbours fire population events, and so even more chunks are queued up into lightcleaner.

Lightcleaner does do a check to see if a 2-wide radius around chunks are already generated. Later on the server broke even that by generating 3 chunks away. I stopped trying to work with this horrible system and now tell people to turn that autofixing on chunkgen off.

@bergerkiller
Copy link
Member

bergerkiller commented Feb 23, 2022

Fundamentally here the problem is that it isnt possible to create a chunk load ticket and not generate the chunks around it. It isnt safe to apply lighting on chunks without a ticket keeping them loaded due to the asynchronous nature of the lighting engine.

@PaBox
Copy link
Author

PaBox commented Feb 23, 2022

Ok - so how is this solvable? If there is the possibility to check like you have been doing it, why not add an option to increase the range by yourself? Or did it hurt performance... I dont get why this big use case should be wasted, as FAWE has its own, working lighting system - even if it might not be as performant, it is at least working. This is not a state in which somebody with PlotSquared can use this plugin sadly, though I still contacted the authors. Hopefully this can get fixed at some end, maybe they will implement their own system. Who knows. It is only needed when the chunk is generated the first time, so maybe it is possible to make a function for that?

@bergerkiller
Copy link
Member

bergerkiller commented Feb 23, 2022

Several problems:

  • Performance is indeed impacted polling 24 chunks (or even more!) for every chunk to see if it exists on disk
  • It results in the edge of the world to have lighting glitches, something that players can see in the distance
  • Due to how populators work, it is very unpredictable when a runaway generation happens or not. In vanilla minecraft a good example is the mansion.
  • A good solution requires tracking what chunks have enough chunks around it populated/generated. This is doable when all you have to check is neighbouring chunks, like pre-1.14, but after 1.14 this becomes computationally expensive and you need to start tracking that in separate databases.

@bergerkiller
Copy link
Member

I was personally hoping to close this fix-on-gen chapter after 1.14 and leave light cleaner more as a relic for pre-1.14 and for worldwide operations. It would be better if PlotSquared worked with paper devs on a solution.

@PaBox
Copy link
Author

PaBox commented Feb 23, 2022

Thank you for the detailed explanation. It seems to be fixed by the means of PlotSquared-Developers - but the fix is not working with 1.16.5 as the newest versions only support Java 17 by now. Still seems like this isn't your Problem anymore and I thank you for your time - I might just have to update to newer Minecraft versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants