feat(uxassist): generate blueprint production descriptions

Add native blueprint description generation with proliferation controls, separate power categories, and steady-state material and research reporting.

Distinguish necessary coproducts from overbuild and fractional headroom, with regression checks and updated architecture documentation.

Validation: 464 ProductionCheck checks and Release builds of UXAssist, CheatEnabler, and UniverseGenTweaks.
This commit is contained in:
soarqin committed 2026-10-11 03:13:07 +08:00
1 parent 8696a80a66
commit 307bb4740d
16 files changed
+2294 -51

No files matched your search

+186
View File
@@ -0,0 +1,186 @@
# UXAssist Automatic Blueprint Description Plan
Status: Updated implementation specification, September 27, 2026.
The maintained production reference is [ProductionArchitecture.md](ProductionArchitecture.md). This document records the current behavior and acceptance criteria for the automatic blueprint description.
Keep shared production changes focused on this feature, update affected callers and tests, and preserve existing full-load accounting.
## 1. Confirmed Behavior and Display
Add an **Auto-fill description** button and a **Proliferation** checkbox to the shared blueprint inspector used in browser, copy, and paste modes. Place the checkbox immediately to the right of the button in one compact row above every description box, including the smaller description fields and the main description. On generation, replace the existing main description text with nonempty missing, excess, input, output, and research lines; use at most one native custom field for power. Preserve the author, version, short description, and unrelated custom fields.
| Purpose | English label | Simplified Chinese label | Value format |
| --- | --- | --- | --- |
| Generate or update | Auto-fill description | `自动填写说明` | Button |
| Calculation setting | Proliferation | `增产` | Checkbox |
| Optional power field | Power | `耗电` | Present factory and/or logistics consumption only |
| Description missing line | Missing: | `缺少:` | Intermediate shortages, with the label shown only once |
| Description excess line | Excess: | `多余:` | True overbuild, with the label shown only once |
| Description input line | Input: | `输入:` | External inputs only, at estimated steady-state rates |
| Description output line | Output: | `输出:` | Ordinary final products and necessary coproduct surplus |
| Description research line | Research: | `研究:` | Net positive matrix output accepted by selected research-mode labs |
The Chinese power example is `工厂耗电 2.5GW | 物流耗电 600MW` when both categories consume power. Omit a category without consumption; if neither consumes power, do not create the power field and remove an obsolete matching one. Keep a present but unmeasurable category marked as `未知`. Each material entry has the form `<item icon>Item name x100`. All material rates remain items per minute, but no description label includes the time unit. Separate items with commas, write each label only once per line, and put newlines only between nonempty lines in this order: missing, excess, input, output, research. Omit empty categories even when material data is incomplete; a warning-only description has no empty input line.
Use the native multiline description so long material lines wrap within the large editor. The power custom field remains single-line; do not add line breaks to custom fields, custom newline tokens, hidden ownership markers, sidecar metadata, a custom serialization format, or a mod-specific display protocol. Do not extend the native text renderer.
Use native item icon/name tags so the stored text remains compatible with ordinary blueprint saving and sharing. Round only for display, omit unnecessary trailing zeros, and do not display an unknown value as zero. Register UI strings, line labels, and the power field title through UXAssist's localization registration and use translation keys at call sites.
## 2. Inspector Integration and Safe Field Updates
### Proliferation setting
- Initialize the checkbox from whether the current blueprint contains a Spray Coater. Use the building's native prefab capability rather than its localized name.
- While the user has not overridden the setting, update that default when the blueprint contents change. Preserve a manual override for the current editing session; opening or switching to another blueprint resets the default.
- Changing the checkbox does not rewrite the blueprint. Replace the description and update the optional power field only when the button is clicked.
- When enabled, use the highest proliferation level supported by the captured catalog and preserve each building's extra-products or acceleration mode.
- Retain the black box analyzer's existing assumption that input coating is supplied externally. The presence of a Spray Coater only initializes the checkbox; it does not establish spray routing or justify adding an inferred proliferator-consumption flow.
### Click-to-write flow
1. Synchronize pending custom-field edits before reading native fields, so clicking the button does not discard unsaved manual field changes. The existing main description is intentionally replaced, including pending text there.
2. Read the inspector's current blueprint. Capture its buildings on the game thread with `BlueprintSelectionReader.FromBlueprint`, then create a request using the checkbox value and call `FactoryBlackBoxAnalyzer.Analyze`. Do not substitute the current planet's entire factory or live inventories.
3. Format a power value and up to five labeled description lines (Missing, Excess, Input, Output, Research), omitting empty categories. Keep calculation and formatting separate from Unity controls so their behavior can be checked with synthetic data. Refuse descriptions longer than the native 2,000-character limit before making generated changes.
4. Match only existing power custom fields by exact registered English or Chinese titles. Update one power field in place or append one when needed; merge duplicate matching power fields, and remove matching power fields when neither category consumes power. Do not inspect or delete input/output custom fields. Preserve every other field and its order, and do not search ordinary description prose for loose matches.
5. Check the native field capacity before changing generated data. If a required new power field cannot fit, explain the limit and leave the existing description and fields unchanged.
6. Commit both the prepared custom-field string and replacement `blueprint.desc`, update the native description input, and refresh the inspector through its native modification path. Refresh the displayed description, fields, and share-code preview, but do not save or overwrite a file automatically. The native save and copy buttons remain responsible for those actions.
Use existing UXAssist UI helpers and native styling. Reserve one compact row above all description fields for the button and its right-hand checkbox, not between smaller fields and the main description. Shift the first inspector group and following groups down together, increase the scroll content height, and size localized labels using the established UI utilities. Keep creation, event registration, refresh, and cleanup idempotent across inspector reuse and game sessions. Do not run the calculation repeatedly in a logic tick or per-frame update.
### Native integration reference
These integration points were checked in the original installed game DLL. Recheck their signatures and behavior against the original DLL after game updates, following the repository's Steam-install discovery guidance. Do not use stripped publicized method bodies as evidence.
- `UIBlueprintInspector` is shared by its `Browser`, `Copy`, and `Paste` usages. It stores the current `blueprint` and provides native refresh and custom-field editing paths.
- Native `Refresh` recalculates `descGroupTrans.anchoredPosition`, `group1.sizeDelta`, the following groups' positions, and `contentTrans.sizeDelta`, but does not reset `group1.anchoredPosition`. Move `group1` down once while the controls are active, position their row above its first native field, offset the following groups and scroll height after each native refresh, and restore the one-time shift on teardown. Do not move only `descGroupTrans`: that puts the new row between description sections.
- `BlueprintData.desc` stores the multiline description, including native item tags. Assign the inspector's `descTextInput.text` when replacing it because `Refresh(forModify: true)` does not reload that input from the blueprint. `BlueprintData.externalFields` stores custom fields; apply `ExternalFieldEscape` and `ExternalFieldUnescape` to power names and values.
- `UIBlueprintInspector.CollectExternalFields`, `OnCustomFieldEndEdit`, and `Refresh` establish the native collection and refresh sequence. Collect current edits before replacing generated values, not afterward.
- `UIBlueprintInspector.kMaxFieldCount` supplies the field limit; it was 20 in the inspected game build. A power update requires no new slot; unrelated custom fields are never removed to make room. The inspector rejects a `desc` longer than 2,000 characters; refuse that generated text instead of leaving the blueprint unsavable.
- `BlueprintData.Validate` removes literal newlines from native custom-field content, and the inspector lays out those fields at a fixed row height. It does not strip newlines from the main `desc`. Keep multiline text there, not in custom fields, without globally patching validation.
- `UIInputField` uses `LDB.signals.IconTag`; its `includeName` option supplies the native icon and localized item name together in the description text. The blueprint's normal serialization escapes and restores that text.
## 3. Material Classification and Shared API Changes
### Preserve the full-load report
Calculate from the buildings, recipes, and settings actually present in the blueprint. Keep all selected buildings at their modeled full load, even when upstream production is insufficient. Do not simulate belt reachability, logistics throughput, startup inventories, or runtime throttling.
Keep `GrossProduction`, `GrossConsumption`, `NetFlow`, producer/consumer attribution, and the original power calculations available. Material rates remain `double` items per minute and power remains watts.
For classification, account for a process's net production and consumption of each item. A material returned or recirculated within the same recipe must not become a false external requirement or surplus merely because it appears in both gross ledgers. Preserve the gross ledgers themselves for existing callers.
### Separate shortages, true overbuild, and coproducts
Extend the shared report with numeric results for:
- Intermediate material shortages requiring additional external supply.
- Net surplus attributable to genuinely redundant whole buildings.
- Net coproduct surplus left by necessary joint production after internal use.
One item can have both overbuild surplus and necessary coproduct surplus. Represent the amounts separately; a mutually exclusive item classification or a single boolean is insufficient. The existing per-item `IsExcessIntermediate` threshold alone does not prove that a building is redundant.
Use all products of a production group together when checking redundancy:
- Group equivalent buildings and process them in a stable order based on recipe, building, and operating settings so blueprint array order does not affect the result.
- Iteratively test whole-building reductions against the shared material balance. A reduction qualifies only if it does not lower final-product capacity and does not create or enlarge an internal material shortage.
- All items share the same selected redundant-building set and material budget. Do not independently claim the same surplus for several alternative reductions.
- Attribute overbuild and coproduct quantities to the original report without double-counting mixed single-output and multi-output producers. Do not classify a material solely by its position in the recipe's result array.
- Preserve the existing treatment of sub-building single-product ratio headroom as normal balance rather than an overbuild warning.
The whole-building reduction is only a classification calculation. Keep the actual blueprint's gross full-load inputs, outputs, original external-supply ledger, and rated power in the shared report. This feature does not remove buildings or become a separate factory-layout optimizer.
### Steady-state input demand
The displayed input rates must account for upstream production blocked by surplus intermediates. After identifying redundant whole buildings, allow fractional reductions of the remaining processes until each intermediate's production meets downstream demand. Apply each process reduction to all its inputs and joint products together; preserve rated final-product capacity and never enlarge an existing intermediate shortage. Propagate reductions through multiple upstream stages using a stable process order. The resulting external input is a separate steady-state estimate, not a replacement for gross full-load ledgers, output classification, or rated power. When other materials are incomplete, still cap independently known upstream processes against their known downstream demand and label the resulting input as a known portion. Do not mistake unmodeled downstream demand for zero: protect an unresolved process's known inputs, or all known products if its possible inputs are unknown. Keep whole-building overbuild and coproduct conclusions unknown until the material selection is complete.
A blueprint research-mode lab is a terminal outlet for all six native matrix types manufactured inside that same blueprint. One selected lab is enough to preserve the full rated output of every matrix producer, even when other known processes use some of those matrices. Classify positive net matrix production as final research output and place it on the separate Research line, not the ordinary Output line or an excess/coproduct entry. Subtract other buildings' known matrix consumption from the displayed research quantity, but do not add virtual research consumption to the gross material ledger or invent external matrix inputs. Other buildings' known matrix requirements still count, including external supply when no matrix is produced. Without a selected research-mode lab, use ordinary material classification and upstream throttling. This is a blueprint-planning assumption about where manufactured matrices can go, not a claim that a real lab has unlimited research throughput.
### Description lines
- If present, place intermediate shortages on a `Missing: ` / `缺少:` line and true overbuild on a separate `Excess: ` / `多余:` line, in that order before Input. Put each label only once before its comma-separated item list, not before every item. Do not mix warnings into Input or repeat a shortage as an ordinary input.
- Put only external raw-material inputs in the Input line, using the estimated steady-state rate rather than theoretical gross consumption.
- Put ordinary final products and necessary net coproduct surplus in the Output line. Do not include the overbuild portion again or duplicate research matrices here.
- Put positive net matrix output accepted by a selected research-mode lab in the separate Research line, after Output. For example, 12 matrices produced per minute minus 1 consumed by another selected process yields 11 per minute in Research, not 12; omit this line if no matrices are made or none remain.
- Merge entries for the same item within a category and sort each category by item ID. Use commas between entries and keep all rates in items per minute even though the labels omit the unit. Omit an entire line if it has no entries; do not generate `None` or `Unknown` as a stand-alone material line. Mark known entries as partial when material results are incomplete.
### Required joint-production example
Each upstream building produces A60 and B60 per minute. Internal downstream requirements are A120 and B30 per minute, and downstream capacity remains fixed.
| Selected upstream buildings | Original A/B production | True overbuild shown in Excess | Necessary coproduct shown in Output |
| --- | --- | --- | --- |
| 2 | A120, B120 | None | B90 |
| 3 | A180, B180 | A60, B60 | B90 |
In the three-building case, preserve gross consumption and rated power for all three buildings, but display external input for only the two upstream buildings needed by downstream demand. Do not reclassify the entire B150 net surplus as overbuild, and do not report B150 as coproduct output while also warning about the redundant B60.
## 4. Power, Scope Boundaries, and Incomplete Results
### Independent power categories
Extend `ProductionReport` with independently usable factory-consumption and logistics-consumption results and completeness information. Preserve the existing total-power API and migrate affected callers without weakening their accounting.
- Factory consumption includes production buildings and non-logistics auxiliary demand, including sorters and Spray Coaters.
- Logistics consumption uses stored configured charging limits, or native prefab defaults where no charging setting is applied, for the selected logistics facilities. Do not use transient draw.
- Do not subtract generation from consumption. Keep accumulator exchange and logistics charging distinct and count charging demand only once. Do not add a second logistics charging term to advanced miners or grid consumption for gas collectors' self-fueling.
- Unknown factory power must not discard known logistics power, or vice versa. For example, `工厂耗电 未知 | 物流耗电 600MW` is valid when only the factory total is unknown.
- A research-mode lab blueprint does not store its current technology or research speed. Capture native `LabComponent.matrixIds` with the catalog and mark blueprint labs as `ResearchMatrixSink`; do not consult current technology, technology requirements, unlock state, or research speed to determine matrix use. An assumed lab has no numeric matrix input or hash throughput in the report. Other callers without this blueprint assumption still need explicit `TechId` and `ResearchSpeed` to calculate exact research flows. If native matrix item IDs are unavailable, retain an incomplete material result instead of treating the lab as unable to accept matrices.
- Budget every selected research-mode lab at its full prefab working consumption, including labs currently unable to research or with invalid technology data. Apply the selected proliferation power multiplier when available; use base working power when no spray level is supported. This deliberately conservative estimate protects blueprint power capacity and keeps factory and total power independent of material-rate assumptions.
- Omit a power category when its demand is known to be zero; do not show `0W` for an absent factory or logistics consumer. An unknown category tied to a selected building remains visible as `Unknown`. If neither category has consumption, do not create a power field and remove an earlier generated one.
### Blueprint-only scope and missing data
- Do not generate description entries or requested-parameter lists for veins or other scene objects that are not part of a blueprint. Do not expand this feature into a resource-context or planet-analysis interface.
- If a building actually present in the blueprint still lacks a necessary operating parameter, retain independently calculable results and explicitly mark the affected result incomplete. The research-mode matrix outlet assumption above is an intentional exception; do not invent other external conditions.
- Preserve the common analyzer's resource and operating-parameter requirements for its other callers; the description feature's scope does not authorize globally suppressing those diagnostics.
- Keep material and power completeness independent. Mark partial material values as known portions, cap known upstream inputs against known demand, and suppress any final-output, overbuild, or coproduct conclusion that unresolved downstream consumers could invalidate.
- An invalid blueprint, unavailable catalog, calculation exception, overlong description, or insufficient field capacity must leave the existing description and custom fields unchanged and show a useful localized explanation. A failed or unavailable calculation is not a complete empty report.
## 5. Validation and Maintenance
### Synthetic checks
Extend `UXAssist/tools/ProductionCheck` with focused tests for:
- The two- and three-building joint-production example above.
- A shared item supplied by both single-output and multi-output processes, including simultaneous coproduct and overbuild amounts without duplication.
- Whole-building thresholds, fractional ratio headroom, internal deficits, and stable results after reordering blueprint buildings.
- Internal material return and cyclic recipes without losing the original gross production/consumption ledgers.
- Proliferation on/off, the highest captured supported level, and preservation of building acceleration/extra-product modes.
- Independent material, factory-power, and logistics-power completeness, including one research lab accepting all six manufactured matrix types without technology data, invented external matrix inputs, or hash rates; preserve full-load power with and without supported proliferation.
- No research station, no matrix production, one produced matrix type, multiple labs, and a separate building that genuinely needs external matrices. Classify positive net matrix production as final research output, preserve known gross flows, prevent false matrix coproduct or overbuild warnings, and avoid throttling producers whose matrix output has an assumed research outlet.
- Separate steady-state external inputs for whole and fractional upstream excess, multi-stage dependencies, shared producers, order stability, and shortages; cap known upstream inputs in partially known layouts while protecting unresolved downstream demand. Preserve gross ledgers, independently known rated output, and power.
- Pure formatting for separate nonempty Missing, Excess, Input, Output, and Research lines in that order, including multiple items per warning line without repeated labels. Verify labels omit the per-minute suffix without changing rate units. Cover long material lists, independent power-category omission, and present-but-unknown power; check that matrix output appears exactly once in Research at its net rate while non-matrix final output stays in Output.
- Pure field updates for first generation, repeated updates, exact bilingual power-title recognition, duplicate power fields, preservation of all other fields including input/output titles, and native-capacity rejection without partial writes. Check the description length before committing either change.
Keep game-dependent capture and inspector code separate from the pure-managed sources compiled by these checks.
Run the narrow checks and affected builds from the repository root:
```powershell
dotnet run --project UXAssist/tools/ProductionCheck/ProductionCheck.csproj -c Release
dotnet build UXAssist/UXAssist.csproj -c Release --no-restore
dotnet build CheatEnabler/CheatEnabler.csproj -c Release --no-restore
dotnet build UniverseGenTweaks/UniverseGenTweaks.csproj -c Release --no-restore
git diff --check
```
### Manual game acceptance
- Check browser, copy, and paste inspectors in English and Simplified Chinese. Confirm the checkbox sits directly to the right of the button without overlap, their row precedes all small and main description boxes, and the native description wraps long icon/name material lines. Reopen, refresh, and change language to ensure the row stays at the top and the original layout returns when the feature is disabled.
- Check checkbox defaults with and without a Spray Coater, blueprint-content changes before a manual override, preservation of a manual override during refresh, and reset after switching blueprints.
- Generate with no existing fields, generate again, and generate with unrelated custom fields, including fields titled Input or Output. Confirm the main description replaces its previous text, at most one power field remains, and other fields and pending manual custom-field edits survive unchanged.
- Try factory-only, logistics-only, both, neither, and partially unknown consumption. Confirm absent categories and the entire empty power field disappear, while genuinely unknown demand stays labeled. Confirm Missing and Excess each use one label followed by comma-separated items before Input, with no per-minute suffix on any description label; empty material categories produce no lines.
- Reach the native field limit. Confirm a missing power field causes an all-or-nothing refusal without deleting other fields, while an existing power field can be updated and description-only generation remains possible. Generate a description over 2,000 characters and confirm it is rejected without changing the blueprint.
- Save, reopen, copy a share code, and import it again through the native UI. Confirm description newlines, native item icons, the optional power field, and unrelated fields survive without a custom format or a modified renderer.
- Confirm no file is written just by toggling proliferation or clicking generation, and that errors preserve the previous description and fields.
- Compare full-load rates and configured logistics charging limits under suitable conditions. Do not compare against transient, starved, or output-blocked production.
- With no external outlet for surplus intermediates, compare the description's input after upstream output buffers fill against downstream demand, including when an unrelated building lacks operating data. Confirm that unresolved downstream consumers prevent unsupported input reductions while known rated output and power remain independent.
- Generate blueprints with one research-mode lab and six matrix types made inside the blueprint, then with only one matrix type or none. Confirm every manufactured matrix has an outlet and its positive net rate appears once in the Research line, after the unrelated final products in Output. Known consumption by another blueprint building reduces the Research rate; do not estimate lab matrix use, hashes, or external matrix demand. Vary current technology and research speed, add more labs, and toggle proliferation: matrix throughput must not change, but each lab must still contribute its full applicable working power. Without a lab, ordinary matrix output and overbuild rules apply.
Game validation is manual. Do not add automated gameplay or save-file parsing as an acceptance requirement.
### Documentation and repository hygiene
Keep the maintained English production architecture documentation and aligned English/Chinese changelog notes consistent with this behavior and the repository's version rules. Put only durable standards or maintained architecture references in `AGENTS.md`, not this task's progress, investigation evidence, or completed plan. Do not stage unrelated files, create a branch, or commit without an explicit request.
+24 -5
View File
@@ -1,13 +1,13 @@
# Production Calculation Architecture
UXAssist exposes a shared production catalog, a material planner, a fixed-building black box analyzer, and blueprint capture. These APIs calculate reports; they do not change DSP production, replace factory updates, or provide a calculator UI.
UXAssist exposes a shared production catalog, a material planner, a fixed-building black box analyzer, and blueprint capture. These APIs calculate reports without changing DSP production or replacing factory updates. The blueprint inspector also offers an explicit, click-to-generate description; it is not a continuous factory calculator.
## Data and lifecycle
- `ProductionCatalogService.Current` is an immutable snapshot of loaded item, recipe, technology, building, `PrefabDesc`, and `Cargo` data. The service rebuilds after data preload and on game begin, so changes made by later preload callbacks are captured. It clears the snapshot when a game ends. It can be `null` before preload. Subscribe to `ProductionCatalogService.Changed` to invalidate derived reports and retry against the current snapshot; the event also reports clearing the catalog.
- Capture a live blueprint selection on the game thread. The planner, black box analyzer, adapters, and simplex implementation read only immutable snapshots and managed request data. They do not retain game component references or inspect current inventories during calculation.
- Material rates use `double` items per minute; process executions, hashes, and launches are also per minute. Native simulation runs at 60 ticks per second, so recipe cycle rates use 3,600 ticks per minute, not 60. Convert fixed-point speed values by 10,000 and energy per tick to watts by 60. Gas speeds arrive in items per second and must also be converted to per-minute outputs. Round only for display and for the separately reported building deployment count.
- A report carries separate `MaterialComplete` and `PowerComplete` flags, `Diagnostics`, individual `ItemFlows`, and `Groups`. `ProductionPower` is `null` if any power requirement is unknown; a group's unknown Dyson-sphere demand is also `null`. Do not interpret an absent power result as zero.
- A report carries separate `MaterialComplete` and `PowerComplete` flags, `Diagnostics`, individual `ItemFlows`, and `Groups`. `ProductionPower` is `null` if any power requirement is unknown; a group's unknown Dyson-sphere demand is also `null`. `PowerBreakdown` additionally reports independently complete factory and logistics consumption, with nullable category totals and known portions. The planner's breakdown has zero logistics consumption because logistics is outside its scope. Never interpret an absent result or incomplete category as zero.
Accumulator charging and critical photon production have no native `RecipeProto` entries. The catalog adds calculation-only recipes from the captured exchanger and receiver metadata, with stable IDs equal to the negative output item ID. `ProductionRecipe.IsSynthetic` identifies these entries. Resolve them through `ProductionCatalog.Recipes`, never through `LDB.recipes` or a native building recipe setter. They supply default routes only when no native recipe provides one.
@@ -38,7 +38,11 @@ When proliferation is enabled, ordinary recipes default to their native extra-pr
## Fixed-building analysis
The black box evaluates each selected building at full load, even if another selected building cannot provide all its inputs. It does not simulate belt layouts, startup storage, or logistics throughput. Missing inputs appear as `RequiredExternalSupply`; byproducts and internal deficits retain producer and consumer group attribution. A positive intermediate balance is classified as excess only when it reaches the smallest net per-building output among actual producers of that item. The underlying fractional ledger is never discarded.
The black box evaluates each selected building at full load, even if another selected building cannot provide all its inputs. It does not simulate belt layouts, startup storage, or logistics throughput. Missing inputs appear as `RequiredExternalSupply`; byproducts and internal deficits retain producer and consumer group attribution. `GrossProduction` and `GrossConsumption` remain separate even when a recipe returns some of its own input. Material classification uses each process's net per-item flow, so that return cannot become a false external requirement or coproduct.
`IntermediateShortage` records the missing externally supplied portion of an item produced and consumed within the selection. `OverbuildSurplus` and `CoproductSurplus` are independent nullable amounts; both can be positive for the same item. Equivalent buildings are grouped by recipe, building, proliferation mode, speed, and operating settings in stable order. Whole-building reductions are tested against every item's shared balance: no final-product capacity may decrease and no internal shortage may increase. The reduction identifies redundancy only; gross flows, original full-load inputs, outputs, and power never change. Coproduct supply counts only retained whole buildings required by a process's other products, and internal net consumption is credited before exposing the remainder. Headroom from a single-output producer or a joint process's limiting product remains ordinary balance, not a coproduct. The older `IsExcessIntermediate` threshold flag is retained for callers but alone does not prove redundancy. When materials are incomplete, overbuild and coproduct amounts are unknown rather than fabricated from a partial layout.
`SteadyStateExternalSupply` is a separate input estimate from the known processes. After whole-building classification for complete selections, a bounded fractional reduction of surplus intermediate producers propagates downstream limits through upstream processes. Every reduction applies to the entire process, keeps rated final-product capacity, and never worsens an existing intermediate shortage; deterministic grouping and ordering keep results independent of blueprint building order. For partial selections, skip whole-building classification but still cap independently known upstream inputs against known demand. Protect any known inputs of an unresolved downstream process, or all known products if its possible inputs are unknown, instead of treating its demand as zero. Only the blueprint description uses this estimate, marked as a known portion when incomplete. Gross ledgers, `RequiredExternalSupply`, uncertain overbuild and coproduct classification, independently known rated outputs, and power retain their original meaning.
```csharp
var capture = BlueprintSelectionReader.Capture(factory, selectedObjectIds);
@@ -52,7 +56,19 @@ The capture is read-only and does not alter the game's selection. `CreateRequest
The global proliferation switch uses the highest level supported by the captured proliferator items while preserving each production building's acceleration or extra-products setting. It also controls fuel and launch-ammunition proliferation. The black box assumes input coating is supplied externally and does not add proliferator consumption for that coating.
Selected Planetary and Interstellar Logistics Stations, Logistics Distributors, and Battlefield Analysis Bases contribute their configured maximum charging power to both `Power.ConsumptionWatts` and `PeakConsumptionWatts`. These are charging limits, not current draw, inventory flow, or accumulator exchange. A manual building snapshot supplies `ChargePowerWatts` in watts; live capture reads the consumer's configured work energy per tick, while prebuild and blueprint captures use native stored settings or prefab defaults when no setting is applied. Missing or invalid charging power makes the power result unknown without discarding material results. Advanced Mining Machines retain their mining power calculation rather than gaining a second charger; orbital collectors recover their own fuel instead of drawing grid power.
Selected Planetary and Interstellar Logistics Stations, Logistics Distributors, and Battlefield Analysis Bases contribute their configured maximum charging power to both `Power.ConsumptionWatts` and `PeakConsumptionWatts`. These are charging limits, not current draw, inventory flow, or accumulator exchange. A manual building snapshot supplies `ChargePowerWatts` in watts; live capture reads the consumer's configured work energy per tick, while prebuild and blueprint captures use native stored settings or prefab defaults when no setting is applied. Missing or invalid charging power leaves logistics consumption and the combined power result unknown, without discarding known factory consumption or material results. Factory consumption also includes selected sorters and Spray Coaters. Advanced Mining Machines retain their mining power calculation rather than gaining a second charger; orbital collectors recover their own fuel instead of drawing grid power. A miner missing resource context can still report independently calculable speed-ratio power; a ray receiver missing Dyson loss settings retains its known factory draw even though total power remains incomplete.
All selected research-mode labs contribute their full prefab working consumption to factory and total power, regardless of current technology validity or transient idle state. When proliferation is enabled, apply the highest supported matrix power multiplier; with no supported spray level, use base working power. This intentionally conservative blueprint estimate avoids undersizing the power supply. An invalid power rating or unavailable multiplier remains unknown.
Native research uses the current lab technology's matrix point requirements, with 3,600 points consumed per item. Precise live or manually supplied research settings still require `TechId` and `ResearchSpeed`. `ProductionCatalogReader` independently captures native `LabComponent.matrixIds` as immutable `ResearchMatrixItemIds`. `FromBlueprint` sets `ResearchMatrixSink` rather than using the current technology or research speed. In this blueprint-only model, one selected research lab provides a virtual outlet for every native matrix item manufactured in the blueprint. Protect this production against whole and fractional upstream reductions; classify its positive net rate after other buildings' known consumption as a final research product, not a redundant building or exported coproduct. Do not add a fabricated matrix consumption rate, external matrix requirement, or research hash rate to the lab's numeric report. Known matrix use by other selected processes remains a real material input; if native matrix IDs are unavailable, material completeness is unknown while separately known lab power remains available. The outlet is a planning convention, not a simulation of real lab throughput or belt connectivity.
## Blueprint descriptions
The shared `UIBlueprintInspector` in browser, copy, and paste modes hosts `Auto-fill description` with `Proliferation` immediately to its right in one row above every description box. Move the first native inspector group down once, and offset later groups and the scroll height after each native refresh so the controls do not split the smaller fields from the main description. The checkbox initially reflects the blueprint's Spray Coater prefab capability and tracks content changes until manually changed in the current editing session; changing it does not modify the blueprint. Clicking the button captures only `blueprint.buildings` with `BlueprintSelectionReader.FromBlueprint` on the game thread, then runs `FactoryBlackBoxAnalyzer` against the captured catalog. The maximum supported proliferation level applies while each building keeps its acceleration or extra-products mode. Input coating is assumed to be supplied externally; no spray routing or spray consumption is inferred from the Spray Coater.
`BlueprintDescriptionFormatter` builds replacement multiline `blueprint.desc` text in this order: optional `Missing:` and `Excess:` lines for intermediate shortages and true overbuild; `Input:` for external inputs capped by downstream demand; `Output:` for ordinary final products and necessary coproduct surplus; and `Research:` for positive net matrix production accepted by a selected research-mode lab. Each warning category has one label followed by comma-separated items; warnings do not repeat in Input, and a matrix on Research does not repeat in Output. It uses `SteadyStateExternalSupply` for complete and independently known partial inputs, labeling partial values as known portions. The assumed lab adds no numerical matrix consumption or external input; other buildings' known matrix demand is subtracted from the Research rate. Omit each empty line, including Research when no produced matrix remains. A single optional `Power` custom field separates factory and configured logistics consumption, omitting categories with no demand and removing the field altogether if neither consumes power; a present but unknown category displays `Unknown` rather than zero. Material rates remain items per minute even though the description labels omit the unit. Rates are rounded only for display, ordered by item ID within each category, and use native item icon/name tags with comma-separated entries inside each description line. Uncertain final-product, overbuild, or coproduct conclusions are omitted. Veins and other scene objects are not blueprint entries or requested parameters.
`BlueprintDescriptionFields` matches only exact English or Simplified Chinese power field titles, updates or removes matching power fields, and collapses duplicate matches; all other fields, including input/output custom fields, stay intact. The inspector first collects pending custom-field edits, checks the native 2,000-character description limit and `kMaxFieldCount`, and applies native `ExternalFieldEscape` and `ExternalFieldUnescape` rules to the remaining power field. An invalid blueprint, unavailable catalog, failed calculation, malformed fields, overlong description, or insufficient capacity does not overwrite the description or generated fields. A successful update replaces the original description, synchronizes its native input control, and refreshes the inspector and share-code preview through the native modification path, leaving save and copy actions to the native buttons. The formatting and field updater remain pure-managed so `ProductionCheck` can verify them without loading Unity.
## Special-process settings
@@ -68,7 +84,7 @@ All parameters below are numbers in a building snapshot's `OperatingParameters`.
| Gas collector | `GasCount`, `GasTotalHeat`, `MiningSpeedMultiplier`, and each `GasItemId{n}` and `GasSpeedPerSecond{n}`. Native self-power recovery and collection technology scale all gas outputs, which are reported per minute. Collector working energy reduces recovered gas; it is not counted again as grid consumption. |
| Fuel generator | `FuelItemId` compatible with the generator. Artificial stars also require the native boost mode `Mode0`, with `BoostEnabled` when it is set. Output and burned fuel follow the native fuel type and proliferation rule. |
| EM-rail ejector or vertical launching silo | `LaunchAvailable` plus the native boost mode (`Mode1` for ejectors, `Mode0` for silos), with `BoostEnabled` when it is set. An available ideal target consumes one ammunition item per completed charge/cooldown cycle. Proliferation changes both launch speed and working power. `LaunchesPerMinute` is separate from item production. |
| Research-mode lab | `ResearchMode = 1`, `TechId`, and `ResearchSpeed`. The captured technology supplies matrix point requirements. Native matrix proliferation increases hashes and power, not matrix input per base hash; `ResearchHashesPerMinute` is separate from item production. |
| Research-mode lab | `ResearchMode = 1`; precise research needs `TechId` and `ResearchSpeed`, neither stored in a blueprint. Blueprint capture sets `ResearchMatrixSink`: a single lab can receive all six native matrix types produced by the selection, without a numerical input or hash-rate estimate. All labs count at full working power even when technology is missing or invalid; apply the supported proliferation power factor or base power when no spray level exists. Precise native matrix proliferation increases hashes and power, not matrix input per base hash. |
Native blueprint paste applies a stored boost mode only while sandbox tools are enabled, so `BoostEnabled` states whether the boost is actually applied. Live capture reports the applied boost of ejectors, silos, and artificial stars; blueprint callers must supply it for boosted buildings.
@@ -85,6 +101,7 @@ Use compilation, the synthetic game-free checks, and static review for developme
```powershell
dotnet build UXAssist/UXAssist.csproj -c Release --no-restore
dotnet build CheatEnabler/CheatEnabler.csproj -c Release --no-restore
dotnet build UniverseGenTweaks/UniverseGenTweaks.csproj -c Release --no-restore
dotnet run --project UXAssist/tools/ProductionCheck/ProductionCheck.csproj -c Release
git diff --check
```
@@ -104,5 +121,7 @@ Use a test game for the following manual checks. Compare full-load rates only wi
- Select miners at different machine speeds, including one with a backed-up output, a gas collector, and renewable generators. Check native miner power scaling, full-load miner output regardless of the output backlog, per-minute gas output without added grid demand, and ideal rated renewable power rather than local conditions.
- Select ray receivers in both modes, fuel generators, ejectors, and silos. Toggle proliferation and compare working power, generation, accumulator exchange, and Dyson demand as separate quantities. In a sandbox game, capture boosted artificial stars and launchers, and confirm that blueprint analysis of boosted buildings requires `BoostEnabled`.
- Remove an upstream producer from a mixed production selection. Confirm that downstream capacity is unchanged and the missing material appears as required external supply. Check intermediate excess around the smallest selected producer's net output threshold.
- In browser, copy, and paste inspectors, check localized control placement, Spray Coater defaults and manual overrides, and native item tags in the three generated fields. Generate twice and at the 20-field limit; verify that pending manual edits, unrelated fields, save/copy behavior, and ordinary blueprint sharing remain intact. Compare joint-production overbuild with necessary coproduct output without replacing original full-load rates or power.
- Place one research-mode lab alongside one or all six matrix production chains. Confirm the matrices' positive net production appears only in the Research line, other final products stay in Output, and known in-blueprint matrix consumption reduces the Research rate. Do not fabricate lab matrix imports, excess, or an estimated lab consumption rate; change current technology, add more labs, and toggle proliferation to check matrix routing stays independent while full working power updates. Without the lab, normal matrix output and overbuild rules resume.
- Combine planner targets with shared coproducts, explicit raw-material boundaries, and alternate selected recipes. Confirm material conservation, shared surplus reuse, and no introduction of unselected recipes.
- Toggle belt-signal proliferation and reload a game. Confirm that existing belts use the new catalog, item generation continues, and fractional production and consumption statistics remain independent.