From e74bd915a7fa25ba23ba55926844a978c44c8df1 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Sun, 13 Sep 2026 19:30:10 +0800 Subject: [PATCH] doc(AGENTS): update AGENTS.md --- AGENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 30ab709..457d339 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -147,6 +147,8 @@ The sync is implemented as an inline PowerShell `Exec` step inside the `ZipMod` - **Internationalization:** `UXAssist/Common/I18N.cs` provides bilingual (EN + ZH) string lookup used across UXAssist and CheatEnabler. Localization keys are declared as `public const string` in per-project registration classes (`UXAssist/Common/I18NKeys.cs`, `CheatEnabler/Localization.cs`, `UniverseGenTweaks/Localization.cs`) and registered through a single `Register()` call from each mod's `Awake()`. Do not pass Chinese string literals to `.Translate()` at call sites. - **Centralized game constants:** Hard-coded item IDs, tech IDs, logistics capacities, and Dyson sphere geometry defaults live in `UXAssist/Common/GameConstants` (`ItemIds`, `TechIds`, `LogisticsConstants`, `DysonSphereConstants`). Prefer these constants over inline literals in UXAssist patches. - **Game source facts:** In the original DSP `Assembly-CSharp.dll`, `PlanetFactory.prebuildCount` is computed as `prebuildCursor - prebuildRecycleCursor - 1`, and normal prebuild add/remove paths maintain those cursors. If Auto Construct UI reports zero while visible construction ghosts exist, first suspect the wrong planet/factory, non-prebuild preview state, or a missed UI refresh path before replacing this property with a pool scan. +- **Production statistics cursor layout:** In the original DSP `Assembly-CSharp.dll`, each `ProductStat.cursor` has 12 ring-buffer write pointers over `count[7200]`. Fresh initialization sets `cursor[i] = i * 600`; indices `0..5` are production levels and `6..11` are consumption levels. The level tick intervals are `1, 6, 60, 360, 3600, 36000`, corresponding to `1/60` second, `0.1` second, `1` second, `6` seconds, `1` minute, and `10` minutes per ring sample at 60 game ticks per second. Because each ring has 600 samples, the UI exposes levels 1-5 as 1-minute, 10-minute, 1-hour, 10-hour, and 100-hour history windows, plus the total view through `total[1..6]` for production and `total[8..13]` for consumption. +- **Production statistics reference rate:** In the original DSP `Assembly-CSharp.dll`, the production panel's `参考速率`/`Reference Rate` is read from `ProductStat.refProductSpeed`, not from `cursor`, `count`, or `total`. `ProductionExtraInfoCalculator.CalculateFactory` recomputes it from powered facilities, recipe speed, recipe item counts, proliferator mode, mining speed, and other facility-specific rates; `UIProductEntry.UpdateExtraProductTexts` sums the field across the factories selected by the current planet/star/cluster filter and formats it with `ProductionExtraInfoCalculator.RefSpeedToString`. The value is an ideal rate in items per minute and may be stale or zero until the extra-info calculator runs. - **Immediate-build shield initialization:** `PlanetATField.physicsArgs` starts as `null` and is allocated by the first physics-shape recalculation. If CheatEnabler completes the first Planetary Shield Generator synchronously from a build-tool callback, `UIPlanetShieldDetail` can observe `fieldGenerators.count > 0` before that recalculation and dereference the null array. `CargoTrafficPatch.EndBatchBuilding` restores the invariant once per batch by calling `planetATField.UpdatePhysicsShape(true)` when field generators exist but `physicsArgs` is still null. - **Immediate-build beacon timing:** Signal Towers do not share the Planetary Shield initialization race. `DataPool.Add()` resets the value-type component, `NewBeaconComponent` synchronously assigns its entity and already-created power-node IDs, and no UI opens from `beacons.count` or reads tick-created resources. Holo Beacons use `MarkerComponent`; `NewMarkerComponent` also initializes and registers their UI-visible state synchronously. - **Illegal Dyson shell generation:** Estimated triangle vertex counts mirror the original `DysonShell.GenerateGeometry` rasterization as closely as possible, but can still differ from the final frame-generated shell polygon at numerical boundaries. Max-output generation must treat `QuickAddDysonShell` failure as a candidate rejection and try the next candidate rather than assuming the estimate is exact.