WeatherGordion
Weather on 71-Gordion: rain, fog, storms and combined weathers at the Company, with configurable weights and a day that actually passes.WEATHER GORDION
Language / Язык: English · Русский
WEATHER GORDION
Author: Solo00n
71-Gordion is the one moon the game keeps permanently clear. This mod gives it weather — rain, fog, dust, storms, floods, eclipses and every combined weather your modpack registers — with per-weather weights you control, and an optional day that actually passes so progressing weather can run.
WHAT IT DOES
- Weather at the Company — fills Gordion's empty weather pool and takes it out of the blacklist WeatherRegistry ships on every weather by default.
- Per-weather weights — one config line decides what can happen there and how often:
Rainy@120; Foggy@100; Stormy@60. - Combined and progressing weathers — anything registered by WeatherTweaks or Combined Weathers Toolkit works by name:
Stormy + Rainy@40,Eclipsed > Foggy@20. - A day that passes — Gordion has no day cycle in vanilla, which is why progressing weather cannot progress there. RealTime mode starts the game's own clock for the visit.
- A working clock and an end of day — the HUD clock runs (indoors too, where vanilla hides it), and the ship can fly off at midnight like it does on any other moon. Both are optional.
- Nothing else about the moon changes —
planetHasTimeis deliberately left alone, so selling still costs no deadline day, landing late is never refused, and no end-of-round stats screen appears. - Terminal control —
weather changeandweather forecast gordioncome free from WeatherRegistry once the moon has a weather pool. - Leaves your configs alone — changes are made in memory through WeatherRegistry's API;
mrov.WeatherRegistry.cfgis never rewritten.
HOW IT WORKS
Two separate things keep Gordion clear, and both are handled:
- The empty pool. Weather selection reads the moon's
randomWeathersarray, and Gordion's is empty. Clearing the moon filter does not fill it: WeatherRegistry only injects entries for modded weathers, and for a vanilla one it defers to the moon creator — "Vanilla weather not defined by moon creator" — which on Gordion means nothing at all. So the mod writes the pool itself throughWeatherController.AddRandomWeather, immediately before every weather selection, using the same weather variables WeatherRegistry would have used. - The blacklist.
Defaults.DefaultLevelFiltersis the literal string"Company", so every weather ships withLevel filter = Company;under a blacklist — and WeatherRegistry's setup pass actively strips weathers back off the company moon unless the moon is in that weather's apply-list. Correcting the filter is what makes the pool survive a lobby reload.
For time, the obvious lever is the wrong one. planetHasTime does not drive the clock — TimeOfDay.Update only checks currentDayTimeStarted, and the landing sequence reads planetHasTime exactly once to decide whether to set it. What planetHasTime controls everywhere else is the moon's identity: whether leaving burns a deadline day, whether the ship flies off at midnight, whether landing late is refused as "too late on moon", whether the end-of-round stats play, and whether the moon can be drawn for a challenge file. So RealTime mode starts the clock directly and leaves that flag false — Gordion keeps behaving like the Company building in every one of those checks, and every other mod that identifies the Company moon by !planetHasTime keeps working.
One thing leaks through and is patched back: TimeOfDay.MoveGlobalTime drains timeUntilDeadline on every frame regardless of moon. Left alone that would cost you deadline days for selling and shift the company buying rate, so the deadline is held at its pre-landing value for the visit.
Three things go the other way — they sit behind the same planetHasTime check and so never happen at the Company, and the mod supplies them itself: normalizedTimeOfDay (vanilla only updates it inside if (sunAnimator != null), and progressing weather is driven by it), the HUD clock (vanilla drives it from the same guarded block and hides it whenever you count as indoors), and the midnight departure with its warning (the whole branch lives in TimeOfDayEvents behind that flag, so the mod calls the game's own networked SetShipToLeaveOnMidnightClientRpc).
Weather variables get the same treatment. RoundManager.SetToCurrentLevelWeather copies weatherVariable/weatherVariable2 out of the moon's own pool entry, and the effects read them from there — Flooded computes its water rise as globalTime / 1080 * weatherVariable2. Gordion has no authored entries, so the mod borrows the numbers from a moon that does define the weather rather than injecting zeroes, which is what a flood that sits at world height 0 and never rises looks like.
MULTIPLAYER (HOST-AUTHORITATIVE)
Nothing here gives a player an edge, and nothing here invents its own netcode. Every decision that affects the round is made once, by the host, and travels on a channel the game or WeatherRegistry already owns.
Decided by the host, synced by existing code
- Which weather Gordion gets, and every
weather change, are WeatherRegistry's own — it syncs them itself. - Progression stages in Simulated mode are stepped by the host only, and applied through the same call the terminal command uses, so the sync comes for free.
- The end-of-day departure calls the game's own
SetShipToLeaveOnMidnightClientRpc. CallingShipLeaveAutomaticallydirectly on the host instead would have left everyone else standing on the moon. - Lightning targets are rebuilt on the host only.
StormyWeather's targeting loop already returns early on anyone who is not the owner, so a client rebuilding the list would both waste a scene sweep per player and disagree with the host about what may be struck.
Computed locally, but from inputs everyone shares
The clock is started on each machine that has the mod, from the same server-synced globalTime. The day offset is set to a flat zero rather than to anything captured at landing — a value derived from the local clock would be taken at whatever moment each machine noticed the ship had landed, and every player would end up on a slightly different time of day. Same inputs, same arithmetic, same time on every screen.
The weather pool is built on every machine, not just the host, and that is deliberate. WeatherRegistry syncs the choice of weather but not the numbers behind it: each client runs RoundManager.SetToCurrentLevelWeather from its own level generation and copies weatherVariable/weatherVariable2 out of its own pool entry. A client whose Gordion pool was empty would find no entry, keep whatever those fields held before, and get the flood at a different height and the fog at a different density than the host — the same weather, a different world. The pool is therefore rebuilt immediately before that read, on every player, on every landing.
For the same reason the variables are borrowed from a vanilla moon in preference to a modded one. Everyone has the vanilla moon list in the same order, so host and clients settle on the same donor even when their moon mods differ.
Playing with someone who does not have the mod
They still get the right weather: it is chosen and synced host-side. They just will not see the Gordion clock, and their game will not draw the weather stages any differently. Nothing about this changes loot, prices, spawns or the quota for anyone — the deadline is explicitly held still while the clock runs, precisely so a selling trip cannot become cheaper or more expensive than it is in vanilla.
REQUIREMENTS
- BepInEx 5.4.21+
- WeatherRegistry 0.8.8+ and MrovLib 0.4.15+ (required)
- WeatherTweaks (optional) — needed for combined and progressing weathers
- Combined Weathers Toolkit (optional) — register your own combinations without code
INSTALLATION
Install through a mod manager, or drop WeatherGordion.dll into BepInEx/plugins.
CONFIGURATION
BepInEx/config/Timofey.WeatherGordion.cfg
| Section | Setting | Default | What it does |
|---|---|---|---|
| 1. General | Enabled |
true |
Master switch. |
| 1. General | DebugMode |
false |
Logs every unlock, weight write and time transition. |
| 2. Weathers | Weather weights |
see below | Name@Weight pairs, semicolon separated. Weight 0 removes a weather this mod added. |
| 2. Weathers | Clear weather weight |
200 |
How often Gordion stays clear. 0 guarantees weather every visit. |
| 2. Weathers | Respect existing config |
true |
Skip weathers you already gave a Gordion weight by hand. |
| 3. Time | Gordion time mode |
RealTime |
Off, RealTime or Simulated. |
| 3. Time | Freeze deadline on Gordion |
true |
Hold the quota deadline still while the clock runs. |
| 3. Time | Ship leaves at end of day |
true |
RealTime only. Ship departs at midnight, with the usual 90% warning. |
| 3. Time | Show clock on Gordion |
true |
Show the HUD clock during the visit, indoors included. |
| 3. Time | Day length seconds |
1200 |
Simulated only: real seconds per Gordion day. |
Default weather line:
Rainy@120; Foggy@100; Stormy@60; Flooded@40; Eclipsed@50
Names are the ones WeatherRegistry uses for its config section titles, so combined weathers work the same way:
Rainy@120; Stormy + Rainy@40; Eclipsed > Foggy@20
Weathers you list that are not registered are reported by name in the log on startup, so a typo is easy to spot.
Time modes. RealTime starts the game clock for the visit and is the mode that makes progressing weather and the rising Flooded water work. Simulated never touches the game clock at all — it writes the normalised time itself, draws the HUD clock by hand and steps weather stages on its own timer. Use it if RealTime ever upsets another mod. Off keeps Gordion timeless: weather is picked on landing and holds for the visit, which is enough for plain and combined weathers.
INTEGRATIONS / COMPATIBILITY
- WeatherTweaks / Combined Weathers Toolkit — reached through reflection, never referenced, so the mod loads and works without them.
- FirstDayGordion, MonstersGordion, RandomDelivery — unaffected. Because
planetHasTimestays false, anything identifying the Company moon by that flag, or branching on it, behaves exactly as before. - Generic Gordion Overhaul — asset-only, no conflict; its extra outdoor space makes weather considerably more visible.
- Other mods that add weather to Gordion — only weathers this mod added are ever removed, so nothing else's entries are touched.
KNOWN LIMITS
- Eclipsed does not darken the sky. WeatherRegistry blacklists the Company sun-animator controller (
SunAnimContainerCompanyLevel) and skips lighting overrides there. The weather is active and everything else about it applies; the sky just stays as it is. This is upstream behaviour, not something this mod can set. - Scrap multipliers have no visible effect. WeatherRegistry's multipliers belong to the weather, not the moon, so they already apply on Gordion — but Gordion has
spawnEnemiesAndScrap = falseand spawns no loot for them to act on. They are not a sell-price modifier. If another mod does spawn scrap there, they apply normally. - Flooded rises only in RealTime. The water level is a function of the game's
globalTime, which only advances while the real clock runs, so inOffandSimulatedmodes it stays where it starts.
BUILD
dotnet build -c Release
.\build-package.ps1 # Thunderstore zip in dist/
.\build-package.ps1 -Deploy # ...and drop the DLL into the dev profile
CREDITS
- mrov — WeatherRegistry, WeatherTweaks and MrovLib, which do all the real weather work.
- Zigzag — Combined Weathers Toolkit.
- Zeekerss — Lethal Company.
WEATHER GORDION
Автор: Solo00n
71-Gordion — единственная луна, на которой игра принципиально держит ясную погоду. Мод даёт ей погоду: дождь, туман, пыль, грозы, потоп, затмение и любые комбинированные погоды, зарегистрированные в вашем модпаке, — с настраиваемыми весами и опциональным ходом времени, чтобы работала прогрессирующая погода.
ЧТО ДЕЛАЕТ МОД
- Погода на Гордионе — заполняет пустой пул погод луны и убирает её из чёрного списка, который WeatherRegistry по умолчанию ставит каждой погоде.
- Веса по каждой погоде — одна строка конфига решает, что и как часто там бывает:
Rainy@120; Foggy@100; Stormy@60. - Комбинированные и прогрессирующие — всё, что зарегистрировали WeatherTweaks или Combined Weathers Toolkit, работает по имени:
Stormy + Rainy@40,Eclipsed > Foggy@20. - Идущее время — в ваниле на Гордионе нет смены суток, поэтому прогрессирующая погода там не может прогрессировать. Режим RealTime запускает штатные часы игры на время визита.
- Рабочие часы и конец дня — часы в HUD идут (в том числе внутри здания, где ваниль их прячет), а корабль может улетать в полночь, как на любой другой луне. И то и другое отключаемо.
- Больше на луне ничего не меняется —
planetHasTimeсознательно не трогается: продажа не съедает день дедлайна, посадку поздним вечером не запрещают, экран итогов дня не появляется. - Управление из терминала —
weather changeиweather forecast gordionначинают работать сами, как только у луны появляется пул погод. - Ваши конфиги не переписываются — все изменения делаются в памяти через API WeatherRegistry;
mrov.WeatherRegistry.cfgостаётся нетронутым.
КАК ЭТО РАБОТАЕТ
Ясную погоду на Гордионе держат две независимые вещи, и обе закрыты:
- Пустой пул. Выбор погоды читает массив
randomWeathersлуны, а у Гордиона он пуст. Очистки фильтра для этого мало: WeatherRegistry сам добавляет записи только для модовых погод, а для ванильных полагается на автора луны — «Vanilla weather not defined by moon creator», — что для Гордиона означает «ничего». Поэтому мод пишет пул сам черезWeatherController.AddRandomWeatherпрямо перед каждым выбором погоды, с теми же переменными эффекта, которые взял бы WeatherRegistry. - Чёрный список.
Defaults.DefaultLevelFilters— это буквально строка"Company", поэтому каждая погода получаетLevel filter = Company;в режиме чёрного списка, а setup-проход WeatherRegistry ещё и вырезает погоды с луны Компании, если её нет в списке применения. Правка фильтра — это то, что позволяет пулу пережить перезаход в лобби.
Со временем очевидный рычаг оказался неправильным. planetHasTime не управляет часами: TimeOfDay.Update смотрит только на currentDayTimeStarted, а последовательность посадки читает planetHasTime ровно один раз — чтобы решить, выставлять ли этот флаг. Зато во всех остальных местах planetHasTime определяет идентичность луны: списывается ли день дедлайна при отлёте, улетает ли корабль в полночь, не запретят ли посадку с формулировкой «too late on moon», играет ли экран итогов дня и может ли луна выпасть в challenge-файле. Поэтому RealTime запускает часы напрямую и оставляет флаг в false — Гордион остаётся Гордионом во всех этих проверках, а любой другой мод, опознающий Компанию по !planetHasTime, продолжает работать.
Одна вещь всё же протекает и возвращается патчем: TimeOfDay.MoveGlobalTime вычитает прошедшее время из timeUntilDeadline независимо от луны. Без вмешательства продажа стоила бы вам дней дедлайна и двигала бы курс скупки Компании, поэтому дедлайн удерживается на значении до посадки.
Три вещи, наоборот, приходится доделывать самим — они спрятаны за той же проверкой planetHasTime и на Компании не происходят никогда: normalizedTimeOfDay (ваниль обновляет его только внутри if (sunAnimator != null), а именно от него зависит прогрессирующая погода), часы в HUD (ваниль рисует их из того же блока и прячет, как только вы считаетесь «внутри») и полуночный отлёт с предупреждением (вся ветка живёт в TimeOfDayEvents за этим флагом, поэтому мод вызывает штатный сетевой SetShipToLeaveOnMidnightClientRpc игры).
С переменными погоды та же история. RoundManager.SetToCurrentLevelWeather копирует weatherVariable/weatherVariable2 из записи пула самой луны, и эффекты читают их оттуда — Flooded считает подъём воды как globalTime / 1080 * weatherVariable2. У Гордиона своих записей нет, поэтому мод заимствует числа у луны, где эта погода описана, вместо того чтобы подставлять нули — а нули выглядят ровно как вода на высоте 0, которая никуда не поднимается.
МУЛЬТИПЛЕЕР (HOST-AUTHORITATIVE)
Мод не даёт никому преимущества и не изобретает собственный нетворкинг. Всё, что влияет на раунд, решается один раз на хосте и едет по каналу, который уже есть у игры или у WeatherRegistry.
Решает хост, синхронизирует существующий код
- Какая погода будет на Гордионе и любые
weather change— это WeatherRegistry, он синхронизирует их сам. - Стадии прогрессии в режиме Simulated переключает только хост, применяя их тем же вызовом, что и терминальная команда, — синхронизация достаётся бесплатно.
- Отлёт в конце дня идёт через штатный
SetShipToLeaveOnMidnightClientRpcигры. Прямой вызовShipLeaveAutomaticallyна хосте оставил бы всех остальных стоять на луне. - Список целей для молний пересобирает только хост. Цикл наведения в
StormyWeatherи так выходит на первой же строке у всех, кроме владельца, поэтому клиент тратил бы сканирование сцены впустую и расходился бы с хостом в том, по чему можно бить.
Считается локально, но из общих для всех данных
Часы запускаются на каждой машине с модом, но от одного и того же серверного globalTime. Смещение дня выставляется в ноль, а не в значение, снятое при посадке: величина, взятая от локальных часов, фиксировалась бы в тот момент, когда конкретная машина заметила посадку, и у каждого игрока было бы своё время суток. Одинаковые входные данные, одинаковая арифметика, одинаковое время на всех экранах.
Пул погод собирается на каждой машине, а не только на хосте, и это сделано намеренно. WeatherRegistry синхронизирует выбор погоды, но не числа за ним: каждый клиент вызывает RoundManager.SetToCurrentLevelWeather из своей генерации уровня и копирует weatherVariable/weatherVariable2 из своей же записи пула. Клиент с пустым пулом Гордиона не нашёл бы записи, оставил бы в этих полях прежние значения и получил бы воду на другой высоте, а туман — другой плотности, чем у хоста: погода та же, мир разный. Поэтому пул пересобирается прямо перед этим чтением, у каждого игрока, при каждой посадке.
По той же причине переменные заимствуются в первую очередь у ванильной луны, а не у модовой. Ванильный список лун одинаков и в одном порядке у всех, поэтому хост и клиенты выбирают один и тот же источник даже при разном наборе модов на луны.
Если у кого-то мода нет
Погоду он всё равно получит правильную — её выбирает и синхронизирует хост. Он просто не увидит часы на Гордионе. Ни на лут, ни на цены, ни на спавн, ни на квоту это не влияет ни для кого: дедлайн намеренно удерживается на месте, пока идут часы, именно чтобы визит за продажей не стал дешевле или дороже, чем в ваниле.
ЗАВИСИМОСТИ
- BepInEx 5.4.21+
- WeatherRegistry 0.8.8+ и MrovLib 0.4.15+ (обязательные)
- WeatherTweaks (опционально) — нужен для комбинированных и прогрессирующих погод
- Combined Weathers Toolkit (опционально) — регистрация своих комбинаций без кода
УСТАНОВКА
Через менеджер модов либо положить WeatherGordion.dll в BepInEx/plugins.
НАСТРОЙКА
BepInEx/config/Timofey.WeatherGordion.cfg
| Секция | Параметр | По умолчанию | Что делает |
|---|---|---|---|
| 1. General | Enabled |
true |
Общий выключатель. |
| 1. General | DebugMode |
false |
Логирует каждую разблокировку, запись веса и переход времени. |
| 2. Weathers | Weather weights |
см. ниже | Пары Имя@Вес через точку с запятой. Вес 0 убирает погоду, добавленную этим модом. |
| 2. Weathers | Clear weather weight |
200 |
Как часто на Гордионе остаётся ясно. 0 — погода гарантирована каждый визит. |
| 2. Weathers | Respect existing config |
true |
Не трогать погоды, которым вы уже задали вес для Гордиона вручную. |
| 3. Time | Gordion time mode |
RealTime |
Off, RealTime или Simulated. |
| 3. Time | Freeze deadline on Gordion |
true |
Удерживать дедлайн квоты, пока идут часы. |
| 3. Time | Ship leaves at end of day |
true |
Только RealTime. Корабль улетает в полночь, с обычным предупреждением на 90% дня. |
| 3. Time | Show clock on Gordion |
true |
Показывать часы в HUD во время визита, в том числе в помещении. |
| 3. Time | Day length seconds |
1200 |
Только Simulated: реальных секунд на сутки Гордиона. |
Строка погод по умолчанию:
Rainy@120; Foggy@100; Stormy@60; Flooded@40; Eclipsed@50
Имена — те же, что в заголовках секций mrov.WeatherRegistry.cfg, поэтому комбинированные пишутся так же:
Rainy@120; Stormy + Rainy@40; Eclipsed > Foggy@20
Погоды, которых нет в реестре, перечисляются по именам в логе при запуске — опечатку видно сразу.
Режимы времени. RealTime запускает игровые часы на визит: именно в нём работают прогрессирующая погода и подъём воды у Flooded. Simulated вообще не трогает игровые часы — сам пишет нормализованное время, сам рисует часы в HUD и сам переключает стадии по своему таймеру; пригодится, если RealTime когда-нибудь поссорится с другим модом. Off оставляет Гордион вне времени: погода выбирается при посадке и держится весь визит — этого достаточно для обычных и комбинированных погод.
ИНТЕГРАЦИИ И СОВМЕСТИМОСТЬ
- WeatherTweaks / Combined Weathers Toolkit — через рефлексию, без ссылок на сборки: мод грузится и работает и без них.
- FirstDayGordion, MonstersGordion, RandomDelivery — не затронуты. Так как
planetHasTimeостаётсяfalse, всё, что опознаёт Компанию по этому флагу или ветвится на нём, ведёт себя как раньше. - Generic Gordion Overhaul — только ассеты, конфликта нет; его дополнительное открытое пространство делает погоду заметно виднее.
- Другие моды, добавляющие погоду на Гордион — удаляются только погоды, добавленные этим модом, чужие записи не трогаются.
ИЗВЕСТНЫЕ ОГРАНИЧЕНИЯ
- Eclipsed не затемняет небо. WeatherRegistry держит контроллер солнца Компании (
SunAnimContainerCompanyLevel) в чёрном списке и пропускает там переопределение освещения. Погода активна, всё остальное применяется — небо просто остаётся прежним. Это поведение самого WeatherRegistry, снаружи оно не настраивается. - Множители лута ничего не дают. Множители WeatherRegistry принадлежат погоде, а не луне, поэтому на Гордионе они уже применяются — но у Гордиона
spawnEnemiesAndScrap = false, и действовать им не на что. Это не модификатор цены продажи. Если лут на Гордионе спавнит другой мод, множители сработают штатно. - Flooded поднимает воду только в RealTime. Уровень воды — функция игрового
globalTime, который движется лишь при идущих часах, поэтому в режимахOffиSimulatedон остаётся начальным.
СБОРКА
dotnet build -c Release
.\build-package.ps1 # zip для Thunderstore в dist/
.\build-package.ps1 -Deploy # ...и положить DLL в дев-профиль
БЛАГОДАРНОСТИ
- mrov — WeatherRegistry, WeatherTweaks и MrovLib, на которых держится вся погода.
- Zigzag — Combined Weathers Toolkit.
- Zeekerss — Lethal Company.
