TheOriginalGolem / Hbm-s-Nuclear-Tech-GIT

My fork of the HBM's nuclear tech mod.
GNU General Public License v3.0
32 stars 17 forks source link

Multiplayer server worldgen lag #90

Open Valdonix2 opened 1 year ago

Valdonix2 commented 1 year ago

while generating a chunk, some feature (structure, etc) is too big to fit in that one chunk and needs to generate an adjacent chunk early to finish the structure and this causes server lag that leads to crashes

CapitalismWouldveWorked commented 1 year ago

I would also like to add these structures generate in modded dimensions like the twilight forest

Vetpetmon commented 1 year ago

(I will use Dedicated Server language as even in single player, Minecraft is still split into client-side and server-side. A dedicated server is just the server-side, without rendering. In singleplayer, you are running the server and client (rendering) at the same time, so expect worse performance.) This is going to happen in any kind of structure generation mod: the mod is going to have to request the engine to load chunks that haven't been loaded in already. This is part of cascading world generation lag, and you can reduce it by lowering spawn chances of structures in this mod. Another way to fix it is the upgrade the CPU on/for your server, or use Linux OS for a server instead of Windows OS to reduce overhead and reserve more resources for Minecraft's Server jar.

Your server is not crashing, you are just timing out or it is stalling. Usually caused by an infinite for loop, or just a lot of code trying to run at once, if you're on a good system. Stalling is a lot more common on older CPU models. Timing out happens because of a network not sensing that the server is receiving an isAlive packet soon enough, so it terminates your connection. Again, this is not a crash. If you are receiving a "crash" with a return to desktop and a crashlog, then that is an actual crash. Otherwise, the server/world not responding is just a stall. Use Sampler to detect a stall, as it will output a stall log with a stacktrace.

The easiest way to fix timing out would be to put this in your JVM args on the server (and to be safe, the client): -Dfml.readTimeout=16048 This ensures that the isAlive packet wait limit is longer and doesn't boot you out too quickly.

Generating structures outside of the Overworld is definitely a bug. That should be made into its own Issue, however.

TheOriginalGolem commented 1 year ago

I plan to rewrite the structure spawning system, as right now, it equates to basically using alot of /setblock commands to spawn structures, I'll be moving it to structure files instead.

Valdonix2 commented 1 year ago

Epic also cool that the owner actually responed

On Sat, Mar 11, 2023, 17:50 Golem @.***> wrote:

I plan to rewrite the structure spawning system, as right now, it equates to basically using alot of /setblock commands to spawn structures, I'll be moving it to structure files instead.

— Reply to this email directly, view it on GitHub https://github.com/TheOriginalGolem/Hbm-s-Nuclear-Tech-GIT/issues/90#issuecomment-1464940127, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5KQQ2CGW5YSR7RPWPOEOLTW3SNN7ANCNFSM6AAAAAAUR7DYPY . You are receiving this because you authored the thread.Message ID: @.***>