- Areas within 150 grains of the bot start at once; the others 12 a tick, nearest first, and any the bot flies toward start straight away. A Huge world is fully started after 17 s. - Huge world, first 600 ticks: average 15.2 -> 5.5 ms/tick, worst 79.7 -> 16.2. - New test/t_load.js. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
883 B
JavaScript
29 lines
883 B
JavaScript
// simTick: one simulation step, in order.
|
|
// ---------- Main tick ----------
|
|
function simTick() {
|
|
tick++;
|
|
tickStamp = (tickStamp % 255) + 1;
|
|
if (loadWakeOrder) loadWakeTick();
|
|
if (tick % 20 === 1) updateDirtyRoof();
|
|
weatherTick();
|
|
machinesTick();
|
|
pipesTick();
|
|
pulseTick();
|
|
entTick();
|
|
if (flyers.length) flyTick();
|
|
if (tick % 8 === 0) wakeBotPowder();
|
|
simMove();
|
|
heatPass();
|
|
for (let c = 0; c < NCH; c++) if (awake[c]) awake[c]--;
|
|
if (tick % 15 === 0) checkMolds();
|
|
if (tick % 30 === 0) checkLedger();
|
|
if (tick % 60 === 7) plantTick();
|
|
if (tick % 120 === 13) coldTick();
|
|
if (tick % 20 === 9 && treeBases.length) treeSupportTick();
|
|
dockTick();
|
|
if (tick % 60 === 17) { marketTick(); ordersTick(); }
|
|
if (tick % 30 === 11 && saplings.length) saplingTick();
|
|
ghostTick();
|
|
if (tick % 4 === 0) fogLook(bot.x + bot.w / 2, bot.y + bot.h / 2);
|
|
}
|