From db4f2baafc2f814d1a1931dc987f8f66973773b7 Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 2 Jul 2022 00:21:47 +0200 Subject: [PATCH] Tweak tsm_railcorridors for faster mapgen This just does 5 instead of 10 attempts to spawn a corridor in a chunk. There still appear to be plenty corridors and it makes mapgen noticeably faster. --- mods/MAPGEN/tsm_railcorridors/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/MAPGEN/tsm_railcorridors/init.lua b/mods/MAPGEN/tsm_railcorridors/init.lua index 451406167..75abe5c28 100644 --- a/mods/MAPGEN/tsm_railcorridors/init.lua +++ b/mods/MAPGEN/tsm_railcorridors/init.lua @@ -1102,7 +1102,9 @@ mcl_mapgen_core.register_generator("railcorridors", nil, function(minp, maxp, bl local buffer = 5 -- Do up to 10 tries to start a corridor system - for t=1,10 do + -- 5 Still seems to generate a lot of them and + -- makes this noticeably faster. + for t=1,5 do -- Get semi-random height in mapchunk local y = pr:next(minp.y + buffer, maxp.y - buffer) y = math.floor(math.max(height_min + buffer, math.min(height_max - buffer, y)))