Files
deepgrain-foundry/src/sim/tick.js
T
44r0n7andClaude Opus 5.5 cce81e4eca Piles near the bot sort, and 20 times faster; burning fuel keeps the slow pace (t21)
- SORTP 0.003 -> 0.06: ore sinks through 8 rows of ash in about 7 s near the bot.
- wakeBotPowder(): every 8 ticks, areas with loose grains within 100 grains of the bot get a
  sorting chance; far away, resting piles still sleep.
- Sinking through burning fuel stays at 0.003, so buried burning piles still char and furnace
  beds behave as tuned. World generation settles at the old rate: seeds are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 22:05:03 -04:00

28 lines
841 B
JavaScript

// simTick: one simulation step, in order.
// ---------- Main tick ----------
function simTick() {
tick++;
tickStamp = (tickStamp % 255) + 1;
if (tick % 20 === 1) updateRoof();
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);
}