From 1164c8bab76d26edfe4ab390824d4cd652a453c6 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 25 Sep 2026 10:52:37 -0700 Subject: [PATCH] Let more of the structures' lights come on: tide wheels may hang beside one or two frames, lamps cap tall columns near the top of a structure, and both are a slightly larger share of what gets built. --- public/tide-pool-world.js | 8 +++++--- public/tide-pool.js | 2 +- src/components/tide-pool.tsx | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/tide-pool-world.js b/public/tide-pool-world.js index c265800..3099cf2 100644 --- a/public/tide-pool-world.js +++ b/public/tide-pool-world.js @@ -902,7 +902,7 @@ export const blockCenter = b => ({ x: X0 + (b.i + .5) * CELL, z: Z0 + (b.j + .5) export const blockBottom = b => BLOCK_Y0 + b.k * BLOCK; const groundLevel = (world, i, j) => Math.floor((world.h[j * COLS + i] - BLOCK_Y0) / BLOCK); const SIDES = [[1, 0], [-1, 0], [0, 1], [0, -1]]; -const MIX = { frame: .5, plate: .12, deck: .16, pod: .07, gear: .03, wheel: .04, lamp: .03, pipe: .05 }; +const MIX = { frame: .47, plate: .12, deck: .16, pod: .07, gear: .03, wheel: .06, lamp: .05, pipe: .04 }; const bearing = b => !!b && (b.kind === 'frame' || b.kind === 'pipe' || b.kind === 'plate'); // How much strain a part of this kind at (i, j, k) would carry: 0 on the ground, one more per cell of overhang. Infinity if it cannot stand. function strain(world, i, j, k, kind) { @@ -1103,10 +1103,12 @@ function placeBlock(world, c, delay = 0) { // A small dwelling, above the tide, sheltered beside frames. v = (dry ? .6 : -2) + framesBeside * .25 - tally.pod * .1 + (below?.kind === 'deck' ? .4 : 0) - SIDES.filter(([a, e]) => at(i + a, j + e, k)?.kind === 'pod').length * .35; } else if (kind === 'lamp') { - v = k >= top && dry && !above && below?.kind !== 'lamp' ? .3 + (k - high) * .12 - tally.lamp * .7 : -3; + // A lamp caps a column near the top of the structure once it stands well clear of the water, where its light + // carries; the taller the column, the likelier. + v = k >= top - 1 && k - high >= 4 && !above && bearing(below) ? .7 + (k - high - 4) * .2 - tally.lamp * .6 : -3; } else if (kind === 'wheel') { // A tide wheel hangs off an outside frame, low enough for the current to turn it and charge it. - v = k >= low && k < high - 1 && framesBeside === 1 ? .6 - tally.wheel * .4 : -3; + v = k >= low && k < high - 1 && framesBeside >= 1 && framesBeside <= 2 ? .7 - tally.wheel * .35 : -3; } else if (kind === 'gear') { // Gears go where the tide runs through. v = k >= low && k < high && framesBeside ? .5 - tally.gear * .3 : -3; diff --git a/public/tide-pool.js b/public/tide-pool.js index 971c7a5..feea907 100644 --- a/public/tide-pool.js +++ b/public/tide-pool.js @@ -1,7 +1,7 @@ import { createWorld, advanceWorld, offerObject, SPECIES, SPECIES_ORDER, CELL, COLS, ROWS, X0, Z0, X1, Z1, START_POOL, waterLevel, daylight, heightAt, surfaceAt, depthAt, onShelf, bodyAt, tideOf, tideRising, label, goalText, describeWorld, creatureById, MACHINES, BLOCK, BLOCK_Y0, blockKey, footAt, debrisAt, footing, stormAt, -} from './tide-pool-world.js?v=32'; +} from './tide-pool-world.js?v=33'; const root = document.querySelector('[data-tide-pool]'); const status = document.querySelector('#tide-status'); diff --git a/src/components/tide-pool.tsx b/src/components/tide-pool.tsx index 32a6d70..92f4923 100644 --- a/src/components/tide-pool.tsx +++ b/src/components/tide-pool.tsx @@ -141,7 +141,7 @@ export function TidePoolContent() { {/* Lets the three.js add-ons resolve the same pinned module the page already uses. */} + ); } -- 2.51.2