Supplementaries

Supplementaries

114M Downloads

[๐Ÿž]: Spawnradius Gamerule Causes Exponentially Long World Load Times

dandy-is-lion opened this issue ยท 10 comments

commented

Before Continuing:

  • Check you are using the latest version of the mods and its dependencies
  • Always include a latest.log if you are crashing
  • Remove mod that enhances Minecraft: Optifine, Sodium, others. The issue persists.
  • If you are unsure which mod is the culprit.
    Disable all of your mods and enable them 1-2 mods each time to isolate the culprit
  • Confirm that there is no existing issue with a similar description submitted in the list of issues.

Version

1.20.1-FORGE

Supplementaries Version

supplementaries-1.20-3.1.11

Moonlight Lib Version

moonlight-1.20-2.13.44

Describe Issue

I believe I narrowed down the issue I had earlier with long world load times. The higher the spawnradius gamemode is set at, the longer it takes to load into a world. I started with the default and ramped it up to my survival world's value of 50000 I was having issues with on the latest Supplementaries: 10, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950, 999, 1000, 1500, 2000, 50000. Loading times were getting longer and longer until eventually I gave up waiting as I was already at 50 minutes of waiting to load on this minimal instance. Notice the time gap when Changing view distance to 16, from 10 appears, and when I killed the instance in this log:
Latest Supplementaries Log: https://mclo.gs/ia0qoaD

Note that as I was ramping up the spawnradius, I was staying at the exact same spot in the world. Only the radius was being changed

Here on 2.8.17 and on a Vanilla instance with 50000 spawnradius set I load into the world almost instantly:
2.8.17 Supplementaries Log: https://mclo.gs/eyVehjz
Vanilla Instance Log: https://mclo.gs/AvIvyiE

It's not a big deal as I was setting a high spawnradius for a hardcore random spawn location. Was a more elegant solution than using a datapack that accomplished the same thing but in an ugly uncustomizable way. I'm just curious of what changed between version 2 and 3 of Supplementaries that causes load times to shoot up exponentially relative to the spawnradius (I tested every version above 2 and got the same issue).

Steps to reproduce:

  • Generate a world with the gamerule spawnradius set to a high number (like 50000) or load into a default world and set the gamerule to that after it generated
  • Log out and log back in
  • Enjoy this screen forever:

2024-12-29-045835_2560x1386_scrot

commented

Mind getting a spark report? One that starts when server is loading. Idk how to do that tbh but I know it's possible as I was sent those

commented

Sure. I'll see if I can get one with the default spawnradius and with a higher one that has a noticeable load time difference (that is hopefully less than 50 minutes).

commented

Here you go: https://spark.lucko.me/tg4Fg9jbRa

I started the profiler when I loaded into a normal world with default gamerules. Then set the spawnradius to 1000, logged back in and out. And one more time setting it to 5000. 1000 taking about 12 seconds to load, 5000 taking about 5 minutes. I stopped the profiler when I loaded in. Here's the log of that session: https://mclo.gs/ms8wojc

The java process doesn't appear to be doing anything while it's loading in. Almost like it's sleeping on the thread exponentially proportional to the spawnradius

commented

Spark: https://spark.lucko.me/B8zZHQaqbQ
Ran another profiler with 5000 spawnradius which took about 5 minutes again, except I left it running for longer in case the profiler missed something, and I removed the configs for both Supplementaries and Moonlight to let them regenerate with defaults. When I did finally log in, the world was taking a long time to load new chunks and I had trouble getting the profiler to stop. It appears to have caught the long load time as MSPT was 291000 (about 5 minutes). I'm aware that spark can cause high server load, and it was timing out a lot in the log: https://mclo.gs/llJ2T4W

commented

Tested again with 5000 spawnradius, but without spark running, and had the same issue of it taking 5 minutes to load in and new chunks taking a very long time to generate. The log for that: https://mclo.gs/GT0RiQh

commented

i know whats causing this. quite peculiar as this particular use case proved to be quite effective at finding a quite hart to catch issue

commented

use new moonlight lib soon

commented
commented

some fake level object generating more fake chunks than it needed to be. normally not an issue as for its use case at most 1 would be used. however its initialization would not as it would create all the ones that are requested by the spawn radius which is done on object creation.
Can you verify this version works for you?

commented

The latest MoonlightLib (2.13.45) appears to have partially resolved the issue. The load times are significantly faster, though they're not near-instantaneous like before. When initially generating a new world with spawnradius 50000, which is the worst case for me, I spawned in a void world with a huge TPS lag spike. After a minute or two however, the world loaded in like normal, and chunks were generating like normal, so that problem is partially fixed. Logging out and back in again still took a long time, about 2 minutes, but that's much faster than the hours or so I would've waited before with this large of a spawnradius. However, this used to be near-instantaneous as well

The TPS lag spike upon world load after gen with 50000 spawnradius, initially I spawned in with nothing around me:
2024-12-30_19 16 19

Log of me creating a world and then logging out and back in again: https://mclo.gs/7huh9MM