No deep ore in rock hot enough to light or melt it; reloaded worlds settle again (t3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 18:25:13 -04:00
co-authored by Claude Opus 5.5
parent 28893c93bc
commit c302b0cf42
5 changed files with 34 additions and 3 deletions
+12 -2
View File
@@ -170,11 +170,12 @@ const oldOre = [33493, 26508, 77679, 11797, 7723, 3638, 1681];
const oreNames = ['coal', 'copper', 'iron', 'zinc', 'tin', 'silver', 'gold'];
oreNames.forEach((name, j) => {
const ratio = oreBalance.counts[j] / oldOre[j];
const lo = j < 2 ? 4.5 : j < 5 ? 4 : 3, hi = j < 2 ? 5.5 : j < 5 ? 5 : 4;
// coal is lower than the rest: seams deep enough to light in the natural heat are left out
const lo = j === 0 ? 3 : j < 5 ? 4 : 2.5, hi = j === 0 ? 4 : j < 5 ? 5 : 3.5;
check(`${name} stays within its intended increase`, ratio >= lo && ratio <= hi, ratio.toFixed(2));
});
const totalOre = oreBalance.counts.reduce((a, b) => a + b, 0);
check('total ore is about 4.5 to 5 times the original', totalOre >= 162519 * 4.5 && totalOre <= 162519 * 5, totalOre);
check('total ore is about 4 to 4.5 times the original', totalOre >= 162519 * 4 && totalOre <= 162519 * 4.5, totalOre);
check('shallow ore matches the original generator', oreBalance.shallowHash === 706875613, oreBalance.shallowHash);
run('generateWorld(99, 4096, 1536, null)');
const marks = run('(()=>{let lakes=0,peaks=0,inLake=false;for(let x=1;x<W-1;x++){const l=mat[(surfY[x]-1)*W+x]===WATER;if(l&&!inLake)lakes++;inLake=l;if(surfY[x]<surfBase-100&&surfY[x]<=surfY[x-1]&&surfY[x]<surfY[x+1])peaks++;}return [lakes,peaks]})()');
@@ -258,4 +259,13 @@ const pour = (bx) => {
};
const [withBot, aboveBot] = pour(118), [without] = pour(200);
check('sand poured onto the bot falls through it to the ground', withBot === without && aboveBot === 0, `${withBot} grains landed (${without} with the bot away), ${aboveBot} held up above it`);
// deep ore never sits in rock hot enough to light or melt it: a reloaded world wakes every area,
// and burning coal or running gold down there kept thousands of areas busy forever
run('generateWorld(77, 2048, 1024, null)');
const hotOre = run('(() => { let n = 0; for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) { const m = mat[y * W + x]; if ([COALV, CUV, FEV, SNV, ZNV, AGV, AUV].includes(m) && (IGN[m] ? AMB[y] > IGN[m] - 120 : AMB[y] > MELT[m] - 200)) n++; } return n; })()');
check('no ore is generated where the rock is hot enough to light or melt it', hotOre <= 20, hotOre);
run('globalThis.__s = serializeWorld(); deserializeWorld(JSON.parse(JSON.stringify(__s.meta)), __s.buffers); for (let k = 0; k < 900; k++) simTick();');
const busy = run('(() => { let aw = 0, fl = 0; for (let c = 0; c < NCH; c++) if (awake[c]) aw++; for (let i = 0; i < N; i++) if (mat[i] === FLAME) fl++; return [aw, NCH, fl]; })()');
check('a reloaded world settles: no fires deep down, few areas still moving', busy[2] === 0 && busy[0] < busy[1] * 0.1, busy);
done();