@adatechnology/game-weather

中文文档
0.3.15发布于 2026/11/08MITTypeScriptES Module构建来源已验证近 30 天下载 2579

纯正,为游戏所播种的天气:状态(晴至台风),游戏时间有马可夫排程器的气候,从西部走出前锋,有雷电延迟的闪电,地湿,游戏玩法效果,热指数和昼夜公式. 一无所知任何克

中文使用文档
文档目录7 节
  1. 安装
  2. 使用量
  3. 登记:添加、补丁、去除
  4. 决定主义
  5. API 密码
  6. 葡萄牙
  7. 桥梁

@ adatech/ game- 天候

纯正,为游戏所播种的天气:从晴朗到台风的状态,在游戏时间它们之间移动的气候,有雷电延迟的闪电, 地面湿度,天气对视觉,听觉和脚步意味着什么,热指数和昼夜配方,以及推动它的桥梁 流体胶片,可交互性,植被,影响世界,环境总线和声音. 没有 3.js 和游戏内容; 渲染器 读取. 取决于 game-contracts 财务报告和审定财务报表 game-audio (雨,风和雷的食谱);在浏览器和节点工作.

数字来自各小组的网页(每个州都列出其 sources:VFX车间的雨,雾和闪电,干湿雾和 游戏的一天,艺术场景的风和雾,瓦莱·辛岑托画廊的雨规则. 气旋、台风和极端高温没有队伍 源和物理预设值(在 temperate (气候).

  • 常道出世为先. 每个气候开始 clear;没有什么与爆发有关.
  • 国家 (单位:千美元)WEATHER_STATES: clear, (中文(简体) ), overcast, (中文(简体) ), light_rain, (中文(简体) ), heavy_rain, (中文(简体) ), storm, (中文(简体) ), fog, (中文(简体) ), windy, (中文(简体) ), cyclone, (中文(简体) ), typhoon, (中文(简体) ), extreme_heat。 。 。 .
  • 气候 (单位:千美元)CLIMATES: temperate (大部分是清晰和被覆盖,没有极端,默认)和 tropical (极端罕见并启用). 一个种子马可夫链在游戏时间:每个州持续2至6个游戏小时,一个变化混合了10个游戏分钟,前锋从西部到达.
  • 闪电 拥有自己的种子流( 服务器发送种子, 每个客户端都看到相同的打击): 风暴后第一次攻击 2 至 4 s 开始,然后每3.5到6秒, 讲习班的双闪光,雷电 distance / 343 几秒钟后.
  • 湿度 随雨水而起,在雨停后会干180 s (在极端高温时会变快).
  • 效果数字 : visibility, (中文(简体) ), sightScale (游戏的天气) 1 - 0.4 × night, (中文(简体) ), hearingScale, (中文(简体) ), footstepScale, (中文(简体) ), heatIndexC (诺阿) 罗斯福斯, heatStress (在27,32,41和54°C带上为0.1),, lightningReveal, (中文(简体) ), dryingScale, (中文(简体) ), debrisPush。 。 。 .
  • 白天和晚上: 游戏的公式(daylight),默认为20分钟timeScale 联合国.

安装

pnpm add @adatechnology/game-weather

没有捆绑的浏览器( 全局为 GameWeather:

<script src="https://unpkg.com/@adatechnology/game-weather/dist/index.global.js"></script>
<script>
  const weather = GameWeather.createWeather({ seed: 7 })
</script>

使用量

import { createWeather } from '@adatechnology/game-weather'

const weather = createWeather({ seed: 7, climate: 'tropical' }) // starts clear, 8:00, a 20-minute day
weather.on('strike', (strike) => flash(strike.bearing))
weather.on('thunder', (strike) => playThunder(strike.distance))
weather.on('transition', ({ from, to }) => log(`${from} -> ${to}`))

// every frame, with real seconds
weather.advance(dt)
const sample = weather.sample()
sample.rain // mm/h, blended between states
sample.windX // m/s
sample.nightFactor // 0 day, 1 night
sample.groundWetness // 0..1
sample.effects.hearingScale // multiply a listener's radius by this
sample.front // { direction: [1, 0], progress } — the curtain moves along +x

weather.force('storm', 10) // blend to a storm over 10 real seconds
weather.timeline(72) // what a fresh world does in 72 game hours (plain JSON, a golden)

登记:添加、补丁、去除

import { createWeather, WEATHER_STATES } from '@adatechnology/game-weather'

const weather = createWeather({
  states: [{ ...WEATHER_STATES[2]!, id: 'drizzle', sources: ['my game'], rain: 0.5, drops: 300 }],
  patch: { states: { storm: { rain: 90, lightning: { interval: [2, 4] } } }, climates: { temperate: { dwellHours: [1, 3] } } },
  remove: { states: ['fog'] }, // nothing schedules it any more
})
weather.registry.patchState('heavy_rain', { visibility: 100 }) // later, with the same verbs

决定主义

时间表和闪电从不同的被播种的溪流中引出(streamSeed(seed, 'schedule' | 'lightning')),所以打击永远不要移动 列表和结果不取决于步骤大小 advance 被调用. createTimeline 一步一步的游戏分钟 与22号和24号节点上的金子对比.

API 密码

从软件包根导出所有东西; 见 src/*.ts 对于医生的评论。 单位:米,秒,毫米/小时,摄氏度;风能以米/秒为单位.

葡萄牙

Clima puro e deminístico por semente: 双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双相双足双足双足双足双足双足双足双足双足双足双足双足双足双足双足双相相相相相相相相 atraso do trovão, solo molhado, o que o temp musta para vião, audição e passos, índice de calor e a fórmula de dia e noite do jogo. 中国植物物种信息数据库. 三号线, sem som, sem conteúdo de jogo: quem desenha e quem toca lê daqui. 中国植物物种信息数据库. 卡达埃斯塔多特雷斯 sources com a origem dos números (Oficina de VFX, jogo, Cena de) 互联网档案馆的存檔,存档日期2013-12-02 Arte, Galleria do Vale Cinzento; ciclone, tufão e calor intenso não têm 时间字体 e são predefinições físicas, desligadas no clima 互联网档案馆的存檔,存档日期2013-12-21 temperate。 。 。 .

  • O mondo 正常的 vem pimiro: 做 Clima comça em clear。 。 。 .
  • 约高岛6号公路 约高岛10分公路.
  • (一) Relâmpago com contento próprio de smente distância / 343 {\fn黑体\fs22\bord1\shad0\3ahbe\4ah00\fscx67\fscy66\2chffffff\3ch808080}是的 {\fn黑体\fs22\bord1\shad0\3ahbe\4ah00\fscx67\fscy66\2chffffff\3ch808080}是的.
  • O solo seca 180 s depois que a chuva para; 单声道180 s s depois que a chuva para; 单声道180 s; effects 龙卷风 sightScale, (中文(简体) ), hearingScale, (中文(简体) ), footstepScale卡路里卡路里卡路里卡路里卡路里.
  • Catálogo por registro: 地亩集成地,地块花(patch轮胎相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相接相相接相接相接相接相相接相接相相接相相相相接相接相相相接相相接相接相相接相接相相接相相相接相相相相相相接相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相.

桥梁

createWeatherBridges(targets, options) 把天气推向任何你给它。 每个目标都是可选的,而且是自己的接口,所以 天气没有导入它驱动的软件包 :

import { createWeatherBridges } from '@adatechnology/game-weather'

const bridges = createWeatherBridges({
  film: room.film, // game-fluids-three FilmBridge: setWeather({ rain, drying }), wash()
  interactables: world, // game-interactables: water.setRain(mm/h), setWind(x, z)
  vegetation, // game-vegetation: setWind({ direction, strength, gust })
  vfx: vfxWorld, // game-vfx: setWind([x, 0, z])
  environment: host.environment, // the EnvironmentBus
  audio: host.audio, // rain and wind loops, thunder
})
bridges.bind(weather)
// every frame, after weather.advance(dt)
bridges.update(dt)

规则是数字,你可以改变(filmRainFullAt, (中文(简体) ), washFrom, (中文(简体) ), washBelow, (中文(简体) ), washEvery, (中文(简体) ), windFull:小雨(2.5毫米/小时)停止干燥并 ; 暴雨(15毫米/小时)和更强烈地将新鲜的污物(不到一半干燥)洗一秒钟; 极端热干燥两倍快 植被 strength 实值 min(1, speed / 20)。 。 。 .

声音 : WEATHER_BANK 持有 rain_loop 财务报告和审定财务报表 wind_loop (艺术场景), rain_hiss_game (游戏)和 thunder。 。 。 . createWeatherSound 设置雨环 从0.035(轻雨)到0.06(重雨),风圈在微风中为0.05并和速度成正比,在出击时打出雷声 到达时显示(distance / 343 s 在闪光后). options.sound 更改样式( e)art_scene 或者说 game),等级和收听者.

图片是 @adatechnology/game-weather-three。长椅把它当作 visual 联合国 WeatherVisualFactory数字 : layers(locale) 在房间借东西之前 create({ host, locale, weather }) 返回时 { update(dt), setLayer(id, on), dispose() }将场景的雾留给它: createWeatherTestModule({ visual: createWeatherVisual({ vfx: room.vfx }) })。 。 。 .

版本与发布记录

@adatechnology/game-weather 共发布 29 个版本,首次发布于 2026/10/24;过去 12 个月发布了 29 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.15latest2026/11/08今天
0.3.142026/11/07今天
0.3.132026/11/07今天
0.3.122026/11/07今天
0.3.112026/11/07今天
0.3.102026/11/07今天

关于 @adatechnology/game-weather 的常见问题

@adatechnology/game-weather 是什么?

纯正,为游戏所播种的天气:状态(晴至台风),游戏时间有马可夫排程器的气候,从西部走出前锋,有雷电延迟的闪电,地湿,游戏玩法效果,热指数和昼夜公式. 一无所知任何克

如何安装 @adatechnology/game-weather?

在项目目录运行 npm install @adatechnology/game-weather,或使用 pnpm add / yarn add / bun add。

@adatechnology/game-weather 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@adatechnology/game-weather 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adatechnology/game-weather 可以商用吗?

@adatechnology/game-weather 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adatechnology/game-weather 的下载量有多少?

根据 npm 官方下载统计,@adatechnology/game-weather 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,579 次,日均约 86 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adatechnology/game-weather 还在维护吗?

最新版本 0.3.15 发布于 2026/11/08(今天);至今共发布 29 个版本,其中过去 12 个月发布了 29 个;首次发布于 2026/10/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。