@adatechnology/game-weather 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/blend.ts","../src/daylight.ts","../src/heat.ts","../src/effects.ts","../src/rng.ts","../src/lightning.ts","../src/data/climates.json","../src/data/states.json","../src/registry.ts","../src/scheduler.ts","../src/wetness.ts","../src/weather.ts","../src/bench/locale.ts","../src/bench/module.ts"],"sourcesContent":["/**\n * @adatechnology/game-weather: pure, seeded weather. States (clear to typhoon) with the numbers of the teams' pages, climates that move between\n * them in game time (2 to 6 hours each, fronts from the west), lightning with the thunder delay, ground wetness, what the weather means for\n * sight, hearing and footsteps, the heat index and the day-night formula. No three.js, no audio, no game content: renderers and sound read it.\n */\nexport { createWeather, createTimeline, DEFAULT_START_HOUR } from './weather'\nexport type { TimelineOptions, Weather, WeatherOptions, WeatherTimeline } from './weather'\nexport { CLIMATES, WEATHER_STATES, createWeatherRegistry } from './registry'\nexport type { RegistryOptions, WeatherRegistry } from './registry'\nexport { blendValues, STATE_VALUE_KEYS, valuesOf } from './blend'\nexport { createScheduler } from './scheduler'\nexport type { Scheduler } from './scheduler'\nexport { FLASH_END_SECONDS, SPEED_OF_SOUND, createLightningStream, flashIntensity, thunderDelay } from './lightning'\nexport type { LightningStream } from './lightning'\nexport { DEFAULT_DRY_OUT_SECONDS, DEFAULT_WET_RISE_SECONDS, createWetness } from './wetness'\nexport type { Wetness, WetnessOptions } from './wetness'\nexport { DRY_VISIBILITY_METERS, NIGHT_SIGHT_LOSS, deriveEffects } from './effects'\nexport type { EffectsInput } from './effects'\nexport { heatIndexC, heatStress } from './heat'\nexport { DAY_REAL_SECONDS, DEFAULT_TIME_SCALE, GAME_DAY_SECONDS, dayFractionAt, daylight } from './daylight'\nexport type { Daylight } from './daylight'\nexport { createRng, createStream, streamSeed } from './rng'\nexport type {\n Climate,\n DeepPartial,\n LightningConfig,\n StateValueKey,\n StateValues,\n Strike,\n WeatherEffects,\n WeatherEventMap,\n WeatherSample,\n WeatherState,\n} from './types'\n\nexport { createWeatherTestModule } from './bench/module'\nexport type { WeatherScenarioLike, WeatherTestModule, WeatherTestModuleOptions } from './bench/module'\nexport { weatherBenchTextOf } from './bench/locale'\nexport type { WeatherBenchText } from './bench/locale'\n","import type { StateValueKey, StateValues, WeatherState } from './types'\n\nexport const STATE_VALUE_KEYS: readonly StateValueKey[] = [\n 'rain',\n 'drops',\n 'sheets',\n 'windX',\n 'windZ',\n 'gust',\n 'fogFar',\n 'fogDensity',\n 'skyScale',\n 'visibility',\n 'humidity',\n 'temperatureDeltaC',\n 'wetness',\n 'hearingScale',\n 'footstepScale',\n 'dryingScale',\n 'debrisPush',\n 'haze',\n 'mistPerSecond',\n 'ashPerSecond',\n]\n\nexport function valuesOf(state: WeatherState): StateValues {\n const values: Record<string, number> = {}\n for (const key of STATE_VALUE_KEYS) values[key] = state[key]\n return values as unknown as StateValues\n}\n\n/** Every number between two states: `progress` 0 is `from`, 1 is `to`. */\nexport function blendValues(from: StateValues, to: StateValues, progress: number): StateValues {\n const amount = Math.min(1, Math.max(0, progress))\n const blended: Record<string, number> = {}\n for (const key of STATE_VALUE_KEYS) blended[key] = from[key] + (to[key] - from[key]) * amount\n return blended as unknown as StateValues\n}\n","/** A game day lasts 20 real minutes in the slice (jogo.js L69127: `dayT + dt / 1200`). */\nexport const DAY_REAL_SECONDS = 1200\nexport const GAME_DAY_SECONDS = 86400\n/** Game seconds per real second of the 20-minute day. */\nexport const DEFAULT_TIME_SCALE = GAME_DAY_SECONDS / DAY_REAL_SECONDS\n\nconst NIGHT_SPAN = 2.2\n\nconst clamp = (value: number, low: number, high: number): number => (value < low ? low : value > high ? high : value)\n\nexport type Daylight = {\n /** Sun height 0..1 (`s` of the game). */\n readonly sun: number\n /** 0 in full daylight, 1 in the darkest night. */\n readonly nightFactor: number\n}\n\n/** jogo.js L69128-L69130: `s = clamp(sin(dayT·2π − π/2)·0.5 + 0.5, 0, 1)`, `nightF = 1 − clamp(s·2.2, 0, 1)`. `dayFraction` 0 is midnight. */\nexport function daylight(dayFraction: number): Daylight {\n const sun = clamp(Math.sin(dayFraction * Math.PI * 2 - Math.PI / 2) * 0.5 + 0.5, 0, 1)\n return { sun, nightFactor: 1 - clamp(sun * NIGHT_SPAN, 0, 1) }\n}\n\n/** The fraction of the day after `gameSeconds` from `startHour`. */\nexport function dayFractionAt(startHour: number, gameSeconds: number): number {\n const fraction = (startHour / 24 + gameSeconds / GAME_DAY_SECONDS) % 1\n return fraction < 0 ? fraction + 1 : fraction\n}\n","const HEAT_STRESS_BANDS: ReadonlyArray<readonly [indexC: number, stress: number]> = [\n [27, 0],\n [32, 1 / 3],\n [41, 2 / 3],\n [54, 1],\n]\nconst NOAA_REGRESSION_FROM_F = 80\n\nconst toFahrenheit = (celsius: number): number => (celsius * 9) / 5 + 32\nconst toCelsius = (fahrenheit: number): number => ((fahrenheit - 32) * 5) / 9\n\n/**\n * NOAA heat index in °C: the Steadman estimate averaged with the temperature, and from 80 °F up the Rothfusz regression with the low-humidity and\n * high-humidity adjustments. Built from + - * / and `sqrt` only, so it is the same on every engine.\n */\nexport function heatIndexC(temperatureC: number, relativeHumidityPercent: number): number {\n const t = toFahrenheit(temperatureC)\n const r = relativeHumidityPercent\n const steadman = 0.5 * (t + 61 + (t - 68) * 1.2 + r * 0.094)\n const simple = (steadman + t) / 2\n if (simple < NOAA_REGRESSION_FROM_F) return toCelsius(simple)\n let index =\n -42.379 +\n 2.04901523 * t +\n 10.14333127 * r -\n 0.22475541 * t * r -\n 0.00683783 * t * t -\n 0.05481717 * r * r +\n 0.00122874 * t * t * r +\n 0.00085282 * t * r * r -\n 0.00000199 * t * t * r * r\n if (r < 13 && t >= 80 && t <= 112) index -= ((13 - r) / 4) * Math.sqrt((17 - Math.abs(t - 95)) / 17)\n else if (r > 85 && t >= 80 && t <= 87) index += ((r - 85) / 10) * ((87 - t) / 5)\n return toCelsius(index)\n}\n\n/** 0..1 across the NOAA bands (caution 27, extreme caution 32, danger 41, extreme danger 54 °C), linear between them. */\nexport function heatStress(heatIndex: number): number {\n const first = HEAT_STRESS_BANDS[0]!\n const last = HEAT_STRESS_BANDS[HEAT_STRESS_BANDS.length - 1]!\n if (heatIndex <= first[0]) return first[1]\n if (heatIndex >= last[0]) return last[1]\n for (let index = 1; index < HEAT_STRESS_BANDS.length; index++) {\n const [upperC, upperStress] = HEAT_STRESS_BANDS[index]!\n const [lowerC, lowerStress] = HEAT_STRESS_BANDS[index - 1]!\n if (heatIndex <= upperC) return lowerStress + ((heatIndex - lowerC) / (upperC - lowerC)) * (upperStress - lowerStress)\n }\n return last[1]\n}\n","import { heatIndexC, heatStress } from './heat'\nimport type { StateValues, WeatherEffects } from './types'\n\n/** Gameplay visibility of a dry day (the game's dry fog far, jogo.js L69141): `sightScale` is the visibility against it. */\nexport const DRY_VISIBILITY_METERS = 220\n/** jogo.js L66872: sight is `perc[0] × (1 − 0.4 × nightF)`. */\nexport const NIGHT_SIGHT_LOSS = 0.4\n\nexport type EffectsInput = {\n readonly values: StateValues\n readonly nightFactor: number\n readonly temperatureC: number\n readonly humidityPercent: number\n readonly lightningReveal: number\n}\n\n/** What the weather means for gameplay, as numbers for whoever has eyes, ears or feet in the world (perception, footsteps, heat). */\nexport function deriveEffects(input: EffectsInput): WeatherEffects {\n const { values, nightFactor } = input\n const weatherSight = Math.min(1, Math.max(0, values.visibility / DRY_VISIBILITY_METERS))\n const heatIndex = heatIndexC(input.temperatureC, input.humidityPercent)\n return {\n visibility: values.visibility,\n sightScale: weatherSight * (1 - NIGHT_SIGHT_LOSS * nightFactor),\n hearingScale: values.hearingScale,\n footstepScale: values.footstepScale,\n heatIndexC: heatIndex,\n heatStress: heatStress(heatIndex),\n lightningReveal: input.lightningReveal,\n dryingScale: values.dryingScale,\n debrisPush: values.debrisPush,\n }\n}\n","const FNV_OFFSET = 0x811c9dc5\nconst FNV_PRIME = 0x01000193\nconst MIX = 0x9e3779b1\n\n/** Deterministic mulberry32 generator; returns floats in [0, 1). */\nexport function createRng(seed: number): () => number {\n let state = seed >>> 0\n return () => {\n state = (state + 0x6d2b79f5) >>> 0\n let mixed = Math.imul(state ^ (state >>> 15), state | 1)\n mixed ^= mixed + Math.imul(mixed ^ (mixed >>> 7), mixed | 61)\n return ((mixed ^ (mixed >>> 14)) >>> 0) / 4294967296\n }\n}\n\n/** A seed for the stream called `name`: the same seed gives each name its own sequence, so lightning never shifts the schedule. */\nexport function streamSeed(seed: number, name: string): number {\n let hash = FNV_OFFSET\n for (let index = 0; index < name.length; index++) hash = Math.imul(hash ^ name.charCodeAt(index), FNV_PRIME) >>> 0\n return Math.imul((seed >>> 0) ^ hash, MIX) >>> 0\n}\n\nexport function createStream(seed: number, name: string): () => number {\n return createRng(streamSeed(seed, name))\n}\n\nexport function drawBetween(rng: () => number, range: readonly [min: number, max: number]): number {\n return range[0] + rng() * (range[1] - range[0])\n}\n","import { createStream, drawBetween } from './rng'\nimport type { LightningConfig } from './types'\n\n/** Speed of sound in air, m/s: a physical constant, so it is not configurable. */\nexport const SPEED_OF_SOUND = 343\n\n/** Seconds a flash goes on after a strike before the scene is back to normal (Workshop W1068: `k > .4`). */\nexport const FLASH_END_SECONDS = 0.4\n\n/** Seconds from the flash to the thunder for a strike `distance` metres away. */\nexport function thunderDelay(distance: number): number {\n return distance / SPEED_OF_SOUND\n}\n\n/** The Workshop double flash (W1068): full for 0.08 s, 0.2 until 0.16 s, 0.8 until 0.26 s, then dark. `elapsed` is seconds since the strike. */\nexport function flashIntensity(elapsed: number): number {\n if (elapsed < 0 || elapsed >= FLASH_END_SECONDS) return 0\n if (elapsed < 0.08) return 1\n if (elapsed < 0.16) return 0.2\n if (elapsed < 0.26) return 0.8\n return 0\n}\n\nexport type LightningStream = {\n /** Seconds from entering a state with lightning to its first strike. */\n first(config: LightningConfig): number\n /** Seconds from a strike to the next one. */\n interval(config: LightningConfig): number\n /** Where a strike lands: metres and degrees clockwise from north. Draws the distance, then the bearing. */\n place(config: LightningConfig): { readonly distance: number; readonly bearing: number }\n}\n\n/** The lightning's own seeded stream, apart from the scheduler's: the server can send the seed and every client sees the same strikes. */\nexport function createLightningStream(seed: number): LightningStream {\n const rng = createStream(seed, 'lightning')\n return {\n first: (config) => drawBetween(rng, config.first),\n interval: (config) => drawBetween(rng, config.interval),\n place(config) {\n const distance = drawBetween(rng, config.distance)\n return { distance, bearing: rng() * 360 }\n },\n }\n}\n","[\n {\n \"id\": \"temperate\",\n \"sources\": [\"galeria-vale-cinzento:L1393 (changes every 2-6 h, arrives from the west)\", \"design:T6 3.2 kit default: mostly clear and overcast, no extremes\"],\n \"start\": \"clear\",\n \"dwellHours\": [2, 6],\n \"blendMinutes\": 10,\n \"frontDirection\": [1, 0],\n \"temperatureC\": { \"mean\": 16, \"swing\": 6 },\n \"humidityOffset\": 0,\n \"transitions\": {\n \"clear\": { \"overcast\": 4, \"windy\": 1, \"fog\": 1, \"light_rain\": 1 },\n \"overcast\": { \"clear\": 3, \"light_rain\": 3, \"heavy_rain\": 1, \"fog\": 1, \"windy\": 1 },\n \"light_rain\": { \"overcast\": 3, \"clear\": 2, \"heavy_rain\": 2 },\n \"heavy_rain\": { \"light_rain\": 3, \"overcast\": 2, \"storm\": 1 },\n \"storm\": { \"heavy_rain\": 3, \"light_rain\": 2, \"overcast\": 1 },\n \"fog\": { \"clear\": 3, \"overcast\": 2 },\n \"windy\": { \"clear\": 3, \"overcast\": 3, \"light_rain\": 1 }\n }\n },\n {\n \"id\": \"tropical\",\n \"sources\": [\"galeria-vale-cinzento:L1393 (changes every 2-6 h, arrives from the west)\", \"design:T6 3.2 and Q3: extremes rare and enabled\"],\n \"start\": \"clear\",\n \"dwellHours\": [2, 6],\n \"blendMinutes\": 10,\n \"frontDirection\": [1, 0],\n \"temperatureC\": { \"mean\": 29, \"swing\": 3 },\n \"humidityOffset\": 0.1,\n \"transitions\": {\n \"clear\": { \"overcast\": 3, \"light_rain\": 2, \"windy\": 1, \"extreme_heat\": 0.8 },\n \"overcast\": { \"clear\": 3, \"light_rain\": 3, \"heavy_rain\": 2, \"fog\": 0.5 },\n \"light_rain\": { \"overcast\": 3, \"clear\": 2, \"heavy_rain\": 2 },\n \"heavy_rain\": { \"light_rain\": 3, \"overcast\": 2, \"storm\": 1.5 },\n \"storm\": { \"heavy_rain\": 3, \"light_rain\": 2, \"overcast\": 1, \"cyclone\": 0.5 },\n \"fog\": { \"clear\": 3, \"overcast\": 2 },\n \"windy\": { \"clear\": 3, \"overcast\": 2, \"light_rain\": 1, \"storm\": 0.5 },\n \"extreme_heat\": { \"clear\": 4, \"overcast\": 2, \"storm\": 0.8 },\n \"cyclone\": { \"storm\": 3, \"heavy_rain\": 2, \"typhoon\": 0.5 },\n \"typhoon\": { \"cyclone\": 3, \"storm\": 2 }\n }\n }\n]\n","[\n {\n \"id\": \"clear\",\n \"sources\": [\"jogo:L69141 (fog far 220 dry)\", \"showroom.js:L1693-1710 (breeze 3.5, 1.5 m/s)\"],\n \"rain\": 0, \"drops\": 0, \"sheets\": 0,\n \"windX\": 3.5, \"windZ\": 1.5, \"gust\": 5,\n \"fogFar\": 220, \"fogDensity\": 0, \"skyScale\": 1, \"visibility\": 220,\n \"humidity\": 0.5, \"temperatureDeltaC\": 0, \"wetness\": 0,\n \"hearingScale\": 1, \"footstepScale\": 1, \"dryingScale\": 1, \"debrisPush\": 0,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0\n },\n {\n \"id\": \"overcast\",\n \"sources\": [\"cena-de-arte:L413 (wind .35, .12)\", \"cena-de-arte:L36 (FogExp2 .03)\", \"design:T6 sky x0.9\"],\n \"rain\": 0, \"drops\": 0, \"sheets\": 0,\n \"windX\": 0.35, \"windZ\": 0.12, \"gust\": 0.6,\n \"fogFar\": 220, \"fogDensity\": 0.03, \"skyScale\": 0.9, \"visibility\": 200,\n \"humidity\": 0.65, \"temperatureDeltaC\": -1, \"wetness\": 0,\n \"hearingScale\": 1, \"footstepScale\": 1, \"dryingScale\": 1, \"debrisPush\": 0,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0\n },\n {\n \"id\": \"light_rain\",\n \"sources\": [\"oficina-vfx:W1065 (Garoa: 900 drops, slant .3)\", \"jogo:L70416-70427 (rain level .035)\", \"design:T6 2.5 mm/h, wetness .35, visibility 160, hearing x0.8 (Q4)\"],\n \"rain\": 2.5, \"drops\": 900, \"sheets\": 0,\n \"windX\": 0.3, \"windZ\": 0, \"gust\": 0.6,\n \"fogFar\": 180, \"fogDensity\": 0, \"skyScale\": 0.9, \"visibility\": 160,\n \"humidity\": 0.85, \"temperatureDeltaC\": -2, \"wetness\": 0.35,\n \"hearingScale\": 0.8, \"footstepScale\": 0.85, \"dryingScale\": 1, \"debrisPush\": 0,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0\n },\n {\n \"id\": \"heavy_rain\",\n \"sources\": [\"oficina-vfx:W1065 (Chuva: 2200 drops, slant 1.2)\", \"cena-de-arte:L1314 (rain gain .06)\", \"jogo:L69141 (fog far 140, sky x0.8)\", \"galeria-vale-cinzento:L1393 (vision 120 m, quieter steps)\", \"design:T6 15 mm/h, hearing x0.6 (Q4)\"],\n \"rain\": 15, \"drops\": 2200, \"sheets\": 0,\n \"windX\": 1.2, \"windZ\": 0, \"gust\": 2,\n \"fogFar\": 140, \"fogDensity\": 0, \"skyScale\": 0.8, \"visibility\": 120,\n \"humidity\": 0.9, \"temperatureDeltaC\": -4, \"wetness\": 0.8,\n \"hearingScale\": 0.6, \"footstepScale\": 0.7, \"dryingScale\": 1, \"debrisPush\": 0,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0\n },\n {\n \"id\": \"storm\",\n \"sources\": [\"oficina-vfx:W1065-1069 (Temporal: 4000 drops, slant 4.5, lightning 3.5-6 s, first at 2-4 s, sheets)\", \"showroom.js (60 mm/h)\", \"design:T6 hearing x0.5 (Q4)\"],\n \"rain\": 60, \"drops\": 4000, \"sheets\": 1,\n \"windX\": 4.5, \"windZ\": 0, \"gust\": 6,\n \"fogFar\": 110, \"fogDensity\": 0, \"skyScale\": 0.7, \"visibility\": 100,\n \"humidity\": 0.92, \"temperatureDeltaC\": -5, \"wetness\": 1,\n \"hearingScale\": 0.5, \"footstepScale\": 0.6, \"dryingScale\": 1, \"debrisPush\": 0,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0,\n \"lightning\": { \"interval\": [3.5, 6], \"first\": [2, 4], \"distance\": [200, 4000], \"reveal\": 0.2 }\n },\n {\n \"id\": \"fog\",\n \"sources\": [\"oficina-vfx:W1073-1080 (density .075, ground mist 5/s, ash 14/s)\", \"jogo:L69101 (zone fog far 60)\"],\n \"rain\": 0, \"drops\": 0, \"sheets\": 0,\n \"windX\": 0.3, \"windZ\": 0.1, \"gust\": 0.5,\n \"fogFar\": 60, \"fogDensity\": 0.075, \"skyScale\": 0.85, \"visibility\": 40,\n \"humidity\": 0.95, \"temperatureDeltaC\": -3, \"wetness\": 0.15,\n \"hearingScale\": 1, \"footstepScale\": 1, \"dryingScale\": 1, \"debrisPush\": 0,\n \"haze\": 0, \"mistPerSecond\": 5, \"ashPerSecond\": 14\n },\n {\n \"id\": \"windy\",\n \"sources\": [\"cena-de-arte:L1315 (wind loop)\", \"design:T6 Q3 8 m/s, gust 12\"],\n \"rain\": 0, \"drops\": 0, \"sheets\": 0,\n \"windX\": 8, \"windZ\": 0, \"gust\": 12,\n \"fogFar\": 220, \"fogDensity\": 0, \"skyScale\": 1, \"visibility\": 220,\n \"humidity\": 0.45, \"temperatureDeltaC\": -1, \"wetness\": 0,\n \"hearingScale\": 0.85, \"footstepScale\": 0.9, \"dryingScale\": 1, \"debrisPush\": 0,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0\n },\n {\n \"id\": \"cyclone\",\n \"sources\": [\"design:T6 Q3 physics preset, no team source: tropical cyclone 33 m/s sustained, gust x1.3, storm rain, debris push\"],\n \"rain\": 60, \"drops\": 4000, \"sheets\": 1,\n \"windX\": 33, \"windZ\": 0, \"gust\": 42.9,\n \"fogFar\": 80, \"fogDensity\": 0, \"skyScale\": 0.6, \"visibility\": 60,\n \"humidity\": 0.9, \"temperatureDeltaC\": 0, \"wetness\": 1,\n \"hearingScale\": 0.3, \"footstepScale\": 0.5, \"dryingScale\": 1, \"debrisPush\": 8,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0,\n \"lightning\": { \"interval\": [3.5, 6], \"first\": [2, 4], \"distance\": [200, 4000], \"reveal\": 0.2 }\n },\n {\n \"id\": \"typhoon\",\n \"sources\": [\"design:T6 Q3 physics preset, no team source: typhoon 50 m/s sustained, gust x1.3, storm rain, debris push\"],\n \"rain\": 60, \"drops\": 4000, \"sheets\": 1,\n \"windX\": 50, \"windZ\": 0, \"gust\": 65,\n \"fogFar\": 60, \"fogDensity\": 0, \"skyScale\": 0.5, \"visibility\": 40,\n \"humidity\": 0.9, \"temperatureDeltaC\": 0, \"wetness\": 1,\n \"hearingScale\": 0.25, \"footstepScale\": 0.4, \"dryingScale\": 1, \"debrisPush\": 18,\n \"haze\": 0, \"mistPerSecond\": 0, \"ashPerSecond\": 0,\n \"lightning\": { \"interval\": [3.5, 6], \"first\": [2, 4], \"distance\": [200, 4000], \"reveal\": 0.2 }\n },\n {\n \"id\": \"extreme_heat\",\n \"sources\": [\"design:T6 Q3 no team source: 38 C at the tropical noon (+6 over the climate), 60 % humidity, haze, drying x2\"],\n \"rain\": 0, \"drops\": 0, \"sheets\": 0,\n \"windX\": 0.8, \"windZ\": 0.3, \"gust\": 1.5,\n \"fogFar\": 220, \"fogDensity\": 0, \"skyScale\": 1, \"visibility\": 200,\n \"humidity\": 0.6, \"temperatureDeltaC\": 6, \"wetness\": 0,\n \"hearingScale\": 1, \"footstepScale\": 1, \"dryingScale\": 2, \"debrisPush\": 0,\n \"haze\": 1, \"mistPerSecond\": 0, \"ashPerSecond\": 0\n }\n]\n","import climatesJson from './data/climates.json'\nimport statesJson from './data/states.json'\nimport type { Climate, DeepPartial, WeatherState } from './types'\n\nexport const WEATHER_STATES: readonly WeatherState[] = statesJson as unknown as readonly WeatherState[]\nexport const CLIMATES: readonly Climate[] = climatesJson as unknown as readonly Climate[]\n\nexport type RegistryOptions = {\n /** Added to the shipped states or, when the id exists, replacing it. */\n readonly states?: readonly WeatherState[]\n readonly climates?: readonly Climate[]\n /** Merged into a shipped or added entry by id; a patch for an id that does not exist is ignored. */\n readonly patch?: {\n readonly states?: Readonly<Record<string, DeepPartial<WeatherState>>>\n readonly climates?: Readonly<Record<string, DeepPartial<Climate>>>\n }\n readonly remove?: { readonly states?: readonly string[]; readonly climates?: readonly string[] }\n}\n\nexport type WeatherRegistry = {\n state(id: string): WeatherState | undefined\n climate(id: string): Climate | undefined\n stateIds(): string[]\n climateIds(): string[]\n registerState(state: WeatherState): void\n registerClimate(climate: Climate): void\n patchState(id: string, patch: DeepPartial<WeatherState>): void\n patchClimate(id: string, patch: DeepPartial<Climate>): void\n removeState(id: string): void\n removeClimate(id: string): void\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction mergeRecords(base: Record<string, unknown>, patch: Record<string, unknown>): Record<string, unknown> {\n const merged: Record<string, unknown> = { ...base }\n for (const [key, value] of Object.entries(patch)) {\n if (value === undefined) continue\n const current = merged[key]\n merged[key] = isPlainObject(current) && isPlainObject(value) ? mergeRecords(current, value) : value\n }\n return merged\n}\n\nfunction deepMerge<TValue>(base: TValue, patch: DeepPartial<TValue>): TValue {\n return mergeRecords(base as Record<string, unknown>, patch as Record<string, unknown>) as TValue\n}\n\ntype Entry = { readonly id: string }\n\nfunction createTable<TEntry extends Entry>(shipped: readonly TEntry[]): Map<string, TEntry> {\n return new Map(shipped.map((entry) => [entry.id, entry]))\n}\n\nfunction patchEntry<TEntry extends Entry>(table: Map<string, TEntry>, id: string, patch: DeepPartial<TEntry>): void {\n const entry = table.get(id)\n if (entry) table.set(id, deepMerge(entry, patch))\n}\n\n/** The shipped states and climates with yours added, patched or removed; change it later with the same verbs. */\nexport function createWeatherRegistry(options: RegistryOptions = {}): WeatherRegistry {\n const states = createTable(WEATHER_STATES)\n const climates = createTable(CLIMATES)\n for (const state of options.states ?? []) states.set(state.id, state)\n for (const climate of options.climates ?? []) climates.set(climate.id, climate)\n for (const [id, patch] of Object.entries(options.patch?.states ?? {})) patchEntry(states, id, patch)\n for (const [id, patch] of Object.entries(options.patch?.climates ?? {})) patchEntry(climates, id, patch)\n for (const id of options.remove?.states ?? []) states.delete(id)\n for (const id of options.remove?.climates ?? []) climates.delete(id)\n return {\n state: (id) => states.get(id),\n climate: (id) => climates.get(id),\n stateIds: () => [...states.keys()],\n climateIds: () => [...climates.keys()],\n registerState: (state) => void states.set(state.id, state),\n registerClimate: (climate) => void climates.set(climate.id, climate),\n patchState: (id, patch) => patchEntry(states, id, patch),\n patchClimate: (id, patch) => patchEntry(climates, id, patch),\n removeState: (id) => void states.delete(id),\n removeClimate: (id) => void climates.delete(id),\n }\n}\n","import { createStream, drawBetween } from './rng'\nimport type { Climate } from './types'\n\nconst SECONDS_PER_HOUR = 3600\n/** A state lasts at least this long, so a climate patched to a zero dwell cannot stall the clock. */\nconst MIN_DWELL_SECONDS = 1\n\nexport type Scheduler = {\n /** Game seconds at which the current state ends. */\n nextChangeAt(): number\n /** Picks the state after `current`, then draws how long it lasts from `at`. Returns the new state's id. */\n next(current: string, at: number): string\n /** Draws a new duration from `at` (after a forced change). */\n restart(at: number): void\n}\n\n/**\n * A seeded Markov chain in game time. Draw order, fixed so the timeline repeats: at start one dwell; at each change the next state first\n * (one draw, over the weights in the climate's order), then its dwell. States `isKnown` rejects are left out of the weights.\n */\nexport function createScheduler(climate: Climate, seed: number, isKnown: (id: string) => boolean): Scheduler {\n const rng = createStream(seed, 'schedule')\n let changeAt = 0\n const drawDwell = (from: number): number => from + Math.max(MIN_DWELL_SECONDS, drawBetween(rng, climate.dwellHours) * SECONDS_PER_HOUR)\n changeAt = drawDwell(0)\n return {\n nextChangeAt: () => changeAt,\n next(current, at) {\n const options = Object.entries(climate.transitions[current] ?? {}).filter(([id, weight]) => weight > 0 && isKnown(id))\n const total = options.reduce((sum, [, weight]) => sum + weight, 0)\n let chosen = current\n if (total > 0) {\n let pick = rng() * total\n chosen = options[options.length - 1]![0]\n for (const [id, weight] of options) {\n if (pick < weight) {\n chosen = id\n break\n }\n pick -= weight\n }\n }\n changeAt = drawDwell(at)\n return chosen\n },\n restart(at) {\n changeAt = drawDwell(at)\n },\n }\n}\n","export const DEFAULT_WET_RISE_SECONDS = 120\n/** The Workshop sheet: the water goes back to the colour of the ground 3 minutes after the rain stops. */\nexport const DEFAULT_DRY_OUT_SECONDS = 180\n\nexport type WetnessOptions = {\n /** Seconds of rain to wet the ground fully. */\n readonly riseSeconds?: number\n /** Seconds from the end of the rain until the ground is dry. */\n readonly dryOutSeconds?: number\n}\n\nexport type Wetness = {\n value(): number\n /** Moves `seconds` toward `target` (the wetness the weather asks for); `dryingScale` speeds the dry-out up. Returns the new value. */\n update(seconds: number, target: number, dryingScale?: number): number\n reset(value?: number): void\n}\n\n/** Ground wetness: rises while the weather asks for more, then falls in a straight line that ends `dryOutSeconds` after the start of the fall. */\nexport function createWetness(options: WetnessOptions = {}): Wetness {\n const riseSeconds = options.riseSeconds ?? DEFAULT_WET_RISE_SECONDS\n const dryOutSeconds = options.dryOutSeconds ?? DEFAULT_DRY_OUT_SECONDS\n let current = 0\n let peak = 0\n let isDrying = false\n return {\n value: () => current,\n update(seconds, target, dryingScale = 1) {\n if (target > current) {\n isDrying = false\n current = Math.min(target, current + seconds / riseSeconds)\n } else if (target < current) {\n if (!isDrying) {\n isDrying = true\n peak = current\n }\n current = Math.max(target, current - (peak * seconds * dryingScale) / dryOutSeconds)\n } else isDrying = false\n return current\n },\n reset(value = 0) {\n current = value\n peak = value\n isDrying = false\n },\n }\n}\n","import { blendValues, valuesOf } from './blend'\nimport { DEFAULT_TIME_SCALE, daylight, dayFractionAt } from './daylight'\nimport { deriveEffects } from './effects'\nimport { createLightningStream, flashIntensity, thunderDelay } from './lightning'\nimport { createWeatherRegistry } from './registry'\nimport type { RegistryOptions, WeatherRegistry } from './registry'\nimport { createScheduler } from './scheduler'\nimport type { Climate, StateValues, Strike, WeatherEventMap, WeatherSample, WeatherState } from './types'\nimport { createWetness } from './wetness'\nimport type { WetnessOptions } from './wetness'\n\nexport const DEFAULT_START_HOUR = 8\nconst SECONDS_PER_MINUTE = 60\nconst WETNESS_STEP_SECONDS = 1\n\nexport type WeatherOptions = RegistryOptions & {\n /** Seed of the schedule and of the lightning (each has its own stream). Default 1. */\n readonly seed?: number\n /** Climate id. Default `temperate`. */\n readonly climate?: string\n /** First state; default the climate's `start`, which is `clear`: the normal world comes first. */\n readonly start?: string\n /** Game seconds per real second. Default 72 (the 20-minute day). */\n readonly timeScale?: number\n /** Hour of the day the world starts at. Default 8. */\n readonly startHour?: number\n /** `false` keeps the state until `force` changes it. Default true. */\n readonly autoSchedule?: boolean\n readonly wetness?: WetnessOptions\n /** An existing registry, instead of building one from the registry options. */\n readonly registry?: WeatherRegistry\n}\n\nexport type WeatherTimeline = {\n readonly seed: number\n readonly climate: string\n readonly start: string\n readonly hours: number\n readonly sampleMinutes: number\n readonly transitions: ReadonlyArray<{ readonly gameSeconds: number; readonly from: string; readonly to: string }>\n readonly strikes: readonly Strike[]\n readonly samples: ReadonlyArray<Readonly<Record<string, number | string>>>\n}\n\nexport type Weather = {\n readonly registry: WeatherRegistry\n /** Moves the world forward by `dt` real seconds (game time moves `timeScale` times as fast). Events fire in order as they are crossed. */\n advance(dt: number): void\n sample(): WeatherSample\n /** The state being blended to, or settled in. */\n state(): string\n /** Changes state now, blending over `blendSeconds` real seconds (0 is at once); the new state then lasts a normal dwell. */\n force(id: string, blendSeconds?: number): void\n setTimeScale(timeScale: number): void\n setAutoSchedule(isOn: boolean): void\n /** What a fresh world with these options does over `hours` game hours; the live world is not touched. */\n timeline(hours: number, sampleMinutes?: number): WeatherTimeline\n on<TEvent extends keyof WeatherEventMap>(event: TEvent, listener: (payload: WeatherEventMap[TEvent]) => void): () => void\n}\n\ntype Blend = { startedAt: number; duration: number }\n\nconst clamp01 = (value: number): number => Math.min(1, Math.max(0, value))\n\nfunction requireClimate(registry: WeatherRegistry, id: string): Climate {\n const climate = registry.climate(id)\n if (!climate) throw new Error(`game-weather: unknown climate \"${id}\"`)\n return climate\n}\n\nfunction requireState(registry: WeatherRegistry, id: string): WeatherState {\n const state = registry.state(id)\n if (!state) throw new Error(`game-weather: unknown state \"${id}\"`)\n return state\n}\n\nexport function createWeather(options: WeatherOptions = {}): Weather {\n const registry = options.registry ?? createWeatherRegistry(options)\n const seed = options.seed ?? 1\n const climateId = options.climate ?? 'temperate'\n const startClimate = requireClimate(registry, climateId)\n const startState = requireState(registry, options.start ?? startClimate.start)\n const startHour = options.startHour ?? DEFAULT_START_HOUR\n const scheduler = createScheduler(startClimate, seed, (id) => registry.state(id) !== undefined)\n const lightning = createLightningStream(seed)\n const wetness = createWetness(options.wetness)\n const listeners = new Map<keyof WeatherEventMap, Set<(payload: never) => void>>()\n\n let timeScale = options.timeScale ?? DEFAULT_TIME_SCALE\n let isAutoSchedule = options.autoSchedule ?? true\n let gameSeconds = 0\n let simSeconds = 0\n let target = startState\n let targetValues = valuesOf(startState)\n let fromValues: StateValues = targetValues\n let previousId: string | undefined\n let blend: Blend = { startedAt: 0, duration: 0 }\n let nextStrikeAt: number | undefined\n let strikeCount = 0\n let lastStrike: Strike | undefined\n const pendingThunder: Strike[] = []\n\n const climate = (): Climate => registry.climate(climateId) ?? startClimate\n\n const emit = <TEvent extends keyof WeatherEventMap>(event: TEvent, payload: WeatherEventMap[TEvent]): void => {\n for (const listener of [...(listeners.get(event) ?? [])]) (listener as (value: WeatherEventMap[TEvent]) => void)(payload)\n }\n\n const progressAt = (at: number): number => (blend.duration <= 0 ? 1 : clamp01((at - blend.startedAt) / blend.duration))\n const valuesAt = (at: number): StateValues => blendValues(fromValues, targetValues, progressAt(at))\n\n const scheduleFirstStrike = (atSim: number): void => {\n nextStrikeAt = target.lightning ? atSim + lightning.first(target.lightning) : undefined\n }\n\n const enter = (id: string, atGame: number, atSim: number, blendGameSeconds: number): void => {\n const next = requireState(registry, id)\n fromValues = valuesAt(atGame)\n previousId = target.id\n target = next\n targetValues = valuesOf(next)\n blend = { startedAt: atGame, duration: blendGameSeconds }\n scheduleFirstStrike(atSim)\n emit('transition', { from: previousId, to: id, gameSeconds: atGame })\n }\n\n const strikeAt = (atSim: number, startGame: number, startSim: number): void => {\n const config = target.lightning!\n const place = lightning.place(config)\n const strike: Strike = {\n id: strikeCount++,\n time: atSim,\n gameSeconds: startGame + (atSim - startSim) * timeScale,\n distance: place.distance,\n bearing: place.bearing,\n thunderDelay: thunderDelay(place.distance),\n }\n lastStrike = strike\n pendingThunder.push(strike)\n pendingThunder.sort((a, b) => a.time + a.thunderDelay - (b.time + b.thunderDelay))\n nextStrikeAt = atSim + lightning.interval(config)\n emit('strike', strike)\n }\n\n scheduleFirstStrike(0)\n\n const runEvents = (startGame: number, startSim: number, endSim: number): void => {\n for (;;) {\n const changeSim = isAutoSchedule ? Math.max(startSim, startSim + (scheduler.nextChangeAt() - startGame) / timeScale) : Infinity\n const strikeSim = nextStrikeAt ?? Infinity\n const thunder = pendingThunder[0]\n const thunderSim = thunder ? thunder.time + thunder.thunderDelay : Infinity\n const earliest = Math.min(changeSim, strikeSim, thunderSim)\n if (earliest > endSim) return\n if (earliest === changeSim) {\n const atGame = Math.max(startGame, scheduler.nextChangeAt())\n const next = scheduler.next(target.id, atGame)\n enter(next, atGame, changeSim, climate().blendMinutes * SECONDS_PER_MINUTE)\n } else if (earliest === strikeSim) strikeAt(strikeSim, startGame, startSim)\n else emit('thunder', pendingThunder.shift()!)\n }\n }\n\n const wet = (startGame: number, endGame: number, seconds: number): void => {\n const steps = Math.max(1, Math.ceil(seconds / WETNESS_STEP_SECONDS))\n for (let step = 1; step <= steps; step++) {\n const values = valuesAt(startGame + ((endGame - startGame) * step) / steps)\n wetness.update(seconds / steps, values.wetness, values.dryingScale)\n }\n }\n\n const api: Weather = {\n registry,\n advance(dt) {\n if (!(dt > 0)) return\n const startGame = gameSeconds\n const startSim = simSeconds\n const endGame = startGame + dt * timeScale\n runEvents(startGame, startSim, startSim + dt)\n gameSeconds = endGame\n simSeconds = startSim + dt\n wet(startGame, endGame, dt)\n },\n sample() {\n const values = valuesAt(gameSeconds)\n const dayFraction = dayFractionAt(startHour, gameSeconds)\n const { sun, nightFactor } = daylight(dayFraction)\n const current = climate()\n const temperatureC = current.temperatureC.mean + current.temperatureC.swing * (2 * sun - 1) + values.temperatureDeltaC\n const humidityPercent = clamp01(values.humidity + current.humidityOffset) * 100\n const progress = progressAt(gameSeconds)\n return {\n ...values,\n gameSeconds,\n dayFraction,\n hour: dayFraction * 24,\n nightFactor,\n sun,\n state: target.id,\n previous: progress < 1 ? previousId : undefined,\n blend: progress,\n front: { direction: current.frontDirection, progress },\n windSpeed: Math.sqrt(values.windX * values.windX + values.windZ * values.windZ),\n temperatureC,\n humidityPercent,\n groundWetness: wetness.value(),\n flash: lastStrike ? flashIntensity(simSeconds - lastStrike.time) : 0,\n effects: deriveEffects({ values, nightFactor, temperatureC, humidityPercent, lightningReveal: target.lightning?.reveal ?? 0 }),\n }\n },\n state: () => target.id,\n force(id, blendSeconds = 0) {\n enter(id, gameSeconds, simSeconds, blendSeconds * timeScale)\n scheduler.restart(gameSeconds)\n },\n setTimeScale(next) {\n if (!(next > 0)) throw new Error('game-weather: timeScale must be above 0')\n timeScale = next\n },\n setAutoSchedule(isOn) {\n if (isOn && !isAutoSchedule) scheduler.restart(gameSeconds)\n isAutoSchedule = isOn\n },\n timeline: (hours, sampleMinutes) => createTimeline({ ...options, registry, hours, ...(sampleMinutes === undefined ? {} : { sampleMinutes }) }),\n on(event, listener) {\n const set = listeners.get(event) ?? new Set()\n set.add(listener as (payload: never) => void)\n listeners.set(event, set)\n return () => void set.delete(listener as (payload: never) => void)\n },\n }\n return api\n}\n\nexport type TimelineOptions = WeatherOptions & {\n readonly hours: number\n /** Game minutes between samples. Default 10. */\n readonly sampleMinutes?: number\n}\n\nconst TIMELINE_DECIMALS = 6\nconst round = (value: number): number => Math.round(value * 10 ** TIMELINE_DECIMALS) / 10 ** TIMELINE_DECIMALS + 0\n\n/**\n * What a fresh world does over `hours` game hours, stepping one game minute at a time: the state changes, the strikes (time, distance, bearing) and\n * a sample every `sampleMinutes`. Plain JSON, rounded to 6 decimals, so it can be a golden.\n */\nexport function createTimeline(options: TimelineOptions): WeatherTimeline {\n const weather = createWeather(options)\n const timeScale = options.timeScale ?? DEFAULT_TIME_SCALE\n const sampleMinutes = options.sampleMinutes ?? 10\n const transitions: Array<{ gameSeconds: number; from: string; to: string }> = []\n const strikes: Strike[] = []\n weather.on('transition', (event) => transitions.push({ gameSeconds: round(event.gameSeconds), from: event.from, to: event.to }))\n weather.on('strike', (strike) =>\n strikes.push({ id: strike.id, time: round(strike.time), gameSeconds: round(strike.gameSeconds), distance: round(strike.distance), bearing: round(strike.bearing), thunderDelay: round(strike.thunderDelay) }),\n )\n const samples: Array<Record<string, number | string>> = []\n const record = (minute: number): void => {\n const sample = weather.sample()\n samples.push({\n at: minute * SECONDS_PER_MINUTE,\n hour: round(sample.hour),\n state: sample.state,\n blend: round(sample.blend),\n rain: round(sample.rain),\n windSpeed: round(sample.windSpeed),\n gust: round(sample.gust),\n visibility: round(sample.effects.visibility),\n sightScale: round(sample.effects.sightScale),\n hearingScale: round(sample.effects.hearingScale),\n temperatureC: round(sample.temperatureC),\n heatIndexC: round(sample.effects.heatIndexC),\n heatStress: round(sample.effects.heatStress),\n wetness: round(sample.groundWetness),\n nightFactor: round(sample.nightFactor),\n })\n }\n record(0)\n const minutes = Math.round(options.hours * 60)\n for (let minute = 1; minute <= minutes; minute++) {\n weather.advance(SECONDS_PER_MINUTE / timeScale)\n if (minute % sampleMinutes === 0) record(minute)\n }\n return {\n seed: options.seed ?? 1,\n climate: options.climate ?? 'temperate',\n start: options.start ?? weather.registry.climate(options.climate ?? 'temperate')!.start,\n hours: options.hours,\n sampleMinutes,\n transitions,\n strikes,\n samples,\n }\n}\n","export type WeatherBenchText = {\n readonly group: string\n readonly name: string\n readonly controls: Readonly<Record<'state' | 'transition' | 'time_of_day' | 'auto_schedule' | 'seed', string>>\n readonly hints: Readonly<Record<'transition' | 'time_of_day' | 'auto_schedule' | 'seed', string>>\n readonly options: Readonly<Record<'instant' | 'ten_seconds', string>>\n readonly layers: Readonly<Record<'environment' | 'fog', string>>\n readonly metrics: Readonly<Record<'state' | 'hour' | 'rain' | 'visibility' | 'sight' | 'hearing' | 'wind' | 'heat_index' | 'wetness' | 'strikes' | 'blend' | 'temperature', string>>\n readonly scenarios: Readonly<Record<'storm' | 'blend' | 'determinism' | 'dry_ground', string>>\n /** Names of the states and climates by id; the bench falls back to the id. */\n readonly states: Readonly<Record<string, string>>\n}\n\nconst EN: WeatherBenchText = {\n group: 'Weather',\n name: 'Weather area',\n controls: { state: 'Weather', transition: 'Transition', time_of_day: 'Time of day', auto_schedule: 'Automatic schedule', seed: 'Seed' },\n hints: {\n transition: 'How long the change to the chosen weather takes, in real seconds.',\n time_of_day: 'Hour of the day (the world restarts the clock there and keeps the weather).',\n auto_schedule: 'On: the climate changes the weather by itself and the clock runs 600 times faster than real time. Off: the weather stays until you change it.',\n seed: 'The same seed gives the same schedule and the same lightning.',\n },\n options: { instant: 'At once', ten_seconds: '10 seconds' },\n layers: { environment: 'Write host environment', fog: 'Fog in the scene' },\n metrics: {\n state: 'Weather',\n hour: 'Hour',\n rain: 'Rain',\n visibility: 'Visibility',\n sight: 'Sight scale',\n hearing: 'Hearing scale',\n wind: 'Wind',\n heat_index: 'Heat index',\n wetness: 'Ground wetness',\n strikes: 'Lightning strikes',\n blend: 'Blend',\n temperature: 'Temperature',\n },\n scenarios: {\n storm: 'A storm sees less and is heard less than a clear day, and strikes lightning',\n blend: 'A change blends over its time and settles in the new weather',\n determinism: 'The same seed gives the same day, another seed another one',\n dry_ground: 'Rain wets the ground and it dries after the rain stops',\n },\n states: {\n clear: 'Clear',\n overcast: 'Overcast',\n light_rain: 'Light rain',\n heavy_rain: 'Heavy rain',\n storm: 'Storm',\n fog: 'Fog',\n windy: 'Windy',\n cyclone: 'Cyclone',\n typhoon: 'Typhoon',\n extreme_heat: 'Extreme heat',\n },\n}\n\nconst PT_BR: WeatherBenchText = {\n group: 'Clima',\n name: 'Área de clima',\n controls: { state: 'Clima', transition: 'Transição', time_of_day: 'Hora do dia', auto_schedule: 'Sorteio automático', seed: 'Semente' },\n hints: {\n transition: 'Quanto demora a mudança para o clima escolhido, em segundos reais.',\n time_of_day: 'Hora do dia (o mundo reinicia o relógio nela e mantém o clima).',\n auto_schedule: 'Ligado: o clima do lugar muda sozinho e o relógio corre 600 vezes mais rápido que o real. Desligado: o clima fica até você trocar.',\n seed: 'A mesma semente dá o mesmo sorteio e os mesmos raios.',\n },\n options: { instant: 'De uma vez', ten_seconds: '10 segundos' },\n layers: { environment: 'Escrever no ambiente do host', fog: 'Névoa na cena' },\n metrics: {\n state: 'Clima',\n hour: 'Hora',\n rain: 'Chuva',\n visibility: 'Visibilidade',\n sight: 'Escala de visão',\n hearing: 'Escala de audição',\n wind: 'Vento',\n heat_index: 'Índice de calor',\n wetness: 'Chão molhado',\n strikes: 'Raios',\n blend: 'Mistura',\n temperature: 'Temperatura',\n },\n scenarios: {\n storm: 'Tempestade enxerga e é ouvida menos que um dia limpo, e solta raios',\n blend: 'Uma mudança se mistura no tempo dela e assenta no clima novo',\n determinism: 'A mesma semente dá o mesmo dia, outra semente dá outro',\n dry_ground: 'A chuva molha o chão e ele seca depois que a chuva para',\n },\n states: {\n clear: 'Limpo',\n overcast: 'Nublado',\n light_rain: 'Chuva fraca',\n heavy_rain: 'Chuva forte',\n storm: 'Tempestade',\n fog: 'Neblina',\n windy: 'Ventania',\n cyclone: 'Ciclone',\n typhoon: 'Tufão',\n extreme_heat: 'Calor extremo',\n },\n}\n\nexport const weatherBenchTextOf = (locale: string): WeatherBenchText => (locale === 'en' ? EN : PT_BR)\n","import type { BenchChange, EnvironmentBus, ModuleControl, ModuleHost, ModuleLayer, ModuleMetric, ModuleScenario, TestableModule } from '@adatechnology/game-contracts'\n\nimport { createWeather } from '../weather'\nimport type { Weather, WeatherOptions } from '../weather'\nimport type { Strike, WeatherSample } from '../types'\nimport { weatherBenchTextOf } from './locale'\nimport type { WeatherBenchText } from './locale'\n\nexport type WeatherTestModuleOptions = WeatherOptions & {\n locale?: string\n /** Text of a state id in the game's words; without it the bench uses its own names, then the id. */\n translate?: (key: string, locale: string) => string | undefined\n /** The weather to test (default a new one built from the other options). */\n weather?: Weather\n /** Whether the scene fog follows the weather at first (default true; the layer can be switched either way). A room that is not about weather starts it off. */\n fog?: boolean\n}\n\n/** What the scenarios use of the context the test room passes. */\nexport interface WeatherScenarioLike {\n expect(condition: boolean, label: string, data?: Record<string, unknown>): void\n}\n\nexport type WeatherTestModule = TestableModule<WeatherScenarioLike> & {\n /** The weather in use (replaced when the bench changes the seed or the hour). */\n readonly weather: Weather\n}\n\nconst FAST_SCALE = 600\nconst NORMAL_SCALE = 72\nconst BLEND_SECONDS = 10\nconst HOURS_PER_DAY = 24\nconst FOG_NEAR = 1\n\ntype FogLike = new (color: number, near: number, far: number) => { far: number }\ntype SceneLike = { fog?: unknown }\ntype ThreeLike = { Fog?: FogLike }\n\n/**\n * The weather area of a test room, written against the generic contracts only: it drives a `createWeather` world, writes the result into the host's\n * environment bus (`host.environment`) every frame and shows the numbers a game reads from it. It also sets the scene fog from the weather's render fog.\n * Pure: no three.js beyond the host's own `Fog`, and the sky, rain, lightning and sound wait for the packages that draw and play them.\n */\nexport function createWeatherTestModule(options: WeatherTestModuleOptions = {}): WeatherTestModule {\n const locale = options.locale ?? 'pt-BR'\n const text: WeatherBenchText = weatherBenchTextOf(locale)\n const { locale: _locale, translate, weather: given, fog: _fog, ...weatherOptions } = options\n void _locale\n void _fog\n const state = {\n seed: options.seed ?? 1,\n hour: options.startHour ?? 8,\n transition: 0,\n auto: options.autoSchedule ?? false,\n environment: true,\n fog: options.fog ?? true,\n }\n let host: ModuleHost | null = null\n let strikes = 0\n let offStrike: (() => void) | undefined\n let weather: Weather = given ?? createWeather({ ...weatherOptions, autoSchedule: state.auto, ...(state.auto ? { timeScale: FAST_SCALE } : {}) })\n\n const watch = (): void => {\n offStrike?.()\n offStrike = weather.on('strike', (_strike: Strike) => void (strikes += 1))\n }\n watch()\n\n const nameOf = (id: string): string => translate?.(`weather.${id}`, locale) ?? text.states[id] ?? id\n\n // the world restarts with the new seed or hour and keeps the weather it was in\n const rebuild = (): void => {\n const current = weather.state()\n weather = createWeather({ ...weatherOptions, seed: state.seed, start: current, startHour: state.hour, autoSchedule: state.auto, timeScale: state.auto ? FAST_SCALE : NORMAL_SCALE })\n strikes = 0\n watch()\n }\n\n const toEnvironment = (sample: WeatherSample): Parameters<EnvironmentBus['set']>[0] => ({\n rain: sample.rain,\n windX: sample.windX,\n windZ: sample.windZ,\n windSpeed: sample.windSpeed,\n gust: sample.gust,\n fogFar: sample.fogFar,\n visibility: sample.effects.visibility,\n nightFactor: sample.nightFactor,\n temperatureC: sample.temperatureC,\n wetness: sample.groundWetness,\n })\n\n const applyFog = (far: number): void => {\n const scene = host?.scene as SceneLike | undefined\n const Fog = (host?.THREE as ThreeLike | undefined)?.Fog\n if (!scene || typeof Fog !== 'function') return\n const fog = scene.fog as { far: number } | undefined | null\n if (fog && typeof fog.far === 'number') fog.far = far\n else scene.fog = new Fog(0xa8b4c0, FOG_NEAR, far)\n }\n\n const publish = (): void => {\n const sample = weather.sample()\n if (state.environment) host?.environment?.set(toEnvironment(sample))\n if (state.fog) applyFog(sample.fogFar)\n }\n\n const onChange = (change: BenchChange): void => {\n if (change.kind === 'layer') {\n if (change.id === 'environment' || change.id === 'fog') state[change.id] = change.on\n return\n }\n if (change.kind === 'action') return\n const { id, value } = change\n if (id === 'state' && typeof value === 'string') weather.force(value, state.transition)\n else if (id === 'transition' && typeof value === 'string') state.transition = value === 'instant' ? 0 : BLEND_SECONDS\n else if (id === 'time_of_day' && typeof value === 'number') {\n state.hour = value\n rebuild()\n } else if (id === 'auto_schedule' && typeof value === 'boolean') {\n state.auto = value\n weather.setAutoSchedule(value)\n weather.setTimeScale(value ? FAST_SCALE : NORMAL_SCALE)\n } else if (id === 'seed' && typeof value === 'number') {\n state.seed = value\n rebuild()\n }\n }\n\n const controls = (): ModuleControl[] => [\n { kind: 'choice', id: 'state', name: text.controls.state, options: weather.registry.stateIds().map((id) => ({ id, name: nameOf(id) })), default: weather.state() },\n {\n kind: 'choice',\n id: 'transition',\n name: text.controls.transition,\n hint: text.hints.transition,\n options: [\n { id: 'instant', name: text.options.instant },\n { id: 'ten_seconds', name: text.options.ten_seconds },\n ],\n default: 'instant',\n },\n { kind: 'number', id: 'time_of_day', name: text.controls.time_of_day, hint: text.hints.time_of_day, unit: 'h', min: 0, max: HOURS_PER_DAY - 1, step: 1, default: state.hour },\n { kind: 'boolean', id: 'auto_schedule', name: text.controls.auto_schedule, hint: text.hints.auto_schedule, default: state.auto },\n { kind: 'number', id: 'seed', name: text.controls.seed, hint: text.hints.seed, min: 1, max: 9999, step: 1, default: state.seed },\n ]\n\n const layers = (): ModuleLayer[] => [\n { id: 'environment', name: text.layers.environment },\n { id: 'fog', name: text.layers.fog, default: state.fog },\n ]\n\n const metrics = (): ModuleMetric[] => [\n { id: 'current_state', name: text.metrics.state, read: () => nameOf(weather.state()) },\n { id: 'hour', name: text.metrics.hour, unit: 'h', digits: 1, read: () => weather.sample().hour },\n { id: 'blend', name: text.metrics.blend, digits: 2, read: () => weather.sample().blend },\n { id: 'rain', name: text.metrics.rain, unit: 'mm/h', digits: 1, read: () => weather.sample().rain },\n { id: 'visibility', name: text.metrics.visibility, unit: 'm', digits: 0, read: () => weather.sample().effects.visibility },\n { id: 'sight', name: text.metrics.sight, digits: 2, read: () => weather.sample().effects.sightScale },\n { id: 'hearing', name: text.metrics.hearing, digits: 2, read: () => weather.sample().effects.hearingScale },\n { id: 'wind', name: text.metrics.wind, unit: 'm/s', digits: 1, read: () => weather.sample().windSpeed },\n { id: 'temperature', name: text.metrics.temperature, unit: '°C', digits: 1, read: () => weather.sample().temperatureC },\n { id: 'heat_index', name: text.metrics.heat_index, unit: '°C', digits: 1, read: () => weather.sample().effects.heatIndexC },\n { id: 'wetness', name: text.metrics.wetness, digits: 2, read: () => weather.sample().groundWetness },\n { id: 'strikes', name: text.metrics.strikes, digits: 0, read: () => strikes },\n ]\n\n // each scenario runs its own worlds, so the bench's live one is not touched\n const fresh = (extra: WeatherOptions = {}): Weather => createWeather({ ...weatherOptions, autoSchedule: false, ...extra })\n const run = (world: Weather, seconds: number): void => {\n for (let elapsed = 0; elapsed < seconds; elapsed += 0.5) world.advance(0.5)\n }\n\n const scenarios = (): Array<ModuleScenario<WeatherScenarioLike>> => [\n {\n id: 'storm',\n name: text.scenarios.storm,\n run: ({ expect }) => {\n const clear = fresh({ seed: 3, start: 'clear' })\n const storm = fresh({ seed: 3, start: 'storm' })\n let hits = 0\n storm.on('strike', () => void (hits += 1))\n run(storm, 120)\n const calm = clear.sample().effects\n const rough = storm.sample().effects\n expect(rough.visibility < calm.visibility, 'a storm sees less far', { storm: rough.visibility, clear: calm.visibility })\n expect(rough.hearingScale < calm.hearingScale, 'rain masks sound', { storm: rough.hearingScale, clear: calm.hearingScale })\n expect(hits > 0, 'a storm strikes lightning', { strikes: hits })\n },\n },\n {\n id: 'blend',\n name: text.scenarios.blend,\n run: ({ expect }) => {\n const world = fresh({ seed: 3, start: 'clear' })\n world.force('heavy_rain', 10)\n run(world, 5)\n const middle = world.sample()\n expect(middle.blend > 0 && middle.blend < 1, 'halfway through the change it is still blending', { blend: middle.blend })\n expect(middle.rain > 0 && middle.rain < 15, 'the rain is between the two weathers', { rain: middle.rain })\n run(world, 6)\n expect(world.sample().blend === 1 && world.sample().state === 'heavy_rain', 'after its time it has settled', { blend: world.sample().blend })\n },\n },\n {\n id: 'determinism',\n name: text.scenarios.determinism,\n run: ({ expect }) => {\n const day = (seed: number): string => JSON.stringify(createWeather({ ...weatherOptions, seed }).timeline(48).samples)\n expect(day(5) === day(5), 'the same seed gives the same two days')\n expect(day(5) !== day(6), 'another seed gives another one')\n },\n },\n {\n id: 'dry_ground',\n name: text.scenarios.dry_ground,\n run: ({ expect }) => {\n const world = fresh({ seed: 3, start: 'heavy_rain' })\n run(world, 60)\n const wet = world.sample().groundWetness\n expect(wet > 0.3, 'rain wets the ground', { wetness: wet })\n world.force('clear', 0)\n run(world, 600)\n expect(world.sample().groundWetness < wet, 'it dries after the rain stops', { wet, after: world.sample().groundWetness })\n },\n },\n ]\n\n const module: WeatherTestModule = {\n id: 'weather_area',\n name: text.name,\n group: text.group,\n get weather() {\n return weather\n },\n items: () => [],\n controls: () => controls(),\n layers: () => layers(),\n metrics: () => metrics(),\n scenarios: () => scenarios(),\n attach(lent) {\n host = lent\n const off = lent.bench?.onChange(onChange)\n publish()\n const offFrame = lent.onFrame((dt) => {\n weather.advance(dt)\n publish()\n })\n return () => {\n off?.()\n offFrame()\n host = null\n }\n },\n }\n return module\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,MAAM,mBAA6C;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAC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