Questions About Serverside DH
Here is my situation: sometime soon I'll be pregenerating a 30k world on my server. I'd like to have those chunks rendered as LODS for me (I know this would have a massive filesize), but I don't know how DH's LOD generation works, as I've heard conflicting things.
Question 1: How does LOD generation happen? Like what specifies when the client renders LODS outside of what I, personally have explored? For example, in singleplayer, I notice that the game will automatically render out about 128 chunks. But it will not go further than that. No matter what I set my DH render distance to. However I notice distant LOD generation did not happen in my testing on a server- although in said server I don't have the serverside fork installed- maybe that's what the fork does? Also worth noting that the LODS did generate, I just had to visit the chunks within my "vanilla" render distance to get those LODS. But regardless of that fork, why does the LOD rendering cap at 128 chunks on singleplayer, and is the reason for it not doing that on a server because I did not have the serverside fork installed?
Question 2: What does the serverside fork do, technically? I've heard it does something along the lines of streams the LODS to the client, but I don't really know what this means. Does this mean that:
A) when a client is in the server, the server will send LOD data for all rendered chunks within their DH render distance to their client, to be stored there?
B) the server generates its own LODS, which are stored on the server itself, then streams those to the players directly?
C) something else completely?
I talked to someone here about this in the past, and it seemed like it could work like this:
1) Install server-side fork on both client and server
2) join server
3) set client DH render distance to 30k blocks
4) run 30k pregen task
5) LODS get generated for all of those chunks, so long as my client is connected
However I am unsure as recently I talked to someone else knowledgeable in minecraft's workings, and they doubted the viability of this method.
This is for a 1.18.2 Forge server. Any help is appreciated!
21 Replies
First in single-player:
Distant generation has couple working modes, the most important ones are:
- none/off (disabled),
- pre-existing only -> DH will generate LODs inside your DH RD, but only from already existing vanilla chunks, no new vanilla chunks will be created to generate LODs from
- Features -> DH will generate all the LODs up to your DH RD, if vanilla chunks are absent, DH will do a multithreaded vanilla chunks generation, create a LOD from that and throw away the vanilla chunk (not save it) to save on drive space and because the vanilla chunks is not 100% correct (for speed reasons)
- Internal Server -> Slow and mostly single threaded mode that generates 100% correct vanilla chunks and LODs up to your DH RD and saves both to drive, much slower then Features, but with C2ME you get back pretty much all of the speed
In multiplayer servers normally refuse to send you any chunks outside of the server RD. That means that Distant Generation does not work outside of the server RD (if server RD is at 32, distant gen will work up to 32 and stop)
Server side fork allowes Distant Generation to work on servers
The server generates the LODs saves them then sends them to clients. it will generate, save and save only requested LODs (either by command, player or e.g. other mod)
There are additional limits servers can set up, like maximal distance (radius from X Y Z) after which server side distant gen will stop working
If the distant generation does not work, client side DH should still generate and save lods/vanilla chunks your explored and lodaed into your vanilla RD
Q3:
1) Install server-side fork on both client and server
2) join server
3) set client DH render distance to 30k blocks
5) LODS get generated for all of those chunks, so long as my client is connected
or:
1) Install server-side fork on server
3) run 30k pregen task
5) LODS get generated for all of those chunks
Or course the client will have to have the server side support to later receive these LODs
Question 1: You did not have the latest nightly builds that contain server-sided features. I presume you downloaded this build from modrinth? This build will only render the chunks you have been in on servers and will not do anything if installed on servers.
Question 2: A and B
Question3: With the recent changes, you can directly pregen the chunks in the console without physically being in the server. All created LODs will be synchronize with all players joining with the newest nightly build.
Note: Do convert the blocks you want to generate into chunks or else you'll be generating 30k chunks radius.
Q2 -> A and B
Server will generate LODs that get sent and stored on the client + server stores the LODs too
overlooked sorry
Thanks for the info, this is really helpful. I think back when we were intially testing this (couple months ago now) we did try the serverside fork but were kind of confused on how it worked. For that test I had the server render maybe about 1k blocks or so, then had various people join (with the serverside fork installed) to see if they saw the distant LODS. I was the only one who was able to, but I think that was because I was actively in the server while it was pregenning. We thought maybe they just take a super long time to render? But we waited quite a while and they were not getting the distant LODS. Though that was quite some time ago so maybe I'd have to test again
/slowgen
World generation in general is quite slow, if you want to speed it up:
Install Noisium and Lithium, these mods can improve generation speed by a couple percent.
Make sure to remove the C2ME mod as it significantly slows down DH chunk generation by up to 35%.
Increase
CPU Load
in Distant Horizons settings for faster generation, but you will experience more lag spikes and stuttering due to heavier workload on CPU.
To see if Distant Generator
is really working or not:
1) Check CPU usage while in-game, using Aggressive
settings of CPU Load
. If CPU usage's hovering around 80-100%, the LoDs are generating in the background.
2) Go to DH settings > Advanced Options > Debug > Wireframe
, set Enable Debug Wireframe Rendering
and Show World Gen Queue
to True
.
Enabling both settings will show you the visualization of world gen tasks queued and working on the map (blue boxes for queued tasks, red boxes for working tasks)With DH 2.3+ C2ME now offers a speed boost
Make sure to test it again with the latest nightly build. Report any bugs or inconsistencies you find.
alright, I'll try and find some time to test it soon. Thanks!
I opened a world after installing the latest nightly build and this message started flashing, what does this mean?

That it'll take 7 more hours to pregen the render distance in dh's settings
I see. Is there a reason distant rendering just completely stops working when I set the DH render distance to above 256?
it doesnt even come back if I switch the render distance back. Seems to have completely broken DH although the LOD file is still increasing in size which tells me its still requesting LODS, just now refusing to render any of them
yeah for some reason setting that high render distance once completely disabled my LODS, and not just on that one specific world. They just don't render whatsoever now
Can you try with just dh installed?
restarting the game a few times seems to have fixed it. weird bug
it does seem to be working(?) although I wonder if it's supposed to be this slow
I have the cpu settings on the second highest option
/slowgen
World generation in general is quite slow, if you want to speed it up:
Install Noisium and Lithium, these mods can improve generation speed by a couple percent.
Make sure to remove the C2ME mod as it significantly slows down DH chunk generation by up to 35%.
Increase
CPU Load
in Distant Horizons settings for faster generation, but you will experience more lag spikes and stuttering due to heavier workload on CPU.
To see if Distant Generator
is really working or not:
1) Check CPU usage while in-game, using Aggressive
settings of CPU Load
. If CPU usage's hovering around 80-100%, the LoDs are generating in the background.
2) Go to DH settings > Advanced Options > Debug > Wireframe
, set Enable Debug Wireframe Rendering
and Show World Gen Queue
to True
.
Enabling both settings will show you the visualization of world gen tasks queued and working on the map (blue boxes for queued tasks, red boxes for working tasks)On the nightly build c2me will provide a speed increase
is there a c2me forge 1.18.2 version? I can't seem to find one
no idea
that may not be an option for me then