Minecraft: Java Edition has made multiple changes to rendering, lighting, world generation, world height (ever since 1.18), and much more over the years. However, chunk generation is very inefficient ever since 1.14, causing lag spikes, slow generation, and server-side lag, even on good hardware. This can easily be optimized. One reason is Minecraft's world generation has become considerably more complex due to major changes in how chunks are built in 1.14 and newer. Modern terrain generation uses many different calculations, such as choosing the biome, adding terrain, structures, features, and lighting, along with lots of other stuff. These improvements have made chunk generation much more refined, but they increase the amount of work Minecraft has to do during world generation. Another big consideration is that, even though chunk building is mostly multithreaded, part of it still runs on the main thread, which is the same thread mob AI, block updates, and everything else runs on. This causes TPS spikes due to the thread being maxed out.
An way to fix these lag spikes is by optimizing how chunks are generated. This includes, but isn't limited to,
- Reducing unnecessary synchronization between generation tasks.
- Optimizing noise and terrain calculations.
- Improving caching of reusable data.
- Reducing unneded work when chunks are generated outside the player's view.
- Profiling chunk generation to identify bottlenecks.
Further optimization can make exploration very smooth.
0 Comments
Please sign in to leave a comment.
Post a new comment: