@ 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 }) })。 。 。 .