Mods / PreGen Chunk
- Tags:
- Author:
- Alekaei
- Side:
- Both
- Created:
- 4 days ago
- Last modified:
- 2 days ago
- Downloads:
- 92
-
Recommended download (for Vintage Story 1.22.0 - 1.22.7):
pregenchunk_1.1.0.zip 1-click install
Disclaimer: This mod was made with the help of AI.
PreGen Chunk
Pre-generate your world before players explore it. PreGen Chunk generates chunk columns on the server outward from spawn (or any point you choose), as a circle or a square. Version 1.1.0 is several times faster than vanilla /wgen pregen: about 4× on default settings and about 9× with extra worldgen threads on my test machine (see Benchmark for what that means on your hardware). It tunes itself, resumes after restarts, tells you how long an area will take before you start, and backs off when the server is under load.
Works on dedicated servers and singleplayer. Clients do not need the mod.
🆕 New in 1.1.0
- Stays fast however big the area. 1.0.0 got slower the further out it went. 1.1.0 keeps the same speed as the area grows, so big areas finish in a fraction of the time: an area that took 1.0.0 over an hour and a half now takes 18 minutes.
- New band-based generation. Instead of one spiral, the area is generated in rings, one after another. This keeps the unfinished edge of the area small, so the game isn't stuck juggling an ever-growing ring of half-generated terrain. That's what lets it keep its speed on big areas.
- Uses extra worldgen threads. More worldgen threads now make it about twice as fast. 1.0.0 couldn't use them.
- Self-tuning. It now works out the best settings for your machine while it runs, and eases off if the server starts to lag. Nothing to configure.
- No more stalls after autosaves. 1.0.0 stopped for 2 minutes after every autosave. 1.1.0 carries straight on.
- New:
/pregen estimate. Tells you how long an area will take and how much disk space it needs, before you start. It knows what's already generated in your world and learns from your own past runs. - Much faster re-runs. Going over an area that's already generated takes seconds instead of minutes.
- Map reveal is 4–7× faster (singleplayer). About 4× faster than 1.0.0 on default settings and 7× with extra worldgen threads: revealing an area that took 1.0.0 over 7 minutes now takes about a minute. You can also move around freely while it runs.
- Smoother server. Fewer and shorter lag spikes than 1.0.0, especially on big areas.
- Progress you can follow.
/pregen statusshows how far out the area is fully generated, and/pregen updatessets how often progress is posted to your chat.
🎞️ See it: 1.0.0 vs 1.1.0 side by side

1.0.0 (left) vs 1.1.0 (right) generating the same radius 2,500 circle on default settings (1 worldgen thread), at the speeds measured in the benchmark. 1.1.0 finishes in about 7 minutes; 1.0.0 takes over 17, partly because it stops for 2 minutes after every autosave.
✨ Features
Fast
Keeps the world generator busy at all times instead of feeding it in batches, and uses extra worldgen threads when you have them.
Built for big areas
Generates in rings around the centre, keeping the unfinished edge small, so it stays just as fast however big the area gets.
Self-tuning
Adjusts how much it generates at once while it runs: it pushes harder while that makes things faster, and eases off if the server starts to lag. No settings to tune.
Time and size estimates/pregen estimate gives a time range and disk size for an area, taking into account what already exists in your world and how fast your machine has been.
Resumable
Progress is saved with the world every 30 seconds. After a restart or crash the job picks up where it left off.
Skips existing terrain
Before generating, it checks which columns already exist and skips them, so re-running over an area or growing a finished one is quick.
Server friendly
Holds back new work when ticks run long, recovers from autosaves straight away, and can pause automatically while players are online.
Circle or square
A circle takes about a fifth less time and disk space than the matching square.
Map reveal (singleplayer)
The reveal option also draws the generated area onto your world map. You can keep playing and moving around while it runs.
🚀 Quick start
- Install the mod on the server (or in singleplayer).
- See how long an area would take:
/pregen estimate 3000 - Start it:
/pregen start 3000 - Check progress:
/pregen status - For bigger areas, consider 4 worldgen threads (see Going faster below).
⌨️ Commands
All commands need the controlserver privilege. They work from chat or the server console.
Options
- reveal: singleplayer only. Also draws the area on your world map. On new terrain it takes about 1.5× as long as a normal run. Over terrain that already exists it still has to send every column to your client to draw, so it takes a few minutes for a big area, where a normal run would skip it in seconds. You can move around freely while it runs.
- noskip: loads every column again, including ones that already exist. Use it to repair an area. It is much heavier on the server than a normal run, so run it while the server is quiet.
- maxwidth=N: the widest a generation band may get, in chunks (8–256, default 64). You won't normally need it.
Examples: /pregen estimate 4000 · /pregen start 4000 · /pregen start 4000 square 100 -200 · /pregen start 2000 reveal
⚠️ Before you start
Big radii take a long time and make large saves. Column count grows with the square of the radius. In the benchmark world each column took about 37 KB on disk.
Times are from the benchmark machine. Sizes and times depend on your hardware, terrain, world settings and other mods; /pregen estimate gives numbers for your own setup. Always back up your world first.
⚙️ Configuration
File: ModConfig/pregenchunk.json (created on first launch). Restart the server or world after editing.
Upgrading from 1.0.0: updating the mod does not change values in an existing config file. Your config still has "MaxInFlight": 16; set it to 0 to use auto, or most of the speed-up and the extra worldgen threads go unused. RevealMaxInFlight and FastSkipExisting are no longer used and can be removed. A job saved by 1.0.0 resumes where it left off, using the old order; new jobs use the new circular order.
📊 Benchmark: 1.1.0 vs 1.0.0 vs vanilla /wgen pregen
What the "× faster than vanilla" numbers mean
Vanilla /wgen pregen ran at about 10 columns per second on my machine, and more worldgen threads did not make it any faster. PreGen Chunk keeps the generator busy and uses extra threads, so how far ahead of vanilla it gets depends on your CPU. "4.4× faster than vanilla" means 4.4× faster on this hardware; on a faster or slower CPU, or with more or fewer worldgen threads, your multiple can be higher or lower. The comparisons between 1.0.0 and 1.1.0 hold up better, since both work the same way on the same machine.
Hardware
- Intel Core i5-14400, limited to its 6 performance cores (12 threads). E-cores were not used.
- 6 GB RAM limit
- Linux Docker container running a VS 1.22.7 (stable) dedicated server
Test setup
- Fresh world for every run: same fixed seed, default world settings, no other mods, no players online
- Server restarted between runs; the game's normal 5-minute autosave left on
- Each version on its own defaults: 1.0.0 with MaxInFlight 16, 1.1.0 with MaxInFlight auto
- Most results are averages of 2–3 runs; vanilla, rescans and 1.0.0 at radius 5,000 ran once
- Over 190 benchmark runs were done while developing 1.1.0 to choose the generation order, band widths and defaults
Default setup: 1 worldgen thread, square area
4 worldgen threads (vanilla doesn't get faster with more threads, so its 1-thread speed is the comparison)
Long distances
- 1.1.0 holds the same speed from radius 1,000 to 5,000: 88–92 col/s on 4 threads, 42–44 on 1 thread. The bigger the area, the bigger its lead over 1.0.0 (3.1× at radius 1,000, 5.4× at radius 5,000).
- 1.0.0 gets slower the bigger the area: on 1 thread it went from 34 to 20 col/s between radius 1,000 and 2,500, and on 4 threads from 28 to 17 col/s by radius 5,000.
- 1.0.0 also stalls after autosaves. On 1 thread every autosave stopped it for exactly 2 minutes (its retry timeout), about 40% of its time. On 4 threads it slowed to about a quarter of its speed for 2 minutes at most autosaves once past ~15,000 columns. 1.1.0 recovers from an autosave in about a second.
Re-running over an already generated area (25,281 columns, radius 2,500 square)
Singleplayer: normal vs map reveal (radius 1,000 circle, 3,209 columns, on my PC, so the speeds differ from the server above)
- 1.0.0's reveal was stuck at about 7 col/s no matter how many threads, because it only sent 2 map pieces to the client at a time. 1.1.0 keeps up to 32 waiting and gets faster with more threads.
- These small areas are too short for 1.0.0's slowdown and autosave stalls to show, which is why the normal-run gap is smaller here than in the server benchmark.
- Revealing an already generated radius 2,500 circle (19,577 columns) took 4 min 7 s on 1.1.0, about 79 col/s.
Estimate accuracy
- On a fresh singleplayer world with no past runs,
/pregen estimate 2500said 2 min 42 s to 4 min 30 s (middle 3 min 36 s). The real run took 3 min 30 s.
Server load while generating
- Server TPS averaged about 26–28 for every version, the same as vanilla.
- At radius 2,500, 1.1.0's slowest tick was 0.4–0.5 s and its lowest TPS about 22–23. 1.0.0 had ticks of 0.85–0.95 s and dipped to about 12–13 TPS. Vanilla was 0.35 s and about 20–23 TPS.
- At radius 5,000, 1.0.0 got much rougher: TPS dipped to 3.5 and one tick took 1.8 s. 1.1.0 stayed above 9 TPS with its slowest tick at 0.5–0.8 s.
- 1.1.0 does more work per tick: on 4 threads its slowest 5% of ticks took 12–15 ms, against 7–9 ms for 1.0.0.
- Memory: about 1.5–1.7 GB peak at radius 2,500 and about 2.1 GB at radius 5,000, against about 1.3 GB for vanilla.
- noskip on 4 threads is the heaviest case for 1.1.0: TPS averaged about 19 and dipped to about 10.
🧵 Going faster: worldgen threads (advanced)
How to change it
- Edit
servermagicnumbers.jsonin your data folder and set"MaxWorldgenThreads"(default 1; I found worse results with 2 than with 1, so I'd recommend going to 4 if you change it). Restart the server or game afterwards.- Dedicated server: the server's data folder (or the
--dataPathfolder) - Singleplayer: this works too, because the built-in server reads the same file from
%APPDATA%\VintagestoryData(Windows) or~/.config/VintagestoryData(Linux). It applies to all your singleplayer worlds.
- Dedicated server: the server's data folder (or the
- With
MaxInFlighton auto (0, the default) the mod picks up the extra threads by itself. If you use a fixed value, raise it to 128 or more, or the extra threads go unused. - In the benchmark, 4 threads about doubled the speed. 6 threads added almost nothing on top.
- Suggested: 4 threads with MaxInFlight on auto.
Risks / warnings
- Change this at your own risk, it may make your server/game unstable.
- Back up your world before changing it. If you see holes or worldgen errors, set it back to 1.
- More threads use more CPU. Don't set it higher than your physical core count, and expect less headroom for players while generating.
❓ FAQ
Do players need to install it?
No. It runs on the server. The client part is only used for reveal in singleplayer.
Can I add it to an existing world?
Yes. Existing terrain is skipped and only missing columns are generated. Back up first.
How long will my radius take?
Run /pregen estimate <radius>. It works straight away from built-in defaults and gets more accurate after you've run a job or two on your own machine. /pregen status also shows the time remaining while a job runs.
Can players stay online while it runs?
Yes. It holds back when the server lags. If you'd rather it only ran while the server is empty, set PauseWhenPlayersOnline to true.
The server restarted mid-job. Do I need to start again?
No. The job resumes on its own. Use /pregen stop if you want to cancel it.
I'm upgrading with a job from 1.0.0 still running. What happens?
It resumes where it left off, using the 1.0.0 order. New jobs use the new circular order.
Does it work with worldgen mods?
It uses the game's normal chunk generation, so worldgen mods (landforms, structures, ruins) apply as usual. Expect slower generation and larger saves with heavier worldgen mods.
Can I move around during a reveal?
Yes. Columns that are still being drawn are kept on your client until their map piece is done.
What does "map not drawn" mean in the status?
With reveal, some map pieces could not be drawn even after retries. The terrain itself is generated and saved; those map tiles will appear normally when you get near them. "failed" is different: it counts columns that could not be generated.
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.1.0 | pregenchunk | 67 | 2 days ago | pregenchunk_1.1.0.zip | 1-click install | ||
PreGen Chunk 1.1.0New
Improved
Fixed
Removed / changed
Upgrading from 1.0.0: existing configs keep | |||||||
| 1.0.0 | pregenchunk | 25 | 4 days ago | Empty | pregenchunk_1.0.0.zip | 1-click install | |

1.1.0 is out! Here's 1.0.0 (left) vs 1.1.0 (right) generating the same radius 2500 circle on default settings:
Quick numbers from the benchmarks:
I recommend deleting any existing config to get a fresh one.
Full details and benchmarks are in the description.
I'm a bit confused - how exactly does this differ or what is the benefit from this mod, when we already have the /wgen pregen command? Except for the shapes and maybe the stop/start feature.
Not trying ot be rude or something, I'm honestly just a bit confused :D
I can answer that.... /wgen pregen seems to have a memory size limit, it will crash your game or run you out of memory if over 64 chunks.
AND it is very very deathly slow with high numbers. I once ran it with 47 chunks and it took almost an hour. Been using this version and it did a 320 chunk map in an hour.
that's a 3.4gb save file and a 1.3gb map file in one hour.
Ill be honest I wasn't aware of that command, but ive ran some benchmarks and added the results to the description, unlike Ensorcelled I didnt see any issues with memory limit, in fact with pregen memory hasnt really been the limit in all my benchmarks it was always around 1.2-1.6GB of RAM being used, the biggest limiter is cpu, and at default setting it only uses 1 thread for world generation so single core performance is the most important thing, however even with that, it seems that /wgen pregen is limited to 10 columns a second (column here being 1 vertical set of chunks), and giving the server more threads to generate terrain on made no difference, in contrast at the default settings for the mod and with 1 thread I was seeing around 34 columns a second, and if I increased the threads and max in flight it got up to 93 columns a second so its markedly faster, there is also the benefit of being able to start/stop it and auto resuming, as well as generating in a circle which makes more sense in my opinion.
I can say that, thanks to this mod and these posts, I found some unhappy news about my system and had to correct it. The memory issues were with one of my four sticks and timing not being to spec. Memtest86 showed me clearly. So I had to spec down and now things work. LOL
Havent tried it on anything that large, you might want to edit the config and increase the max in flight to something higher, like 64 or 128, would use more memory and probably drop the tps quite a bit but it depends a on your hardware as well
separate issue, while it does make the map file, 1.3gb for a 3.4 save... my character only sees my 448 visual distance on the map page. I will fly around and see what happens next, because the data is obviously there.... might be ghostchunks or some other mod wonkiness...
I havent tested it too much in single player as I was mainly interested in this for my server, so ill need to mess around with it a bit more but can you explain a bit more what you mean here? If by map page you mean the in game map, then yeah unless you run the it with the reveal option, it doesnt render to the ingame map and turning on reveal slows it down, again single player wasnt really my focus so i didnt spend too much time at it, but I see you also mentioned ghostchunks so if you mean that you arent seeing the generated terrain in the distance with ghost chunks then that would be strange, from the few single player tests I did I was definetly seeing it with ghost chunks, in my case it helped turning off estimated terrain in ghost chunks so I was only seeing actual generated chunks.
ok, what i mean was even with reveal option and generating save and map files, my character didn't see any changes to the overhead map, the already found 448 area was all that shows up, even though it was being updated as a file... I even logged out and came back in, no change. It's almost like it was not seeing it as "my character's data"?
As for Ghost Chunks, that is a far distance viewer to simulate distant terrain when you limit view range on server, so it"appears" like your view distance is futher... but that removed, had same issues with fresh world ... Will keep testing later next week.
Thanks, I'm hoping this works well. Been stuck /TP every 1500/3000 pattern to pregen map, I'm not concerned about size or memory constraints, will test a 10,240 radius and let you know how it went.
Ok, yeah, needed some adjusting, but we are all good. Just doing the Save file took a bit over an hour for square 10240 blocks. That was 102041 columns.
It did something wonky (nothing generated after 16k columns for 5 minutes in a row before I paused it) with default settings, BUT pause, save, quit, restart, resume fixed it. Not sure if it was me or the mod, assuming me, because after that it was fine.
Also with defaults, if you generate player map using reveal, it starts failing one clolumn every row at 2.6% then 2 at 4.1%, and one more each 2% or so up to 12 per column of 19-ish... I just turned that off since I just needed 10k around start to be generated, not mapped.
/EDIT I have 32TB M.2s and 256gb memory on Bazzite, so that will never be an issue, now to test 100k LOL