// World generation report: time to generate, how many cells of each material, where the bot // starts, and what idle ticks and ticks after digging cost. const { load, ticks } = require('../../test/harness'); const { run } = load(); const t0 = Date.now(); run(`generateWorld(12345, 1024, 640)`); console.log('worldgen ms', Date.now() - t0); const names = run(`MD.map(d=>d.name)`); const counts = run(`(()=>{const c=new Array(NMAT).fill(0); for(let i=0;i { if (c) console.log(String(i).padStart(2), names[i].padEnd(16), c); }); console.log('bot', run(`JSON.stringify(bot)`), 'surf at spawn', run(`surfY[W>>1]`)); // settle cost: run 600 ticks idle let t1 = Date.now(); ticks(run, 600); console.log('600 idle ticks ms', Date.now() - t1, 'awake chunks', run(`awake.reduce((a,b)=>a+(b>0),0)`), 'hot', run(`hot.reduce((a,b)=>a+(b>0),0)`)); // dig a big hole near spawn and measure active cost run(`player.bitTier=3; for (let k=0;k<60;k++) { toolDig(W>>1, surfY[W>>1]+20+k, 6); }`); t1 = Date.now(); ticks(run, 300); console.log('300 ticks after digging ms', Date.now() - t1); // worst case: wake everything run(`awake.fill(3); hot.fill(6); hotLvl.fill(2)`); t1 = Date.now(); ticks(run, 60); console.log('60 ticks all-awake ms', Date.now() - t1);