mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-22 18:19:02 +08:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d4953fc29 | ||
|
|
8fbb244ba2 | ||
|
|
d68329ff9a | ||
|
|
6263775dc1 | ||
|
|
3580e9623f | ||
|
|
35f5cfcdd8 | ||
|
|
0cd6008673 | ||
|
|
5f9c6e05cb | ||
|
|
ca884fe6af | ||
|
|
3ca7b62ec6 | ||
|
|
a6225cf750 | ||
|
|
6d86e1f5dd | ||
|
|
79c736d90c | ||
|
|
f0773ffb9b | ||
|
|
6345562c66 | ||
|
|
e2b8433252 | ||
|
|
cada02fbf4 | ||
|
|
51e90a8e1d | ||
|
|
97f032a5af |
No files matched your search
@@ -3,8 +3,11 @@
|
|||||||
|
|
||||||
## Changlog
|
## Changlog
|
||||||
|
|
||||||
* 2.4.8 - Unreleased
|
* 2.4.8
|
||||||
* `Belt signal item generation`: Calculate raw-material, intermediate, and proliferator statistics from the game's current recipe data, counting by-products and consumption separately. If an item's recipe data is incomplete, only its upstream statistics pause, with the reason logged; item generation is unaffected. Fix signal belts built or destroyed on another planet, for example by Battlefield Analysis Base drones or Dark Fog attacks, affecting a belt on the current planet instead of their own; a destroyed belt could also keep generating items on a belt later built in its place.
|
* `Finish build immediately`: Fix possible errors when starting a new game. Construction begins after the opening cutscene ends or is skipped.
|
||||||
|
* `Belt signal item generation`:
|
||||||
|
* Improve raw-material, intermediate, by-product and proliferator statistics using current recipes, with production and consumption counted separately. Incomplete recipe data only pauses the affected upstream statistics; item generation continues.
|
||||||
|
* Fix signal belts built or destroyed on other planets, such as by Battlefield Analysis Base drones or Dark Fog attacks, affecting belts on the current planet. Destroyed signal belts no longer cause replacement belts to keep generating items.
|
||||||
* 2.4.7
|
* 2.4.7
|
||||||
* `Dev Shortcuts`: Work immediately when enabled after loading a save, and process each key press once per frame at accelerated game speeds.
|
* `Dev Shortcuts`: Work immediately when enabled after loading a save, and process each key press once per frame at accelerated game speeds.
|
||||||
* Extend `Unlock Tech with Key-Modifiers` with a downgrade mode.
|
* Extend `Unlock Tech with Key-Modifiers` with a downgrade mode.
|
||||||
@@ -203,8 +206,11 @@
|
|||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
* 2.4.8 - Unreleased
|
* 2.4.8
|
||||||
* `传送带信号物品生成`:原料、中间产物和增产剂的统计改为按游戏当前配方数据计算,并分别计入副产物和消耗。某物品的配方数据不完整时,仅暂停该物品的上游统计并在日志中说明原因,不影响物品生成。修复在其他星球上建造或被摧毁的信号传送带(例如由战场分析基站的无人机建造或被黑雾摧毁)错误影响当前星球上传送带的问题;被摧毁的传送带也可能让之后在原处新建的传送带继续生成物品。
|
* `建造秒完成`:修复开始新游戏时可能报错的问题。建造会在开场动画播放结束或跳过后开始。
|
||||||
|
* `传送带信号物品生成`:
|
||||||
|
* 按当前配方完善原料、中间产物、副产物和增产剂的统计,分别记录生产和消耗。配方数据不完整时,仅暂停受影响物品的上游统计,物品仍会正常生成。
|
||||||
|
* 修复其他星球上的信号传送带在建造或被摧毁时,错误影响当前星球上传送带的问题,例如战场分析基站无人机建造或黑雾摧毁传送带。被摧毁的信号传送带也不会再让之后替换它的传送带继续生成物品。
|
||||||
* 2.4.7
|
* 2.4.7
|
||||||
* `开发模式快捷键`:修复载入存档后启用时不生效的问题;加速游戏时每次按键仍只执行一次。
|
* `开发模式快捷键`:修复载入存档后启用时不生效的问题;加速游戏时每次按键仍只执行一次。
|
||||||
* `使用组合键点击解锁科技` 新增降级模式。
|
* `使用组合键点击解锁科技` 新增降级模式。
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ public static class PlayerFunctions
|
|||||||
var propertySystem = DSPGame.propertySystem;
|
var propertySystem = DSPGame.propertySystem;
|
||||||
if (propertySystem == null) return;
|
if (propertySystem == null) return;
|
||||||
PurgePropertySystem(propertySystem);
|
PurgePropertySystem(propertySystem);
|
||||||
var itemCnt = new int[ItemIds.Metaverse - ItemIds.HydrogenFuelRod + 1];
|
var itemCnt = new int[ItemIds.UniverseMatrix - ItemIds.ElectromagneticMatrix + 1];
|
||||||
foreach (var cons in propertySystem.propertyDatas.SelectMany(data => data.totalConsumption.Where(cons => cons.id is >= ItemIds.HydrogenFuelRod and <= ItemIds.Metaverse)))
|
foreach (var cons in propertySystem.propertyDatas.SelectMany(data => data.totalConsumption.Where(cons => cons.id is >= ItemIds.ElectromagneticMatrix and <= ItemIds.UniverseMatrix)))
|
||||||
{
|
{
|
||||||
itemCnt[cons.id - ItemIds.HydrogenFuelRod] += cons.count;
|
itemCnt[cons.id - ItemIds.ElectromagneticMatrix] += cons.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemCnt.All(cnt => cnt == 0))
|
if (itemCnt.All(cnt => cnt == 0))
|
||||||
@@ -97,7 +97,7 @@ public static class PlayerFunctions
|
|||||||
{
|
{
|
||||||
if (itemCnt[i] > 0)
|
if (itemCnt[i] > 0)
|
||||||
{
|
{
|
||||||
msg += $"\n {LDB.items.Select(i + ItemIds.HydrogenFuelRod).propertyName} x{itemCnt[i]}";
|
msg += $"\n {LDB.items.Select(i + ItemIds.ElectromagneticMatrix).propertyName} x{itemCnt[i]}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UIMessageBox.Show(Localization.RemoveAllMetadataConsumptionRecords.Translate(), msg, Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
|
UIMessageBox.Show(Localization.RemoveAllMetadataConsumptionRecords.Translate(), msg, Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
|
||||||
@@ -121,7 +121,7 @@ public static class PlayerFunctions
|
|||||||
var propertySystem = DSPGame.propertySystem;
|
var propertySystem = DSPGame.propertySystem;
|
||||||
if (propertySystem == null) return;
|
if (propertySystem == null) return;
|
||||||
PurgePropertySystem(propertySystem);
|
PurgePropertySystem(propertySystem);
|
||||||
var itemCnt = new int[ItemIds.Metaverse - ItemIds.HydrogenFuelRod + 1];
|
var itemCnt = new int[ItemIds.UniverseMatrix - ItemIds.ElectromagneticMatrix + 1];
|
||||||
var seedKey = DSPGame.GameDesc.seedKey64;
|
var seedKey = DSPGame.GameDesc.seedKey64;
|
||||||
var clusterPropertyData = propertySystem.propertyDatas.FirstOrDefault(cpd => cpd.seedKey == seedKey);
|
var clusterPropertyData = propertySystem.propertyDatas.FirstOrDefault(cpd => cpd.seedKey == seedKey);
|
||||||
if (clusterPropertyData == null)
|
if (clusterPropertyData == null)
|
||||||
@@ -130,9 +130,9 @@ public static class PlayerFunctions
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var currentGamePropertyData = GameMain.data.history.propertyData;
|
var currentGamePropertyData = GameMain.data.history.propertyData;
|
||||||
foreach (var cons in currentGamePropertyData.totalConsumption.Where(cons => cons.id is >= ItemIds.HydrogenFuelRod and <= ItemIds.Metaverse))
|
foreach (var cons in currentGamePropertyData.totalConsumption.Where(cons => cons.id is >= ItemIds.ElectromagneticMatrix and <= ItemIds.UniverseMatrix))
|
||||||
{
|
{
|
||||||
itemCnt[cons.id - ItemIds.HydrogenFuelRod] += cons.count;
|
itemCnt[cons.id - ItemIds.ElectromagneticMatrix] += cons.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemCnt.All(cnt => cnt == 0))
|
if (itemCnt.All(cnt => cnt == 0))
|
||||||
@@ -145,7 +145,7 @@ public static class PlayerFunctions
|
|||||||
{
|
{
|
||||||
if (itemCnt[i] > 0)
|
if (itemCnt[i] > 0)
|
||||||
{
|
{
|
||||||
msg += $"\n {LDB.items.Select(i + ItemIds.HydrogenFuelRod).propertyName} x{itemCnt[i]}";
|
msg += $"\n {LDB.items.Select(i + ItemIds.ElectromagneticMatrix).propertyName} x{itemCnt[i]}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UIMessageBox.Show(Localization.RemoveMetadataConsumptionRecordInCurrentGame.Translate(), msg, Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
|
UIMessageBox.Show(Localization.RemoveMetadataConsumptionRecordInCurrentGame.Translate(), msg, Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
|
||||||
@@ -154,8 +154,8 @@ public static class PlayerFunctions
|
|||||||
{
|
{
|
||||||
if (clusterPropertyData.totalConsumption[i].count == 0) continue;
|
if (clusterPropertyData.totalConsumption[i].count == 0) continue;
|
||||||
var id = clusterPropertyData.totalConsumption[i].id;
|
var id = clusterPropertyData.totalConsumption[i].id;
|
||||||
if (id < ItemIds.HydrogenFuelRod || id > ItemIds.Metaverse) continue;
|
if (id < ItemIds.ElectromagneticMatrix || id > ItemIds.UniverseMatrix) continue;
|
||||||
var currentGameCount = itemCnt[id - ItemIds.HydrogenFuelRod];
|
var currentGameCount = itemCnt[id - ItemIds.ElectromagneticMatrix];
|
||||||
if (currentGameCount == 0) continue;
|
if (currentGameCount == 0) continue;
|
||||||
var totalCount = clusterPropertyData.totalConsumption[i].count;
|
var totalCount = clusterPropertyData.totalConsumption[i].count;
|
||||||
clusterPropertyData.totalConsumption[i] = new IDCNT(id, totalCount > currentGameCount ? totalCount - currentGameCount : 0);
|
clusterPropertyData.totalConsumption[i] = new IDCNT(id, totalCount > currentGameCount ? totalCount - currentGameCount : 0);
|
||||||
|
|||||||
@@ -88,14 +88,14 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
ControlPanelRemoteLogistics.Enable(ControlPanelRemoteLogisticsEnabled.Value);
|
ControlPanelRemoteLogistics.Enable(ControlPanelRemoteLogisticsEnabled.Value);
|
||||||
Enable(true);
|
Enable(true);
|
||||||
CargoTrafficPatch.Enable(true);
|
CargoTrafficPatch.Enable(true);
|
||||||
GameLogicProc.OnGameBegin += OnGameBegin_For_ImmBuild;
|
GameLogicProc.OnGameBegin += OnGameBeginOrGuideComplete;
|
||||||
GameLogicProc.OnDataLoaded += OnDataLoaded;
|
GameLogicProc.OnDataLoaded += OnDataLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Uninit()
|
public static void Uninit()
|
||||||
{
|
{
|
||||||
GameLogicProc.OnDataLoaded -= OnDataLoaded;
|
GameLogicProc.OnDataLoaded -= OnDataLoaded;
|
||||||
GameLogicProc.OnGameBegin -= OnGameBegin_For_ImmBuild;
|
GameLogicProc.OnGameBegin -= OnGameBeginOrGuideComplete;
|
||||||
CargoTrafficPatch.Enable(false);
|
CargoTrafficPatch.Enable(false);
|
||||||
Enable(false);
|
Enable(false);
|
||||||
ImmediateBuild.Enable(false);
|
ImmediateBuild.Enable(false);
|
||||||
@@ -152,7 +152,8 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
if (factory.prebuildCount <= 0) return;
|
if (factory.prebuildCount <= 0) return;
|
||||||
var imm = ImmediateEnabled.Value;
|
var imm = ImmediateEnabled.Value;
|
||||||
var architect = ArchitectModeEnabled.Value;
|
var architect = ArchitectModeEnabled.Value;
|
||||||
if ((!imm && !architect) || GameMain.gameScenario == null) return;
|
if ((!imm && !architect) || GameMain.gameScenario == null ||
|
||||||
|
GameMain.data?.guideComplete != true) return;
|
||||||
var prebuilds = factory.prebuildPool;
|
var prebuilds = factory.prebuildPool;
|
||||||
if (imm)
|
if (imm)
|
||||||
{
|
{
|
||||||
@@ -193,7 +194,9 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnGameBegin_For_ImmBuild()
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(GameData), nameof(GameData.EndStandardModeGuide))]
|
||||||
|
private static void OnGameBeginOrGuideComplete()
|
||||||
{
|
{
|
||||||
if (DSPGame.IsMenuDemo) return;
|
if (DSPGame.IsMenuDemo) return;
|
||||||
var factory = GameMain.mainPlayer?.factory;
|
var factory = GameMain.mainPlayer?.factory;
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ internal class ImmediateBuild : PatchImpl<ImmediateBuild>
|
|||||||
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.FactoryConstructionSystemGameTick))]
|
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.FactoryConstructionSystemGameTick))]
|
||||||
private static void GameLogic_FactoryConstructionSystemGameTick_Prefix(GameLogic __instance)
|
private static void GameLogic_FactoryConstructionSystemGameTick_Prefix(GameLogic __instance)
|
||||||
{
|
{
|
||||||
|
if (GameMain.data?.guideComplete != true || GameMain.gameScenario == null) return;
|
||||||
var time = __instance.timei;
|
var time = __instance.timei;
|
||||||
if (time % 6 != 0) return;
|
if (time % 6 != 0) return;
|
||||||
var planet = GameMain.localPlanet;
|
var planet = GameMain.localPlanet;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
* Factory:
|
* Factory:
|
||||||
* Finish build immediately
|
* Finish build immediately
|
||||||
* Completes pending buildings as soon as their required building items are available
|
* Completes pending buildings as soon as their required building items are available
|
||||||
|
* Starts after the opening cutscene has ended or been skipped
|
||||||
* Architect mode
|
* Architect mode
|
||||||
* Unlimited use of buildings, Logistics Bots, Logistics Drones and Interstellar Logistics Vessels
|
* Unlimited use of buildings, Logistics Bots, Logistics Drones and Interstellar Logistics Vessels
|
||||||
* Construction and inventory availability checks show at least 999 of each supported item.
|
* Construction and inventory availability checks show at least 999 of each supported item.
|
||||||
@@ -129,6 +130,7 @@ The item icon selects the output; no hotkey is needed.
|
|||||||
* 工厂:
|
* 工厂:
|
||||||
* 建造秒完成
|
* 建造秒完成
|
||||||
* 所需建筑物品齐备后立即完成待建造建筑
|
* 所需建筑物品齐备后立即完成待建造建筑
|
||||||
|
* 开场动画播放结束或跳过后生效
|
||||||
* 建筑师模式
|
* 建筑师模式
|
||||||
* 建筑、配送运输机、物流运输机和星际物流运输船可无限使用
|
* 建筑、配送运输机、物流运输机和星际物流运输船可无限使用
|
||||||
* 建造及库存可用数量检查中,每种受支持物品至少显示 999 个。
|
* 建造及库存可用数量检查中,每种受支持物品至少显示 999 个。
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UXAssist", "UXAssist\UXAssi
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheatEnabler", "CheatEnabler\CheatEnabler.csproj", "{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheatEnabler", "CheatEnabler\CheatEnabler.csproj", "{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogisticMiner", "LogisticMiner\LogisticMiner.csproj", "{7149D717-C913-4153-9425-38CB9D087F83}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HideTips", "HideTips\HideTips.csproj", "{4EABD71D-477F-448B-801B-48F8745A3FA7}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HideTips", "HideTips\HideTips.csproj", "{4EABD71D-477F-448B-801B-48F8745A3FA7}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dustbin", "Dustbin\Dustbin.csproj", "{931F0230-5941-4E49-AB19-66921AF14096}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dustbin", "Dustbin\Dustbin.csproj", "{931F0230-5941-4E49-AB19-66921AF14096}"
|
||||||
@@ -65,18 +63,6 @@ Global
|
|||||||
{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}.Release|x64.Build.0 = Release|Any CPU
|
{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}.Release|x86.ActiveCfg = Release|Any CPU
|
{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}.Release|x86.Build.0 = Release|Any CPU
|
{F9F16B62-D1D3-466B-BE22-E64B9EA957C2}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{7149D717-C913-4153-9425-38CB9D087F83}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|x64.ActiveCfg = Debug|Any CPU
|
{4EABD71D-477F-448B-801B-48F8745A3FA7}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
|||||||
@@ -26,6 +26,11 @@
|
|||||||
<_ZipPath>$(_PackageDir)\$(ProjectName)-$(Version).zip</_ZipPath>
|
<_ZipPath>$(_PackageDir)\$(ProjectName)-$(Version).zip</_ZipPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- Refresh referenced preloaders before collecting patchers; other projects skip this target. -->
|
||||||
|
<MSBuild Projects="@(ProjectReference)" Targets="CopyToParentPackage"
|
||||||
|
Properties="Configuration=$(Configuration)"
|
||||||
|
Condition="'$(PackUsePluginsLayout)' == 'true'" />
|
||||||
|
|
||||||
<!-- Sync manifest.json version_number from .csproj $(Version) before packaging -->
|
<!-- Sync manifest.json version_number from .csproj $(Version) before packaging -->
|
||||||
<Exec Condition="Exists('$(_PackageDir)\manifest.json')"
|
<Exec Condition="Exists('$(_PackageDir)\manifest.json')"
|
||||||
Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$f='$(_PackageDir)\manifest.json'; $c=[IO.File]::ReadAllText($f); $c=$c -replace '(\u0022version_number\u0022\s*:\s*\u0022)[^\u0022]*(\u0022)','${1}$(Version)${2}'; [IO.File]::WriteAllText($f,$c,[Text.UTF8Encoding]::new($true))"" />
|
Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$f='$(_PackageDir)\manifest.json'; $c=[IO.File]::ReadAllText($f); $c=$c -replace '(\u0022version_number\u0022\s*:\s*\u0022)[^\u0022]*(\u0022)','${1}$(Version)${2}'; [IO.File]::WriteAllText($f,$c,[Text.UTF8Encoding]::new($true))"" />
|
||||||
|
|||||||
@@ -3,10 +3,12 @@
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
* 1.4.0
|
* 1.5.0
|
||||||
* `Storage dustbin`: Destroy splitter input to a storage placed above it, including stacked and proliferated cargo. Enabling dustbin mode also clears cached full-storage state.
|
* `Storage dustbin`: Destroy splitter input to a storage placed above it, including stacked and proliferated cargo. Enabling dustbin mode also clears cached full-storage state.
|
||||||
* `Tank dustbin`: Fix single tanks blocking liquid input after receiving their first stack, both with and without dustbin mode.
|
* `Tank dustbin`: Fix single tanks blocking liquid input after receiving their first stack, both with and without dustbin mode.
|
||||||
* `Belt signal dustbin`: Restore item disposal and startup compatibility with the current game simulation loop after DSP 0.10.33/0.10.34 updates.
|
* `Belt signal dustbin`: Restore item disposal and startup compatibility with the current game simulation loop after DSP 0.10.33/0.10.34 updates.
|
||||||
|
|
||||||
|
* 1.4.0
|
||||||
* Refactorying Tank input logic codes, for better performance, and resolve a bug [#53](https://github.com/soarqin/DSP_Mods/issues/53)
|
* Refactorying Tank input logic codes, for better performance, and resolve a bug [#53](https://github.com/soarqin/DSP_Mods/issues/53)
|
||||||
* Remove use of AssetBundle, move the belt signal icon into `Assembly Resources`, for better flexibility.
|
* Remove use of AssetBundle, move the belt signal icon into `Assembly Resources`, for better flexibility.
|
||||||
|
|
||||||
@@ -46,10 +48,12 @@
|
|||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
* 1.4.0
|
* 1.5.0
|
||||||
* `储物仓垃圾桶`:销毁四向分流器送入上方储物仓的物品,包括堆叠和喷涂增产剂的物品;启用垃圾桶时清除已满状态缓存。
|
* `储物仓垃圾桶`:销毁四向分流器送入上方储物仓的物品,包括堆叠和喷涂增产剂的物品;启用垃圾桶时清除已满状态缓存。
|
||||||
* `储液罐垃圾桶`:修复单层储液罐装入第一批液体后停止输入的问题,普通储存和垃圾桶模式均可正常工作。
|
* `储液罐垃圾桶`:修复单层储液罐装入第一批液体后停止输入的问题,普通储存和垃圾桶模式均可正常工作。
|
||||||
* `传送带信号垃圾桶`:适配当前游戏的模拟循环,修复 DSP 0.10.33/0.10.34 更新后的启动报错和物品无法销毁问题。
|
* `传送带信号垃圾桶`:适配当前游戏的模拟循环,修复 DSP 0.10.33/0.10.34 更新后的启动报错和物品无法销毁问题。
|
||||||
|
|
||||||
|
* 1.4.0
|
||||||
* 重构储液罐的输入逻辑代码,以提高性能并解决bug [#53](https://github.com/soarqin/DSP_Mods/issues/53)
|
* 重构储液罐的输入逻辑代码,以提高性能并解决bug [#53](https://github.com/soarqin/DSP_Mods/issues/53)
|
||||||
* 移除了AssetBundle的使用,将传送带信号图标移入`Assembly资源`,以获得更好的灵活性
|
* 移除了AssetBundle的使用,将传送带信号图标移入`Assembly资源`,以获得更好的灵活性
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BepInExPluginGuid>org.soardev.dustbin</BepInExPluginGuid>
|
<BepInExPluginGuid>org.soardev.dustbin</BepInExPluginGuid>
|
||||||
<Description>DSP MOD - Dustbin</Description>
|
<Description>DSP MOD - Dustbin</Description>
|
||||||
<Version>1.4.0</Version>
|
<Version>1.5.0</Version>
|
||||||
<PackageId>Dustbin</PackageId>
|
<PackageId>Dustbin</PackageId>
|
||||||
<RootNamespace>Dustbin</RootNamespace>
|
<RootNamespace>Dustbin</RootNamespace>
|
||||||
<PackHasChangelog>true</PackHasChangelog>
|
<PackHasChangelog>true</PackHasChangelog>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Dustbin",
|
"name": "Dustbin",
|
||||||
"version_number": "1.4.0",
|
"version_number": "1.5.0",
|
||||||
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/Dustbin",
|
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/Dustbin",
|
||||||
"description": "Can turn Storages and Tanks into Dustbin(Destroy incoming items) / 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)",
|
"description": "Can turn Storages and Tanks into Dustbin(Destroy incoming items) / 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
|||||||
+22
-8
@@ -3,10 +3,17 @@
|
|||||||
|
|
||||||
## Changlog
|
## Changlog
|
||||||
|
|
||||||
* 1.6.3 - Unreleased
|
* 1.6.4
|
||||||
* `Sunlight at night`: Base lighting on the camera and the viewed surface instead of Icarus's facing direction, including planet view. Keep building, terrain, solar-panel, and belt lighting directions synchronized, recover when the active light or planet changes, and restore native lighting when sailing, disabling the feature, or using white rendering mode.
|
* `Hide battle-related techs in Peace mode`: Fix an array index error when opening the tech tree after switching from a Peace-mode save to a Combat-mode save in the same game process, including when disabling the option after loading another Peace-mode save.
|
||||||
* `Quick build Mining Machines`: Add a Factory-tab button that searches dense layouts at the nearest solid vein group using native collision shapes, including interleaving feet, joint placement of nearby miners, and a final pass to fill remaining compatible positions. `Allow restoring/burying veins` is off by default: uses only visible nodes and skips all restoration and burial calculations. When enabled, restores available buried nodes and may bury unused nodes to improve coverage. Optimizes summed vein coverage, requires at least 3 covered nodes per miner after any burial, and places the full ordinary miner layout regardless of stock, leaving ghosts awaiting missing materials. Accelerates layout searches with up to 4 background workers, capped at half the available logical processors. Writes replayable JSON snapshots during feature tuning and keeps the completion tip visible for about 8 seconds.
|
* 1.6.3
|
||||||
* `Blueprint descriptions`: Add an `Auto-fill description` button and a `Proliferation` checkbox above the description boxes in the blueprint browser, copy, and paste panels. The button replaces the main description with the blueprint's full-load material flows per minute on separate `Missing`, `Excess`, `Input`, `Output`, and `Research` lines, and writes factory and logistics power demand to a `Power` custom field. Inputs are limited to what downstream buildings can use, matrices made in a blueprint with a research-mode lab are listed under `Research`, and research-mode labs are budgeted at full working power. The checkbox defaults to on when the blueprint contains a Spray Coater. Unknown values are marked instead of shown as zero, other custom fields are preserved, and nothing is saved automatically.
|
* `Quick build Mining Machines`:
|
||||||
|
* Add a Factory-tab button to arrange ordinary Mining Machines densely around the nearest solid vein group. Each miner covers at least 3 nodes from that group, without including nearby groups. Layouts are not limited by stock; missing miners remain as ghosts awaiting materials. Placement respects construction range and does not include belts or power facilities. Click again to cancel a search.
|
||||||
|
* `Allow restoring/burying veins` is off by default, using only visible nodes without restoring or burying any. Enable it to restore unobstructed nodes away from Dark Fog Planetary Bases and allow unused nodes to be buried for better coverage. Nodes used by existing miners or miner ghosts are protected.
|
||||||
|
* `Blueprint descriptions`:
|
||||||
|
* Add `Auto-fill description` to the blueprint browser, copy, and paste panels. It replaces the main description with full-load material flows per minute, separating shortages, surpluses, inputs, outputs, and research use, and adds factory and logistics power demand to a `Power` custom field.
|
||||||
|
* A `Proliferation` checkbox controls whether calculations include proliferation, defaulting to on when the blueprint contains a Spray Coater. Large rates use K/M/G where display precision is preserved, and numbers with four or more integer digits use comma thousands separators, including before suffixes; unknown values are marked separately. Other custom fields are preserved, and the blueprint still needs to be saved manually.
|
||||||
|
* `Sunlight at night`: Lighting now follows the camera, including planet view, and stays consistent across buildings, terrain, solar panels, and belts. Restore lighting correctly after switching planets, and return to native lighting when sailing, disabling the feature, or using white rendering mode.
|
||||||
|
* `Protect veins from exhaustion`: Fix the option failing to take effect in 1.6.2, restoring protection of configured vein reserves and minimum oil rates, along with the corresponding mining statistics.
|
||||||
* 1.6.2
|
* 1.6.2
|
||||||
* `Increase maximum power usage in Logistic Stations and Advanced Mining Machines`: Fix zero or corrupted mining speeds when adjusting an Advanced Mining Machine's speed slider with the option enabled.
|
* `Increase maximum power usage in Logistic Stations and Advanced Mining Machines`: Fix zero or corrupted mining speeds when adjusting an Advanced Mining Machine's speed slider with the option enabled.
|
||||||
* `Tweak building buffers`: Restore the Ray Receiver Graviton Lens buffer setting on DSP 0.10.35.29104 and later, and correct the displayed native buffer value to 2.
|
* `Tweak building buffers`: Restore the Ray Receiver Graviton Lens buffer setting on DSP 0.10.35.29104 and later, and correct the displayed native buffer value to 2.
|
||||||
@@ -438,10 +445,17 @@
|
|||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
* 1.6.3 - Unreleased
|
* 1.6.4
|
||||||
* `夜间日光灯`:按镜头和当前观察位置的地表方向计算光照,不再跟随机甲朝向,行星视图也适用。统一建筑、地表、太阳能板和传送带的光照方向,在光源或行星切换后恢复功能,并在航行、关闭功能或白模渲染时恢复原版光照。
|
* `在和平模式下隐藏战斗相关科技`:修复在同一次游戏运行中从和平模式存档切换到战斗模式存档后打开科技树时的数组越界,以及再次加载和平模式存档后关闭选项时的同类问题。
|
||||||
* `快速铺设采矿机`:在「工厂」页增加按钮,按游戏实际碰撞体在最近的固体矿脉搜索密集布局,支持脚部交错、邻近矿机联动调整及结束前补入剩余可用位置。「允许恢复/掩埋矿物」默认关闭:仅使用可见矿点,跳过所有恢复和掩埋计算;开启后,恢复可恢复的掩埋矿点,并允许掩埋未被使用的矿点来提高覆盖数。以各台矿机覆盖矿点数之和为目标,要求每台在掩埋后仍覆盖至少 3 个矿点,不受库存限制地生成完整布局,缺少采矿机的位置保留待建造虚影。使用最多 4 个后台线程加速布局搜索,线程数不超过可用逻辑线程数的一半。功能调试期间输出可离线重放的 JSON 数据,完成提示保留约 8 秒。
|
* 1.6.3
|
||||||
* `蓝图说明`:在蓝图浏览、复制和粘贴界面的说明框上方增加「自动填写说明」按钮和「增产」复选框。点击按钮会用蓝图满负荷运行时每分钟的物料流量替换原说明,按需分行列出「缺少」「多余」「输入」「输出」「研究」,并将工厂与物流耗电写入「耗电」自定义字段。输入量以下游建筑实际能消耗的量为限;蓝图含研究模式研究站时,蓝图内产出的矩阵列入「研究」行,研究模式研究站均按满负荷计入耗电。蓝图含喷涂机时,复选框默认勾选。无法计算的数值会单独标注而不显示为零,其他自定义字段保持不变,也不会自动保存蓝图。
|
* `快速铺设采矿机`:
|
||||||
|
* 在「工厂」页增加按钮,自动在最近的固体矿脉周围密集铺设普通采矿机。每台至少覆盖选中矿脉的 3 个矿点,不混入附近其他矿脉。布局数量不受库存限制,采矿机不足的位置保留待建造虚影。遵守建造范围,不自动铺设传送带和电力设施。计算期间再次点击可取消。
|
||||||
|
* 「允许恢复/掩埋矿物」默认关闭,仅使用可见矿点,不恢复或掩埋矿点。开启后可恢复未被建筑阻挡、且远离黑雾行星基地的矿点,并允许掩埋未使用的矿点来提高覆盖数;已有矿机和待建造矿机使用的矿点会受到保护。
|
||||||
|
* `蓝图说明`:
|
||||||
|
* 在蓝图浏览、复制和粘贴界面增加「自动填写说明」按钮,用满负荷运行时每分钟的物料流量替换原说明,分别列出「缺少」「多余」「输入」「输出」「研究」,并将工厂与物流耗电写入「耗电」自定义字段。
|
||||||
|
* 可用「增产」复选框选择是否计入增产效果,蓝图含喷涂机时默认勾选。较大的流量在保留显示精度的前提下使用 K/M/G 单位;整数部分达到四位的数字用逗号每三位分隔,带单位时也适用。无法计算的数值单独标注。保留其他自定义字段,填写后仍需手动保存蓝图。
|
||||||
|
* `夜间日光灯`:光照改为随镜头变化,行星视图也适用;建筑、地表、太阳能板和传送带的光照方向保持一致。切换行星后正确恢复光照,航行、关闭功能或进入白模渲染时恢复原版光照。
|
||||||
|
* `保护矿脉不会枯竭`:修复 1.6.2 中开启后仍不生效的问题,恢复设定的矿脉剩余量、油井最低流速保护及相应开采统计。
|
||||||
* 1.6.2
|
* 1.6.2
|
||||||
* `提升物流塔和大型采矿机的最大功耗`:修复启用后调整大型采矿机开采速度时出现 0% 或异常速度的问题。
|
* `提升物流塔和大型采矿机的最大功耗`:修复启用后调整大型采矿机开采速度时出现 0% 或异常速度的问题。
|
||||||
* `调整建筑输入缓冲`:修复 DSP 0.10.35.29104 及后续版本中射线接收器透镜缓冲设置不生效的问题,并将显示的游戏原始值更正为 2。
|
* `调整建筑输入缓冲`:修复 DSP 0.10.35.29104 及后续版本中射线接收器透镜缓冲设置不生效的问题,并将显示的游戏原始值更正为 2。
|
||||||
|
|||||||
@@ -13,49 +13,44 @@ public static class ItemIds
|
|||||||
public const int SulfuricAcid = 1116;
|
public const int SulfuricAcid = 1116;
|
||||||
public const int Hydrogen = 1120;
|
public const int Hydrogen = 1120;
|
||||||
public const int Deuterium = 1121;
|
public const int Deuterium = 1121;
|
||||||
public const int Photon = 1208;
|
public const int CriticalPhoton = 1208;
|
||||||
|
|
||||||
/* Materials used by recipes */
|
/* Materials and components */
|
||||||
public const int OrganicCrystal = 1015;
|
public const int TitaniumAlloy = 1107;
|
||||||
public const int FireIce = 1012;
|
public const int Prism = 1111;
|
||||||
public const int CriticalPhoton = 1124;
|
public const int FrameMaterial = 1125;
|
||||||
public const int CircuitBoard = 1112; // used in proliferator mk.III recipe
|
public const int CasimirCrystal = 1126;
|
||||||
public const int Steel = 1107;
|
public const int MagneticCoil = 1202;
|
||||||
public const int TitaniumGlass = 1111;
|
public const int ElectricMotor = 1203;
|
||||||
public const int GravitonLens = 1125;
|
public const int ElectromagneticTurbine = 1204;
|
||||||
|
public const int SuperMagneticRing = 1205;
|
||||||
|
public const int GravitonLens = 1209;
|
||||||
|
public const int CircuitBoard = 1301;
|
||||||
|
public const int QuantumChip = 1305;
|
||||||
|
public const int PlasmaExciter = 1401;
|
||||||
|
public const int ParticleBroadband = 1402;
|
||||||
|
public const int AnnihilationConstraintSphere = 1403;
|
||||||
|
public const int Thruster = 1405;
|
||||||
|
public const int ReinforcedThruster = 1406;
|
||||||
|
|
||||||
/* Proliferators */
|
/* Proliferators */
|
||||||
public const int ProliferatorMkI = 1141;
|
public const int ProliferatorMkI = 1141;
|
||||||
public const int ProliferatorMkII = 1142;
|
public const int ProliferatorMkII = 1142;
|
||||||
public const int ProliferatorMkIII = 1143;
|
public const int ProliferatorMkIII = 1143;
|
||||||
|
|
||||||
/* Logistics carriers */
|
/* Logistics */
|
||||||
|
public const int SpaceWarper = 1210;
|
||||||
public const int LogisticsDrone = 5001;
|
public const int LogisticsDrone = 5001;
|
||||||
public const int LogisticsVessel = 5002;
|
public const int LogisticsVessel = 5002;
|
||||||
public const int LogisticsBot = 5003;
|
public const int LogisticsBot = 5003;
|
||||||
public const int SpaceWarper = 1126;
|
|
||||||
|
|
||||||
/* Matrices */
|
|
||||||
public const int ElectromagneticMatrix = 1202;
|
|
||||||
public const int EnergyMatrix = 1203;
|
|
||||||
public const int StructureMatrix = 1204;
|
|
||||||
public const int InformationMatrix = 1205;
|
|
||||||
public const int UniverseMatrix = 1209;
|
|
||||||
public const int Antimatter = 1210;
|
|
||||||
|
|
||||||
/* Components */
|
|
||||||
public const int PlasmaExciter = 1301;
|
|
||||||
public const int ParticleBroadband = 1305;
|
|
||||||
public const int Processor = 1401;
|
|
||||||
public const int QuantumChip = 1402;
|
|
||||||
public const int MicrocrystallineComponent = 1403;
|
|
||||||
public const int PlaneFilter = 1405;
|
|
||||||
public const int ParticleContainer = 1406;
|
|
||||||
|
|
||||||
/* Dyson sphere materials */
|
/* Dyson sphere materials */
|
||||||
public const int SolarSail = 1502;
|
public const int DysonSphereComponent = 1502;
|
||||||
public const int FrameMaterial = 1503;
|
public const int SmallCarrierRocket = 1503;
|
||||||
public const int DysonSphereComponent = 1802;
|
|
||||||
|
/* Fuel rods */
|
||||||
|
public const int DeuteronFuelRod = 1802;
|
||||||
|
public const int StrangeAnnihilationFuelRod = 1804;
|
||||||
|
|
||||||
/* Power nodes */
|
/* Power nodes */
|
||||||
public const int TeslaTower = 2201;
|
public const int TeslaTower = 2201;
|
||||||
@@ -67,49 +62,49 @@ public static class ItemIds
|
|||||||
public const int MiningMachine = 2301;
|
public const int MiningMachine = 2301;
|
||||||
|
|
||||||
/* Dark Fog items (combat expansion) */
|
/* Dark Fog items (combat expansion) */
|
||||||
public const int DarkFogMemoryUnit = 5201;
|
public const int DarkFogMatrix = 5201;
|
||||||
public const int DarkFogSiliconNeuron = 5202;
|
public const int DarkFogSiliconNeuron = 5202;
|
||||||
public const int DarkFogMatterReassembler = 5203;
|
public const int DarkFogMatterRecombinator = 5203;
|
||||||
public const int DarkFogNegentropySingularity = 5204;
|
public const int DarkFogNegentropySingularity = 5204;
|
||||||
public const int DarkFogVirtualParticle = 5205;
|
public const int DarkFogCoreElement = 5205;
|
||||||
public const int DarkFogEnergyFragment = 5206;
|
public const int DarkFogEnergyShard = 5206;
|
||||||
|
|
||||||
/* Fuel and advanced items */
|
/* Matrices. Metadata types use the same IDs; the Universe Matrix's metadata is Metaverse. */
|
||||||
public const int HydrogenFuelRod = 6001;
|
public const int ElectromagneticMatrix = 6001;
|
||||||
public const int DeuteronFuelRod = 6002;
|
public const int EnergyMatrix = 6002;
|
||||||
public const int AntimatterFuelRod = 6003;
|
public const int StructureMatrix = 6003;
|
||||||
public const int StrangeAnnihilationFuelRod = 1804;
|
public const int InformationMatrix = 6004;
|
||||||
public const int StrangeMatter = 6004;
|
public const int GravityMatrix = 6005;
|
||||||
public const int Foundation = 6005;
|
public const int UniverseMatrix = 6006;
|
||||||
public const int Metaverse = 6006; // also called property/meta-data item
|
|
||||||
|
|
||||||
/* Item groups used by belt signal recipe calculations. */
|
/* Item groups used by belt signal recipe calculations. */
|
||||||
public static readonly int[] ExtraOreItemIds =
|
public static readonly int[] ExtraOreItemIds =
|
||||||
[
|
[
|
||||||
Water, SulfuricAcid, Hydrogen, Deuterium, Photon,
|
Water, SulfuricAcid, Hydrogen, Deuterium, CriticalPhoton,
|
||||||
DarkFogMemoryUnit, DarkFogSiliconNeuron, DarkFogMatterReassembler,
|
DarkFogMatrix, DarkFogSiliconNeuron, DarkFogMatterRecombinator,
|
||||||
DarkFogNegentropySingularity, DarkFogVirtualParticle, DarkFogEnergyFragment
|
DarkFogNegentropySingularity, DarkFogCoreElement, DarkFogEnergyShard
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Listed in the same order as the belt signal option tips.
|
||||||
public static readonly HashSet<int> ExtraProliferationItemIds =
|
public static readonly HashSet<int> ExtraProliferationItemIds =
|
||||||
[
|
[
|
||||||
Steel, TitaniumGlass, GravitonLens, ProliferatorMkII, ProliferatorMkIII,
|
TitaniumAlloy, Prism, FrameMaterial, ProliferatorMkII, ProliferatorMkIII,
|
||||||
ElectromagneticMatrix, EnergyMatrix, StructureMatrix, InformationMatrix,
|
MagneticCoil, ElectricMotor, ElectromagneticTurbine, SuperMagneticRing,
|
||||||
UniverseMatrix, Antimatter, PlasmaExciter, ParticleBroadband,
|
CircuitBoard, Thruster, ReinforcedThruster, PlasmaExciter, ParticleBroadband,
|
||||||
Processor, QuantumChip, MicrocrystallineComponent, PlaneFilter, ParticleContainer,
|
GravitonLens, QuantumChip, AnnihilationConstraintSphere, DeuteronFuelRod, SpaceWarper,
|
||||||
SolarSail, FrameMaterial, DysonSphereComponent,
|
DysonSphereComponent, SmallCarrierRocket, ElectromagneticMatrix, StructureMatrix,
|
||||||
HydrogenFuelRod, AntimatterFuelRod, StrangeMatter, Foundation, Metaverse
|
InformationMatrix, GravityMatrix, UniverseMatrix
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly HashSet<int> NoProliferationItemIds =
|
public static readonly HashSet<int> NoProliferationItemIds =
|
||||||
[
|
[
|
||||||
SpaceWarper, DeuteronFuelRod
|
CasimirCrystal, EnergyMatrix
|
||||||
];
|
];
|
||||||
|
|
||||||
/* Dark Fog materials used by production calculations. */
|
/* Dark Fog materials used by production calculations. */
|
||||||
public static readonly int[] DarkFogItemIds =
|
public static readonly int[] DarkFogItemIds =
|
||||||
[
|
[
|
||||||
DarkFogMemoryUnit, DarkFogSiliconNeuron, DarkFogMatterReassembler,
|
DarkFogMatrix, DarkFogSiliconNeuron, DarkFogMatterRecombinator,
|
||||||
DarkFogNegentropySingularity, DarkFogVirtualParticle, DarkFogEnergyFragment
|
DarkFogNegentropySingularity, DarkFogCoreElement, DarkFogEnergyShard
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -205,8 +205,10 @@ public static class I18NKeys
|
|||||||
public const string QuickMinerFailed = "Miner placement stopped; check the log before retrying";
|
public const string QuickMinerFailed = "Miner placement stopped; check the log before retrying";
|
||||||
public const string QuickMinerVeinsChanged = "Veins changed during miner layout search";
|
public const string QuickMinerVeinsChanged = "Veins changed during miner layout search";
|
||||||
public const string QuickMinerResult = "Placed {0} Mining Machines, {1} total vein coverage, {2} buried nodes";
|
public const string QuickMinerResult = "Placed {0} Mining Machines, {1} total vein coverage, {2} buried nodes";
|
||||||
|
#if DEBUG
|
||||||
public const string QuickMinerDebugSaved = "Miner layout debug data: {0}";
|
public const string QuickMinerDebugSaved = "Miner layout debug data: {0}";
|
||||||
public const string QuickMinerDebugFailed = "Could not save miner layout debug data";
|
public const string QuickMinerDebugFailed = "Could not save miner layout debug data";
|
||||||
|
#endif
|
||||||
public const string MaximumCountToBuild = "Maximum count to build";
|
public const string MaximumCountToBuild = "Maximum count to build";
|
||||||
public const string Max = "max";
|
public const string Max = "max";
|
||||||
public const string StopEjectorsWhenAvailableNodesAreAllFilledUp = "Stop ejectors when available nodes are all filled up";
|
public const string StopEjectorsWhenAvailableNodesAreAllFilledUp = "Stop ejectors when available nodes are all filled up";
|
||||||
@@ -501,8 +503,10 @@ You can set 2 shortcut keys in Settings panel:
|
|||||||
I18N.Add(QuickMinerFailed, "Miner placement stopped. Check the UXAssist log before retrying.", "采矿机铺设已停止,请查看 UXAssist 日志后重试。");
|
I18N.Add(QuickMinerFailed, "Miner placement stopped. Check the UXAssist log before retrying.", "采矿机铺设已停止,请查看 UXAssist 日志后重试。");
|
||||||
I18N.Add(QuickMinerVeinsChanged, "The veins changed during calculation. Click the button again to recalculate the layout.", "计算期间矿点状态已变化,请再次点击按钮重新计算布局。");
|
I18N.Add(QuickMinerVeinsChanged, "The veins changed during calculation. Click the button again to recalculate the layout.", "计算期间矿点状态已变化,请再次点击按钮重新计算布局。");
|
||||||
I18N.Add(QuickMinerResult, "Placed {0} Mining Machines; total vein coverage: {1} (shared nodes counted per miner); buried nodes: {2}.", "已铺设 {0} 台采矿机,总覆盖 {1} 个矿点(各台分别计数),掩埋 {2} 个矿点。");
|
I18N.Add(QuickMinerResult, "Placed {0} Mining Machines; total vein coverage: {1} (shared nodes counted per miner); buried nodes: {2}.", "已铺设 {0} 台采矿机,总覆盖 {1} 个矿点(各台分别计数),掩埋 {2} 个矿点。");
|
||||||
|
#if DEBUG
|
||||||
I18N.Add(QuickMinerDebugSaved, "Debug data: {0}", "调试数据:{0}");
|
I18N.Add(QuickMinerDebugSaved, "Debug data: {0}", "调试数据:{0}");
|
||||||
I18N.Add(QuickMinerDebugFailed, "Could not save debug data. Check the UXAssist log before retrying.", "调试数据保存失败,请查看 UXAssist 日志后重试。");
|
I18N.Add(QuickMinerDebugFailed, "Could not save debug data. Check the UXAssist log before retrying.", "调试数据保存失败,请查看 UXAssist 日志后重试。");
|
||||||
|
#endif
|
||||||
I18N.Add(MaximumCountToBuild, "Maximum count to build", "最大建造数量");
|
I18N.Add(MaximumCountToBuild, "Maximum count to build", "最大建造数量");
|
||||||
I18N.Add(Max, "max", "最大");
|
I18N.Add(Max, "max", "最大");
|
||||||
I18N.Add(StopEjectorsWhenAvailableNodesAreAllFilledUp, "Stop ejectors when available nodes are all filled up", "可用节点全部造完时停止弹射");
|
I18N.Add(StopEjectorsWhenAvailableNodesAreAllFilledUp, "Stop ejectors when available nodes are all filled up", "可用节点全部造完时停止弹射");
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ internal static class MinerPlacementDebug
|
|||||||
internal sealed class Snapshot
|
internal sealed class Snapshot
|
||||||
{
|
{
|
||||||
public int schema = 4;
|
public int schema = 4;
|
||||||
public string algorithm = "parallel-repack-v5-pose-exploration-min3-unlimited-stock";
|
public string algorithm = "parallel-repack-v5-pose-exploration-min3-unlimited-stock-target-group";
|
||||||
public int minimumCoverage = MinerPlacementSolver.MinimumCoverage;
|
public int minimumCoverage = MinerPlacementSolver.MinimumCoverage;
|
||||||
public string version, gameVersion, startedUtc, outcome, error;
|
public string version, gameVersion, startedUtc, outcome, error;
|
||||||
public int planetId, veinType, veinGroup, initialStock, placedCount, totalCoverage, buriedCount;
|
public int planetId, veinType, veinGroup, initialStock, placedCount, totalCoverage, buriedCount;
|
||||||
|
|||||||
@@ -2,11 +2,15 @@ using System;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
#if DEBUG
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
#endif
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
#if DEBUG
|
||||||
using BepInEx;
|
using BepInEx;
|
||||||
|
#endif
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
@@ -99,12 +103,13 @@ public static class QuickMinerBuild
|
|||||||
private static void Fail(Exception exception)
|
private static void Fail(Exception exception)
|
||||||
{
|
{
|
||||||
UXAssist.Logger.LogError($"Quick miner placement failed: {exception}");
|
UXAssist.Logger.LogError($"Quick miner placement failed: {exception}");
|
||||||
|
#if DEBUG
|
||||||
_job?.RecordFailure(exception);
|
_job?.RecordFailure(exception);
|
||||||
|
#endif
|
||||||
Stop();
|
Stop();
|
||||||
UIRealtimeTip.Popup(I18NKeys.QuickMinerFailed.Translate());
|
UIRealtimeTip.Popup(I18NKeys.QuickMinerFailed.Translate());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Completion, failure and cancellation all finish the job, which records its debug data.
|
|
||||||
private static void Stop()
|
private static void Stop()
|
||||||
{
|
{
|
||||||
var job = _job;
|
var job = _job;
|
||||||
@@ -120,7 +125,9 @@ public static class QuickMinerBuild
|
|||||||
|
|
||||||
private static void ShowResult(string message)
|
private static void ShowResult(string message)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
UXAssist.Logger.LogInfo($"Quick miner result: {message.Replace("\n", " | ")}");
|
UXAssist.Logger.LogInfo($"Quick miner result: {message.Replace("\n", " | ")}");
|
||||||
|
#endif
|
||||||
UIRealtimeTip.Popup(message);
|
UIRealtimeTip.Popup(message);
|
||||||
foreach (var tip in UIRoot.instance.uiGame.generalTips.realtimeTips)
|
foreach (var tip in UIRoot.instance.uiGame.generalTips.realtimeTips)
|
||||||
{
|
{
|
||||||
@@ -160,7 +167,10 @@ public static class QuickMinerBuild
|
|||||||
private sealed class Node
|
private sealed class Node
|
||||||
{
|
{
|
||||||
public int Id;
|
public int Id;
|
||||||
public Vector3 Position, OriginalPosition;
|
public Vector3 Position;
|
||||||
|
#if DEBUG
|
||||||
|
public Vector3 OriginalPosition;
|
||||||
|
#endif
|
||||||
public ColliderData Collider;
|
public ColliderData Collider;
|
||||||
public bool Target, Visible, CanBury;
|
public bool Target, Visible, CanBury;
|
||||||
public EVeinType Type;
|
public EVeinType Type;
|
||||||
@@ -187,10 +197,12 @@ public static class QuickMinerBuild
|
|||||||
private readonly ColliderData _body;
|
private readonly ColliderData _body;
|
||||||
private readonly float _footprintRadius, _halfDiagonal;
|
private readonly float _footprintRadius, _halfDiagonal;
|
||||||
private readonly bool _capsule, _allowVeinReform;
|
private readonly bool _capsule, _allowVeinReform;
|
||||||
|
#if DEBUG
|
||||||
private readonly MinerPlacementDebug.Snapshot _debug = new();
|
private readonly MinerPlacementDebug.Snapshot _debug = new();
|
||||||
private readonly List<MinerPlacementDebug.Phase> _phases = [];
|
private readonly List<MinerPlacementDebug.Phase> _phases = [];
|
||||||
private readonly List<MinerPlacementDebug.Placement> _placements = [];
|
private readonly List<MinerPlacementDebug.Placement> _placements = [];
|
||||||
private readonly Stopwatch _timer = Stopwatch.StartNew();
|
private readonly Stopwatch _timer = Stopwatch.StartNew();
|
||||||
|
#endif
|
||||||
private readonly CancellationTokenSource _cancellation = new();
|
private readonly CancellationTokenSource _cancellation = new();
|
||||||
private readonly int _workers = MinerPlacementSolver.WorkerCount;
|
private readonly int _workers = MinerPlacementSolver.WorkerCount;
|
||||||
private IEnumerator _work;
|
private IEnumerator _work;
|
||||||
@@ -200,6 +212,7 @@ public static class QuickMinerBuild
|
|||||||
private float _probeX = float.NaN, _probeZ = float.NaN;
|
private float _probeX = float.NaN, _probeZ = float.NaN;
|
||||||
private bool _probeRestricted;
|
private bool _probeRestricted;
|
||||||
private EVeinType _type;
|
private EVeinType _type;
|
||||||
|
private int _group;
|
||||||
private float _minX, _maxX, _minZ, _maxZ;
|
private float _minX, _maxX, _minZ, _maxZ;
|
||||||
|
|
||||||
public bool IsCurrent => GameMain.isRunning && GameMain.mainPlayer == _player &&
|
public bool IsCurrent => GameMain.isRunning && GameMain.mainPlayer == _player &&
|
||||||
@@ -231,6 +244,7 @@ public static class QuickMinerBuild
|
|||||||
// Native clearance checks measure from the encompassing build collider.
|
// Native clearance checks measure from the encompassing build collider.
|
||||||
_halfDiagonal = Mathf.Sqrt(desc.buildCollider.ext.x * desc.buildCollider.ext.x + desc.buildCollider.ext.z * desc.buildCollider.ext.z);
|
_halfDiagonal = Mathf.Sqrt(desc.buildCollider.ext.x * desc.buildCollider.ext.x + desc.buildCollider.ext.z * desc.buildCollider.ext.z);
|
||||||
_capsule = planet.id == planet.galaxy.birthPlanetId && GameMain.history.SpaceCapsuleExist();
|
_capsule = planet.id == planet.galaxy.birthPlanetId && GameMain.history.SpaceCapsuleExist();
|
||||||
|
#if DEBUG
|
||||||
_debug.version = PluginInfo.PLUGIN_VERSION;
|
_debug.version = PluginInfo.PLUGIN_VERSION;
|
||||||
_debug.gameVersion = GameConfig.gameVersion.ToString();
|
_debug.gameVersion = GameConfig.gameVersion.ToString();
|
||||||
_debug.startedUtc = DateTime.UtcNow.ToString("O");
|
_debug.startedUtc = DateTime.UtcNow.ToString("O");
|
||||||
@@ -247,15 +261,18 @@ public static class QuickMinerBuild
|
|||||||
_debug.buildColliders = desc.buildColliders.Select(MinerPlacementDebug.Collider.Capture).ToArray();
|
_debug.buildColliders = desc.buildColliders.Select(MinerPlacementDebug.Collider.Capture).ToArray();
|
||||||
_debug.minerColliders = _nativeObstacles.Select(MinerPlacementDebug.Collider.Capture).ToArray();
|
_debug.minerColliders = _nativeObstacles.Select(MinerPlacementDebug.Collider.Capture).ToArray();
|
||||||
_debug.outcome = "cancelled";
|
_debug.outcome = "cancelled";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Step() => (_work ??= Run()).MoveNext();
|
public bool Step() => (_work ??= Run()).MoveNext();
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
public void RecordFailure(Exception exception)
|
public void RecordFailure(Exception exception)
|
||||||
{
|
{
|
||||||
_debug.outcome = "failed";
|
_debug.outcome = "failed";
|
||||||
_debug.error = exception.ToString();
|
_debug.error = exception.ToString();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
public void Finish()
|
public void Finish()
|
||||||
{
|
{
|
||||||
@@ -271,15 +288,20 @@ public static class QuickMinerBuild
|
|||||||
_cancellation.Dispose();
|
_cancellation.Dispose();
|
||||||
}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||||
(_work as IDisposable)?.Dispose();
|
(_work as IDisposable)?.Dispose();
|
||||||
|
#if DEBUG
|
||||||
var location = WriteDebug();
|
var location = WriteDebug();
|
||||||
if (_result != null) ShowResult(_result + "\n" + location);
|
if (_result != null) _result += "\n" + location;
|
||||||
|
#endif
|
||||||
|
if (_result != null) ShowResult(_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator Run()
|
private IEnumerator Run()
|
||||||
{
|
{
|
||||||
if (!FindNodes())
|
if (!FindNodes())
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
_debug.outcome = "no-veins";
|
_debug.outcome = "no-veins";
|
||||||
|
#endif
|
||||||
_result = I18NKeys.QuickMinerNoVeins.Translate();
|
_result = I18NKeys.QuickMinerNoVeins.Translate();
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
@@ -299,23 +321,43 @@ public static class QuickMinerBuild
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var solver = new MinerPlacementSolver(_candidates, _nodes.Count, _allowVeinReform);
|
var solver = new MinerPlacementSolver(_candidates, _nodes.Count, _allowVeinReform);
|
||||||
var work = Search(solver, "coarse", 10);
|
#if DEBUG
|
||||||
|
var work = Search(solver, 10, "coarse");
|
||||||
|
#else
|
||||||
|
var work = Search(solver, 10);
|
||||||
|
#endif
|
||||||
while (work.MoveNext()) yield return null;
|
while (work.MoveNext()) yield return null;
|
||||||
work = Expand(solver.Best, 0.35f, 3f);
|
work = Expand(solver.Best, 0.35f, 3f);
|
||||||
while (work.MoveNext()) yield return null;
|
while (work.MoveNext()) yield return null;
|
||||||
work = Search(solver, "refine-position", 6);
|
#if DEBUG
|
||||||
|
work = Search(solver, 6, "refine-position");
|
||||||
|
#else
|
||||||
|
work = Search(solver, 6);
|
||||||
|
#endif
|
||||||
while (work.MoveNext()) yield return null;
|
while (work.MoveNext()) yield return null;
|
||||||
work = Expand(solver.Best, 0.12f, 1f);
|
work = Expand(solver.Best, 0.12f, 1f);
|
||||||
while (work.MoveNext()) yield return null;
|
while (work.MoveNext()) yield return null;
|
||||||
work = Search(solver, "refine-angle", 4);
|
#if DEBUG
|
||||||
|
work = Search(solver, 4, "refine-angle");
|
||||||
|
#else
|
||||||
|
work = Search(solver, 4);
|
||||||
|
#endif
|
||||||
while (work.MoveNext()) yield return null;
|
while (work.MoveNext()) yield return null;
|
||||||
|
#if DEBUG
|
||||||
_debug.outcome = "completed";
|
_debug.outcome = "completed";
|
||||||
|
#endif
|
||||||
Commit(solver.Best);
|
Commit(solver.Best);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator Search(MinerPlacementSolver solver, string phase, int passes)
|
#if DEBUG
|
||||||
|
private IEnumerator Search(MinerPlacementSolver solver, int passes, string phase)
|
||||||
|
#else
|
||||||
|
private IEnumerator Search(MinerPlacementSolver solver, int passes)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
var timer = Stopwatch.StartNew();
|
var timer = Stopwatch.StartNew();
|
||||||
|
#endif
|
||||||
if (_workers > 0)
|
if (_workers > 0)
|
||||||
{
|
{
|
||||||
_search = solver.SearchAsync(passes, _cancellation.Token, _workers);
|
_search = solver.SearchAsync(passes, _cancellation.Token, _workers);
|
||||||
@@ -328,14 +370,17 @@ public static class QuickMinerBuild
|
|||||||
var work = solver.Search(passes);
|
var work = solver.Search(passes);
|
||||||
while (work.MoveNext()) yield return null;
|
while (work.MoveNext()) yield return null;
|
||||||
}
|
}
|
||||||
|
#if DEBUG
|
||||||
_phases.Add(new MinerPlacementDebug.Phase
|
_phases.Add(new MinerPlacementDebug.Phase
|
||||||
{
|
{
|
||||||
name = phase, candidateCount = _candidates.Count, passes = passes, score = solver.BestScore,
|
name = phase, candidateCount = _candidates.Count, passes = passes, score = solver.BestScore,
|
||||||
searchMilliseconds = timer.ElapsedMilliseconds, elapsedMilliseconds = _timer.ElapsedMilliseconds,
|
searchMilliseconds = timer.ElapsedMilliseconds, elapsedMilliseconds = _timer.ElapsedMilliseconds,
|
||||||
selected = solver.Best.Select(candidate => _candidates.IndexOf(candidate)).ToArray()
|
selected = solver.Best.Select(candidate => _candidates.IndexOf(candidate)).ToArray()
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
private string WriteDebug()
|
private string WriteDebug()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -369,6 +414,7 @@ public static class QuickMinerBuild
|
|||||||
return I18NKeys.QuickMinerDebugFailed.Translate();
|
return I18NKeys.QuickMinerDebugFailed.Translate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private bool FindNodes()
|
private bool FindNodes()
|
||||||
{
|
{
|
||||||
@@ -386,7 +432,10 @@ public static class QuickMinerBuild
|
|||||||
_type = vein.type;
|
_type = vein.type;
|
||||||
}
|
}
|
||||||
if (group == 0) return false;
|
if (group == 0) return false;
|
||||||
|
_group = group;
|
||||||
|
#if DEBUG
|
||||||
_debug.veinGroup = group;
|
_debug.veinGroup = group;
|
||||||
|
#endif
|
||||||
var count = 0;
|
var count = 0;
|
||||||
for (var i = 1; i < _factory.veinCursor; i++)
|
for (var i = 1; i < _factory.veinCursor; i++)
|
||||||
{
|
{
|
||||||
@@ -438,11 +487,15 @@ public static class QuickMinerBuild
|
|||||||
_nodes.Add(new Node
|
_nodes.Add(new Node
|
||||||
{
|
{
|
||||||
Id = i, Target = vein.groupIndex == group, Type = vein.type,
|
Id = i, Target = vein.groupIndex == group, Type = vein.type,
|
||||||
Position = vein.pos, OriginalPosition = vein.pos, Collider = _physics.GetColliderData(vein.colliderId),
|
Position = vein.pos, Collider = _physics.GetColliderData(vein.colliderId),
|
||||||
|
#if DEBUG
|
||||||
|
OriginalPosition = vein.pos,
|
||||||
|
#endif
|
||||||
Visible = vein.pos.magnitude >= _planet.realRadius - 40f,
|
Visible = vein.pos.magnitude >= _planet.realRadius - 40f,
|
||||||
CanBury = _allowVeinReform && vein.groupIndex == group && vein.minerCount == 0 && !reserved.Contains(i)
|
CanBury = _allowVeinReform && vein.groupIndex == group && vein.minerCount == 0 && !reserved.Contains(i)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
#if DEBUG
|
||||||
var existing = new List<MinerPlacementDebug.ExistingMiner>();
|
var existing = new List<MinerPlacementDebug.ExistingMiner>();
|
||||||
for (var i = 1; i < _factory.entityCursor; i++)
|
for (var i = 1; i < _factory.entityCursor; i++)
|
||||||
{
|
{
|
||||||
@@ -468,6 +521,7 @@ public static class QuickMinerBuild
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
_debug.existingMiners = existing.ToArray();
|
_debug.existingMiners = existing.ToArray();
|
||||||
|
#endif
|
||||||
return _nodes.Count > 0;
|
return _nodes.Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,13 +647,26 @@ public static class QuickMinerBuild
|
|||||||
|
|
||||||
private void TryCandidate(float x, float z, float yaw)
|
private void TryCandidate(float x, float z, float yaw)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
_debug.rejections.attempted++;
|
_debug.rejections.attempted++;
|
||||||
|
#endif
|
||||||
if (x != _probeX || z != _probeZ) Probe(x, z);
|
if (x != _probeX || z != _probeZ) Probe(x, z);
|
||||||
var pos = _probe;
|
var pos = _probe;
|
||||||
if (!FactoryPatch.RemoveBuildRangeLimitEnabled.Value &&
|
if (!FactoryPatch.RemoveBuildRangeLimitEnabled.Value &&
|
||||||
(pos - _player.position).sqrMagnitude > _player.mecha.buildArea * _player.mecha.buildArea)
|
(pos - _player.position).sqrMagnitude > _player.mecha.buildArea * _player.mecha.buildArea)
|
||||||
{ _debug.rejections.range++; return; }
|
{
|
||||||
if (_probeRestricted) { _debug.rejections.clearance++; return; }
|
#if DEBUG
|
||||||
|
_debug.rejections.range++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_probeRestricted)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
_debug.rejections.clearance++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
var rotation = Maths.SphericalRotation(pos, yaw);
|
var rotation = Maths.SphericalRotation(pos, yaw);
|
||||||
var pose = new Pose(pos, rotation);
|
var pose = new Pose(pos, rotation);
|
||||||
_covered.Clear();
|
_covered.Clear();
|
||||||
@@ -607,10 +674,22 @@ public static class QuickMinerBuild
|
|||||||
{
|
{
|
||||||
var node = _nodes[i];
|
var node = _nodes[i];
|
||||||
if (!MinerComponent.IsTargetVeinInRange(node.Position, pose, _item.prefabDesc)) continue;
|
if (!MinerComponent.IsTargetVeinInRange(node.Position, pose, _item.prefabDesc)) continue;
|
||||||
if (node.Type != _type) { _debug.rejections.mixedType++; return; }
|
if (node.Type != _type)
|
||||||
_covered.Add(i);
|
{
|
||||||
|
#if DEBUG
|
||||||
|
_debug.rejections.mixedType++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (node.Target) _covered.Add(i);
|
||||||
|
}
|
||||||
|
if (_covered.Count < MinerPlacementSolver.MinimumCoverage)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
_debug.rejections.noCoverage++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (_covered.Count < MinerPlacementSolver.MinimumCoverage) { _debug.rejections.noCoverage++; return; }
|
|
||||||
for (var i = 0; i < _buildBoxes.Length; i++)
|
for (var i = 0; i < _buildBoxes.Length; i++)
|
||||||
_buildBoxes[i] = new Box(_item.prefabDesc.buildColliders[i].BindToObject(0, 0, EObjectType.None, pos, rotation));
|
_buildBoxes[i] = new Box(_item.prefabDesc.buildColliders[i].BindToObject(0, 0, EObjectType.None, pos, rotation));
|
||||||
_buried?.Clear();
|
_buried?.Clear();
|
||||||
@@ -618,17 +697,41 @@ public static class QuickMinerBuild
|
|||||||
{
|
{
|
||||||
var node = _nodes[i];
|
var node = _nodes[i];
|
||||||
if (!Hits(node.Collider)) continue;
|
if (!Hits(node.Collider)) continue;
|
||||||
if (!node.CanBury) { _debug.rejections.veinCollision++; return; }
|
if (!node.CanBury)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
_debug.rejections.veinCollision++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
_buried.Add(i);
|
_buried.Add(i);
|
||||||
}
|
}
|
||||||
if (_allowVeinReform)
|
if (_allowVeinReform)
|
||||||
{
|
{
|
||||||
foreach (var index in _buried) _covered.Remove(index);
|
foreach (var index in _buried) _covered.Remove(index);
|
||||||
if (_covered.Count < MinerPlacementSolver.MinimumCoverage) { _debug.rejections.noCoverage++; return; }
|
if (_covered.Count < MinerPlacementSolver.MinimumCoverage)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
_debug.rejections.noCoverage++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (var obstacle in _nearObstacles)
|
foreach (var obstacle in _nearObstacles)
|
||||||
if (Hits(obstacle)) { _debug.rejections.buildingCollision++; return; }
|
{
|
||||||
if (!HasGround(pos, rotation)) { _debug.rejections.ground++; return; }
|
if (!Hits(obstacle)) continue;
|
||||||
|
#if DEBUG
|
||||||
|
_debug.rejections.buildingCollision++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!HasGround(pos, rotation))
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
_debug.rejections.ground++;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (var i = 0; i < _nativeObstacles.Length; i++)
|
for (var i = 0; i < _nativeObstacles.Length; i++)
|
||||||
_obstacleBoxes[i] = new Box(_nativeObstacles[i].BindToObject(0, 0, EObjectType.None, pos, rotation));
|
_obstacleBoxes[i] = new Box(_nativeObstacles[i].BindToObject(0, 0, EObjectType.None, pos, rotation));
|
||||||
_candidates.Add(new Candidate
|
_candidates.Add(new Candidate
|
||||||
@@ -715,17 +818,25 @@ public static class QuickMinerBuild
|
|||||||
{
|
{
|
||||||
if (layout.Count == 0)
|
if (layout.Count == 0)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
_debug.outcome = "no-placement";
|
_debug.outcome = "no-placement";
|
||||||
|
#endif
|
||||||
_result = I18NKeys.QuickMinerNoPlacement.Translate();
|
_result = I18NKeys.QuickMinerNoPlacement.Translate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!NodesUnchanged(layout))
|
if (!NodesUnchanged(layout))
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
_debug.outcome = "veins-changed";
|
_debug.outcome = "veins-changed";
|
||||||
|
#endif
|
||||||
_result = I18NKeys.QuickMinerVeinsChanged.Translate();
|
_result = I18NKeys.QuickMinerVeinsChanged.Translate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#if DEBUG
|
||||||
var placed = new List<(Candidate Candidate, int Prebuild, MinerPlacementDebug.Placement Debug)>();
|
var placed = new List<(Candidate Candidate, int Prebuild, MinerPlacementDebug.Placement Debug)>();
|
||||||
|
#else
|
||||||
|
var placed = new List<(Candidate Candidate, int Prebuild)>();
|
||||||
|
#endif
|
||||||
var plannedBurial = _allowVeinReform
|
var plannedBurial = _allowVeinReform
|
||||||
? layout.SelectMany(candidate => candidate.Buried).Select(index => _nodes[index].Id).ToHashSet() : null;
|
? layout.SelectMany(candidate => candidate.Buried).Select(index => _nodes[index].Id).ToHashSet() : null;
|
||||||
var hidden = _allowVeinReform ? new Dictionary<int, Vector3>() : null;
|
var hidden = _allowVeinReform ? new Dictionary<int, Vector3>() : null;
|
||||||
@@ -744,11 +855,13 @@ public static class QuickMinerBuild
|
|||||||
validator.buildPreviews.Add(preview);
|
validator.buildPreviews.Add(preview);
|
||||||
foreach (var candidate in layout)
|
foreach (var candidate in layout)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
var debug = new MinerPlacementDebug.Placement
|
var debug = new MinerPlacementDebug.Placement
|
||||||
{
|
{
|
||||||
candidate = _candidates.IndexOf(candidate), outcome = "pending", nativeCondition = "not-checked", nativeVeins = [], plannedVeins = [], finalVeins = []
|
candidate = _candidates.IndexOf(candidate), outcome = "pending", nativeCondition = "not-checked", nativeVeins = [], plannedVeins = [], finalVeins = []
|
||||||
};
|
};
|
||||||
_placements.Add(debug);
|
_placements.Add(debug);
|
||||||
|
#endif
|
||||||
// No yield between burial, native validation, item consumption, and creation.
|
// No yield between burial, native validation, item consumption, and creation.
|
||||||
if (_allowVeinReform)
|
if (_allowVeinReform)
|
||||||
{
|
{
|
||||||
@@ -763,7 +876,11 @@ public static class QuickMinerBuild
|
|||||||
}
|
}
|
||||||
// Validation needs current Unity colliders; GPU buffers are synced once at the end.
|
// Validation needs current Unity colliders; GPU buffers are synced once at the end.
|
||||||
_physics.RefreshColliders();
|
_physics.RefreshColliders();
|
||||||
if (!Validate(validator, preview, candidate, plannedBurial, debug)) continue;
|
#if DEBUG
|
||||||
|
if (!Validate(validator, preview, candidate, plannedBurial, out var plannedVeins, debug)) continue;
|
||||||
|
#else
|
||||||
|
if (!Validate(validator, preview, candidate, plannedBurial, out var plannedVeins)) continue;
|
||||||
|
#endif
|
||||||
var itemId = ItemIds.MiningMachine;
|
var itemId = ItemIds.MiningMachine;
|
||||||
var count = 1;
|
var count = 1;
|
||||||
if (_player.inhandItemId == itemId && _player.inhandItemCount > 0) _player.UseHandItems(1, out _);
|
if (_player.inhandItemId == itemId && _player.inhandItemCount > 0) _player.UseHandItems(1, out _);
|
||||||
@@ -776,14 +893,20 @@ public static class QuickMinerBuild
|
|||||||
itemRequired = count == 1 ? 0 : 1,
|
itemRequired = count == 1 ? 0 : 1,
|
||||||
filterId = _factory.veinPool[_nodes[candidate.Covered[0]].Id].productId
|
filterId = _factory.veinPool[_nodes[candidate.Covered[0]].Id].productId
|
||||||
};
|
};
|
||||||
prebuild.InitParametersArray(debug.plannedVeins.Length);
|
prebuild.InitParametersArray(plannedVeins.Length);
|
||||||
Array.Copy(debug.plannedVeins, prebuild.parameters, debug.plannedVeins.Length);
|
Array.Copy(plannedVeins, prebuild.parameters, plannedVeins.Length);
|
||||||
var id = _factory.AddPrebuildDataWithComponents(prebuild);
|
var id = _factory.AddPrebuildDataWithComponents(prebuild);
|
||||||
|
#if DEBUG
|
||||||
debug.prebuildId = id;
|
debug.prebuildId = id;
|
||||||
debug.itemRequired = prebuild.itemRequired;
|
debug.itemRequired = prebuild.itemRequired;
|
||||||
debug.outcome = id > 0 ? "placed" : "prebuild-failed";
|
debug.outcome = id > 0 ? "placed" : "prebuild-failed";
|
||||||
|
#endif
|
||||||
if (id == 0 && count == 1) _player.TryAddItemToPackage(ItemIds.MiningMachine, 1, 0, true);
|
if (id == 0 && count == 1) _player.TryAddItemToPackage(ItemIds.MiningMachine, 1, 0, true);
|
||||||
|
#if DEBUG
|
||||||
if (id > 0) placed.Add((candidate, id, debug));
|
if (id > 0) placed.Add((candidate, id, debug));
|
||||||
|
#else
|
||||||
|
if (id > 0) placed.Add((candidate, id));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@@ -806,21 +929,25 @@ public static class QuickMinerBuild
|
|||||||
foreach (var node in _nodes)
|
foreach (var node in _nodes)
|
||||||
{
|
{
|
||||||
ref var vein = ref _factory.veinPool[node.Id];
|
ref var vein = ref _factory.veinPool[node.Id];
|
||||||
if (vein.id == node.Id && vein.amount > 0 && vein.type == _type && vein.pos.magnitude >= _planet.realRadius - 40f &&
|
if (node.Target && vein.id == node.Id && vein.amount > 0 && vein.type == _type && vein.pos.magnitude >= _planet.realRadius - 40f &&
|
||||||
MinerComponent.IsTargetVeinInRange(vein.pos, pose, _item.prefabDesc)) ids.Add(node.Id);
|
MinerComponent.IsTargetVeinInRange(vein.pos, pose, _item.prefabDesc)) ids.Add(node.Id);
|
||||||
}
|
}
|
||||||
ref var prebuild = ref _factory.prebuildPool[entry.Prebuild];
|
ref var prebuild = ref _factory.prebuildPool[entry.Prebuild];
|
||||||
prebuild.InitParametersArray(ids.Count);
|
prebuild.InitParametersArray(ids.Count);
|
||||||
if (ids.Count > 0) ids.CopyTo(prebuild.parameters);
|
if (ids.Count > 0) ids.CopyTo(prebuild.parameters);
|
||||||
|
#if DEBUG
|
||||||
entry.Debug.finalVeins = ids.ToArray();
|
entry.Debug.finalVeins = ids.ToArray();
|
||||||
|
#endif
|
||||||
coverage += ids.Count;
|
coverage += ids.Count;
|
||||||
}
|
}
|
||||||
if (_allowVeinReform) RefreshVeins(buriedCount > 0 ? 1 : 0);
|
if (_allowVeinReform) RefreshVeins(buriedCount > 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
#if DEBUG
|
||||||
_debug.placedCount = placed.Count;
|
_debug.placedCount = placed.Count;
|
||||||
_debug.totalCoverage = coverage;
|
_debug.totalCoverage = coverage;
|
||||||
_debug.buriedCount = buriedCount;
|
_debug.buriedCount = buriedCount;
|
||||||
if (placed.Count == 0) _debug.outcome = "no-placement";
|
if (placed.Count == 0) _debug.outcome = "no-placement";
|
||||||
|
#endif
|
||||||
_result = placed.Count == 0 ? I18NKeys.QuickMinerNoPlacement.Translate() :
|
_result = placed.Count == 0 ? I18NKeys.QuickMinerNoPlacement.Translate() :
|
||||||
string.Format(I18NKeys.QuickMinerResult.Translate(), placed.Count, coverage, buriedCount);
|
string.Format(I18NKeys.QuickMinerResult.Translate(), placed.Count, coverage, buriedCount);
|
||||||
}
|
}
|
||||||
@@ -846,9 +973,16 @@ public static class QuickMinerBuild
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CheckBuildConditions repeats the search's land-point tests, so ground needs no separate check.
|
// CheckBuildConditions repeats the search's land-point tests, so ground needs no separate check.
|
||||||
private bool Validate(BuildTool_Click validator, BuildPreview preview, Candidate candidate, HashSet<int> plannedBurial, MinerPlacementDebug.Placement debug)
|
#if DEBUG
|
||||||
|
private bool Validate(BuildTool_Click validator, BuildPreview preview, Candidate candidate, HashSet<int> plannedBurial, out int[] plannedVeins, MinerPlacementDebug.Placement debug)
|
||||||
|
#else
|
||||||
|
private bool Validate(BuildTool_Click validator, BuildPreview preview, Candidate candidate, HashSet<int> plannedBurial, out int[] plannedVeins)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
plannedVeins = [];
|
||||||
|
#if DEBUG
|
||||||
debug.outcome = "native-rejected";
|
debug.outcome = "native-rejected";
|
||||||
|
#endif
|
||||||
preview.ResetAll();
|
preview.ResetAll();
|
||||||
preview.item = _item;
|
preview.item = _item;
|
||||||
preview.desc = _item.prefabDesc;
|
preview.desc = _item.prefabDesc;
|
||||||
@@ -883,16 +1017,26 @@ public static class QuickMinerBuild
|
|||||||
}
|
}
|
||||||
Physics.SyncTransforms();
|
Physics.SyncTransforms();
|
||||||
var valid = validator.CheckBuildConditions();
|
var valid = validator.CheckBuildConditions();
|
||||||
|
#if DEBUG
|
||||||
debug.nativeCondition = preview.condition.ToString();
|
debug.nativeCondition = preview.condition.ToString();
|
||||||
debug.coverObjectId = preview.coverObjId;
|
debug.coverObjectId = preview.coverObjId;
|
||||||
debug.nativeVeins = preview.parameters?.Take(preview.paramCount).ToArray() ?? [];
|
debug.nativeVeins = preview.parameters?.Take(preview.paramCount).ToArray() ?? [];
|
||||||
|
#endif
|
||||||
if (!valid || preview.condition != EBuildCondition.Ok || preview.coverObjId != 0) return false;
|
if (!valid || preview.condition != EBuildCondition.Ok || preview.coverObjId != 0) return false;
|
||||||
// Include every planned burial now, so a later miner cannot reduce this one
|
// Native selection includes nearby groups of the same type. Keep only this
|
||||||
// below the minimum after its item has already been consumed.
|
// group and exclude all planned burials before enforcing the minimum.
|
||||||
debug.plannedVeins = _allowVeinReform
|
plannedVeins = preview.parameters?.Take(preview.paramCount).Where(id => _factory.veinPool[id].groupIndex == _group &&
|
||||||
? debug.nativeVeins.Where(id => !plannedBurial.Contains(id)).ToArray() : debug.nativeVeins;
|
(!_allowVeinReform || !plannedBurial.Contains(id))).ToArray() ?? [];
|
||||||
if (debug.plannedVeins.Length < MinerPlacementSolver.MinimumCoverage)
|
#if DEBUG
|
||||||
{ debug.outcome = "below-minimum-coverage"; return false; }
|
debug.plannedVeins = plannedVeins;
|
||||||
|
#endif
|
||||||
|
if (plannedVeins.Length < MinerPlacementSolver.MinimumCoverage)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
debug.outcome = "below-minimum-coverage";
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
for (var i = 0; i < preview.paramCount; i++)
|
for (var i = 0; i < preview.paramCount; i++)
|
||||||
{
|
{
|
||||||
ref var vein = ref _factory.veinPool[preview.parameters[i]];
|
ref var vein = ref _factory.veinPool[preview.parameters[i]];
|
||||||
|
|||||||
@@ -63,12 +63,12 @@ internal static class BeltSignalPatch
|
|||||||
// A belt selects one material, so its equivalent single-material rate is 30.
|
// A belt selects one material, so its equivalent single-material rate is 30.
|
||||||
private static readonly (int ItemId, int ExchangeRate, string NameKey, string IconPath)[] DarkFogBuyOutDefinitions =
|
private static readonly (int ItemId, int ExchangeRate, string NameKey, string IconPath)[] DarkFogBuyOutDefinitions =
|
||||||
[
|
[
|
||||||
(ItemIds.DarkFogMemoryUnit, 20, I18NKeys.MemoryUnit, "assets/signal/dark-fog-matrix.png"),
|
(ItemIds.DarkFogMatrix, 20, I18NKeys.MemoryUnit, "assets/signal/dark-fog-matrix.png"),
|
||||||
(ItemIds.DarkFogEnergyFragment, 60, I18NKeys.EnergyFragment, "assets/signal/energy-shard.png"),
|
(ItemIds.DarkFogEnergyShard, 60, I18NKeys.EnergyFragment, "assets/signal/energy-shard.png"),
|
||||||
(ItemIds.DarkFogSiliconNeuron, 30, I18NKeys.SiliconNeuron, "assets/signal/silicon-based-neuron.png"),
|
(ItemIds.DarkFogSiliconNeuron, 30, I18NKeys.SiliconNeuron, "assets/signal/silicon-based-neuron.png"),
|
||||||
(ItemIds.DarkFogNegentropySingularity, 30, I18NKeys.NegentropySingularity, "assets/signal/negentropy-singularity.png"),
|
(ItemIds.DarkFogNegentropySingularity, 30, I18NKeys.NegentropySingularity, "assets/signal/negentropy-singularity.png"),
|
||||||
(ItemIds.DarkFogMatterReassembler, 30, I18NKeys.MatterReassembler, "assets/signal/matter-recombinator.png"),
|
(ItemIds.DarkFogMatterRecombinator, 30, I18NKeys.MatterReassembler, "assets/signal/matter-recombinator.png"),
|
||||||
(ItemIds.DarkFogVirtualParticle, 10, I18NKeys.VirtualParticle, "assets/signal/core-element.png")
|
(ItemIds.DarkFogCoreElement, 10, I18NKeys.VirtualParticle, "assets/signal/core-element.png")
|
||||||
];
|
];
|
||||||
public static readonly int[] DarkFogItemsInVoid = [0, 0, 0, 0, 0, 0];
|
public static readonly int[] DarkFogItemsInVoid = [0, 0, 0, 0, 0, 0];
|
||||||
private static Dictionary<int, uint>[] _signalBelts = new Dictionary<int, uint>[64];
|
private static Dictionary<int, uint>[] _signalBelts = new Dictionary<int, uint>[64];
|
||||||
@@ -327,13 +327,14 @@ internal static class BeltSignalPatch
|
|||||||
var consume = (byte)Math.Min(DarkFogItemsInVoid[itemIdx], 4);
|
var consume = (byte)Math.Min(DarkFogItemsInVoid[itemIdx], 4);
|
||||||
if (consume < 4)
|
if (consume < 4)
|
||||||
{
|
{
|
||||||
var metaverseLong = propertySystem.GetItemAvaliableProperty(_clusterSeedKey, ItemIds.Metaverse);
|
// Metaverse is the metadata of the Universe Matrix.
|
||||||
|
var metaverseLong = propertySystem.GetItemAvaliableProperty(_clusterSeedKey, ItemIds.UniverseMatrix);
|
||||||
if (metaverseLong > 0L)
|
if (metaverseLong > 0L)
|
||||||
{
|
{
|
||||||
var metaverse = metaverseLong > 10 ? 10 : (int)metaverseLong;
|
var metaverse = metaverseLong > 10 ? 10 : (int)metaverseLong;
|
||||||
propertySystem.AddItemConsumption(_clusterSeedKey, ItemIds.Metaverse, metaverse);
|
propertySystem.AddItemConsumption(_clusterSeedKey, ItemIds.UniverseMatrix, metaverse);
|
||||||
var mainPlayer = GameMain.mainPlayer;
|
var mainPlayer = GameMain.mainPlayer;
|
||||||
GameMain.history.AddPropertyItemConsumption(ItemIds.Metaverse, metaverse, true);
|
GameMain.history.AddPropertyItemConsumption(ItemIds.UniverseMatrix, metaverse, true);
|
||||||
var count = definition.ExchangeRate * metaverse;
|
var count = definition.ExchangeRate * metaverse;
|
||||||
DarkFogItemsInVoid[itemIdx] += count;
|
DarkFogItemsInVoid[itemIdx] += count;
|
||||||
consume = (byte)Math.Min(DarkFogItemsInVoid[itemIdx], 4);
|
consume = (byte)Math.Min(DarkFogItemsInVoid[itemIdx], 4);
|
||||||
|
|||||||
@@ -222,11 +222,22 @@ public static class TechPatch
|
|||||||
foreach (var item in nodes)
|
foreach (var item in nodes)
|
||||||
{
|
{
|
||||||
var node = item.Value;
|
var node = item.Value;
|
||||||
|
var postTechArray = node.techProto.postTechArray;
|
||||||
|
// A new session can initialize nodes while the peace-mode graph is still filtered.
|
||||||
|
var arrowCount = node.arrows.Length;
|
||||||
|
if (arrowCount < postTechArray.Length)
|
||||||
|
{
|
||||||
|
System.Array.Resize(ref node.arrows, postTechArray.Length);
|
||||||
|
for (var i = arrowCount; i < postTechArray.Length; i++)
|
||||||
|
{
|
||||||
|
node.arrows[i] = UnityEngine.Object.Instantiate(node.arrowPrefab, node.arrowPrefab.parent);
|
||||||
|
node.arrows[i].SetAsFirstSibling();
|
||||||
|
}
|
||||||
|
}
|
||||||
foreach (var arrow in node.arrows)
|
foreach (var arrow in node.arrows)
|
||||||
{
|
{
|
||||||
arrow.gameObject.SetActive(false);
|
arrow.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
var postTechArray = node.techProto.postTechArray;
|
|
||||||
var active = postTechArray.Length > 0;
|
var active = postTechArray.Length > 0;
|
||||||
node.connGroup.gameObject.SetActive(active);
|
node.connGroup.gameObject.SetActive(active);
|
||||||
node.connImages = active ? node.connGroup.GetComponentsInChildren<Image>(true) : [];
|
node.connImages = active ? node.connGroup.GetComponentsInChildren<Image>(true) : [];
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public sealed class BlueprintDescriptionText
|
|||||||
public static class BlueprintDescriptionFormatter
|
public static class BlueprintDescriptionFormatter
|
||||||
{
|
{
|
||||||
private const double Tolerance = 1e-9;
|
private const double Tolerance = 1e-9;
|
||||||
|
private static readonly string[] RateUnits = { "K", "M", "G" };
|
||||||
private static readonly string[] PowerUnits = { "W", "kW", "MW", "GW", "TW" };
|
private static readonly string[] PowerUnits = { "W", "kW", "MW", "GW", "TW" };
|
||||||
|
|
||||||
public static BlueprintDescriptionText Format(ProductionReport report, Func<int, string> itemTag,
|
public static BlueprintDescriptionText Format(ProductionReport report, Func<int, string> itemTag,
|
||||||
@@ -147,7 +148,21 @@ public static class BlueprintDescriptionFormatter
|
|||||||
var tag = itemTag(itemId);
|
var tag = itemTag(itemId);
|
||||||
if (string.IsNullOrEmpty(tag))
|
if (string.IsNullOrEmpty(tag))
|
||||||
throw new InvalidOperationException("An item in the blueprint report has no native icon tag.");
|
throw new InvalidOperationException("An item in the blueprint report has no native icon tag.");
|
||||||
return tag + " x" + FormatNumber(rate);
|
return tag + " x" + FormatRate(rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string FormatRate(double value)
|
||||||
|
{
|
||||||
|
var rounded = RoundForDisplay(value);
|
||||||
|
for (var unit = RateUnits.Length - 1; unit >= 0; unit--)
|
||||||
|
{
|
||||||
|
var scale = Math.Pow(1000, unit + 1);
|
||||||
|
// Keep the existing display precision; abbreviate only exact tenths of a unit.
|
||||||
|
if (rounded >= scale && rounded % (scale / 10) == 0)
|
||||||
|
return (rounded / scale).ToString("#,##0.#", CultureInfo.InvariantCulture) + RateUnits[unit];
|
||||||
|
}
|
||||||
|
|
||||||
|
return FormatNumber(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string FormatPower(double? watts, BlueprintDescriptionLabels labels)
|
private static string FormatPower(double? watts, BlueprintDescriptionLabels labels)
|
||||||
@@ -176,7 +191,7 @@ public static class BlueprintDescriptionFormatter
|
|||||||
throw new InvalidOperationException("A blueprint report contains an invalid rate or power value.");
|
throw new InvalidOperationException("A blueprint report contains an invalid rate or power value.");
|
||||||
var rounded = RoundForDisplay(value);
|
var rounded = RoundForDisplay(value);
|
||||||
if (rounded > 0 || value == 0)
|
if (rounded > 0 || value == 0)
|
||||||
return rounded.ToString(value < 1 ? "0.###" : "0.##", CultureInfo.InvariantCulture);
|
return rounded.ToString(value < 1 ? "0.###" : "#,##0.##", CultureInfo.InvariantCulture);
|
||||||
var precise = value.ToString("0.######", CultureInfo.InvariantCulture);
|
var precise = value.ToString("0.######", CultureInfo.InvariantCulture);
|
||||||
return precise != "0" ? precise : value.ToString("0.###E+0", CultureInfo.InvariantCulture);
|
return precise != "0" ? precise : value.ToString("0.###E+0", CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-4
@@ -18,6 +18,8 @@
|
|||||||
* Fix a bug that warning popup on `Veins Utilization` upgraded to level 8000+
|
* Fix a bug that warning popup on `Veins Utilization` upgraded to level 8000+
|
||||||
* Sort blueprint structures before saving, to reduce generated blueprint data size a little
|
* Sort blueprint structures before saving, to reduce generated blueprint data size a little
|
||||||
* Add an `Auto-fill description` button and a `Proliferation` checkbox to the blueprint browser, copy, and paste panels, to fill the description with the blueprint's material flows per minute and its power demand
|
* Add an `Auto-fill description` button and a `Proliferation` checkbox to the blueprint browser, copy, and paste panels, to fill the description with the blueprint's material flows per minute and its power demand
|
||||||
|
* Replaces the main description with full-load material flows and writes power demand to a `Power` custom field, preserving other custom fields. Proliferation defaults to on when the blueprint contains a Spray Coater. Save the blueprint manually to keep the changes.
|
||||||
|
* Large material rates use the largest exact `K`/`M`/`G` suffix with at most one decimal place; rates that cannot be shortened without losing display precision keep their ordinary format. Numbers with four or more integer digits use comma thousands separators, including before suffixes (for example, `12,345` and `1,234.5K`).
|
||||||
* Increase maximum count of Metadata Instantiations to 20000 (from 2000)
|
* Increase maximum count of Metadata Instantiations to 20000 (from 2000)
|
||||||
* Increase capacity of player order queue to 128 (from 16)
|
* Increase capacity of player order queue to 128 (from 16)
|
||||||
* Enable `Hide UI` (`F11` by default) in Star Map view, hiding UI and other scene elements
|
* Enable `Hide UI` (`F11` by default) in Star Map view, hiding UI and other scene elements
|
||||||
@@ -85,13 +87,13 @@
|
|||||||
* Quick build Orbital Collectors
|
* Quick build Orbital Collectors
|
||||||
* Set a maximum number to build per operation; 0 builds as many as possible
|
* Set a maximum number to build per operation; 0 builds as many as possible
|
||||||
* Quick build Mining Machines
|
* Quick build Mining Machines
|
||||||
* Use the button on the Factory tab near Quick build Orbital Collectors. Places the full ordinary Mining Machine layout at the nearest solid vein group regardless of carried stock. Uses available miners from the inventory and hand; missing miners remain as ghosts awaiting materials. Every placed miner must retain at least 3 covered nodes after all planned burials; miners below that minimum are invalid.
|
* Use the button on the Factory tab near Quick build Orbital Collectors. Places the full ordinary Mining Machine layout at the nearest solid vein group regardless of carried stock. Mines only the selected group, even when another group of the same resource is nearby. Uses available miners from the inventory and hand; missing miners remain as ghosts awaiting materials. Every placed miner must retain at least 3 covered nodes in the selected group after all planned burials; miners below that minimum are invalid.
|
||||||
* `Allow restoring/burying veins` is off by default. When disabled, uses only visible nodes and skips all restoration and burial calculations. Enable it to restore buried nodes unless obstructed by buildings or near Dark Fog Planetary Bases. Changes apply to the next calculation. Searches individual native collision shapes so the miner's feet can interleave where the game permits.
|
* `Allow restoring/burying veins` is off by default. When disabled, uses only visible nodes and skips all restoration and burial calculations. Enable it to restore buried nodes unless obstructed by buildings or near Dark Fog Planetary Bases. Changes apply to the next calculation. Searches individual native collision shapes so the miner's feet can interleave where the game permits.
|
||||||
* Uses multiple packing orders, exploration keyed by placement pose as well as candidate index, local position/rotation refinement, body-width neighbor candidates, and coordinated repacking of up to three nearby miners to seek a high sum of vein counts across all placed miners. A final pass fills remaining compatible candidates when they increase total coverage while preserving the three-node minimum. Shared nodes count once per miner; this bounded search does not guarantee a global optimum.
|
* Uses multiple packing orders, exploration keyed by placement pose as well as candidate index, local position/rotation refinement, body-width neighbor candidates, and coordinated repacking of up to three nearby miners to seek a high sum of vein counts across all placed miners. A final pass fills remaining compatible candidates when they increase total coverage while preserving the three-node minimum. Shared nodes count once per miner; this bounded search does not guarantee a global optimum.
|
||||||
* Reuses collision checks and runs independent layout searches on up to 4 background workers, capped at half the available logical processors. Systems with one logical processor keep the search on the main thread with a frame budget. Native terrain checks and placement stay on the main thread; worker scheduling preserves the same layout as sequential search.
|
* Reuses collision checks and runs independent layout searches on up to 4 background workers, capped at half the available logical processors. Systems with one logical processor keep the search on the main thread with a frame budget. Native terrain checks and placement stay on the main thread; worker scheduling preserves the same layout as sequential search.
|
||||||
* With `Allow restoring/burying veins` enabled, may bury unused nodes when that improves total coverage. Nodes already assigned to miners or miner prebuilds are protected. Ground, water, existing buildings, construction range, and the game's other placement clearances still apply.
|
* With `Allow restoring/burying veins` enabled, may bury unused nodes when that improves total coverage. Nodes already assigned to miners or miner prebuilds are protected. Ground, water, existing buildings, construction range, and the game's other placement clearances still apply.
|
||||||
* Click again during calculation to cancel. Changing planets or leaving the game cancels automatically. Construction drones finish the prebuilds; belts and power supply are not placed.
|
* Click again during calculation to cancel. Changing planets or leaving the game cancels automatically. Construction drones finish the prebuilds; belts and power supply are not placed.
|
||||||
* While tuning this feature, each calculation writes a timestamped JSON snapshot to `BepInEx/debug/UXAssist/QuickMiner/` in the active game profile, including the restoration/burial option, nodes, native colliders, accepted candidates, search phases and their search times, logical processor and worker counts, existing miners, and native placement results. The completion tip stays visible for about 8 seconds; the log also records the result summary and full file path. Replay and compare sequential/parallel results without loading a save using `powershell -File tools/tests/Test-QuickMinerPlacement.ps1 -Snapshot <file.json>` from the repository root. Replay fails if total coverage falls below the recorded result; add `-MinimumTotalCoverage <count>` to require a higher total.
|
* Debug builds capture a timestamped JSON snapshot for each calculation and export it to `BepInEx/debug/UXAssist/QuickMiner/` in the active game profile, including the restoration/burial option, nodes, native colliders, accepted candidates, search phases and their search times, logical processor and worker counts, existing miners, and native placement results. Only Debug builds log the result summary and full file path; Release builds exclude this debug functionality. The completion tip stays visible for about 8 seconds in both builds. Replay and compare sequential/parallel results without loading a save using `powershell -File tools/tests/Test-QuickMinerPlacement.ps1 -Snapshot <file.json>` from the repository root. Replay fails if total coverage falls below the recorded result; add `-MinimumTotalCoverage <count>` to require a higher total.
|
||||||
* Belt signals for buy out dark fog items automatically
|
* Belt signals for buy out dark fog items automatically
|
||||||
* 6 belt signals are added to the signal panel, which can be used to buy out dark fog items automatically.
|
* 6 belt signals are added to the signal panel, which can be used to buy out dark fog items automatically.
|
||||||
* Generated items are stacked in 4 items.
|
* Generated items are stacked in 4 items.
|
||||||
@@ -167,6 +169,7 @@
|
|||||||
* Buy out techs with their prerequisites
|
* Buy out techs with their prerequisites
|
||||||
* This enables batch buying out techs with their prerequisites. Buy-out buttons are shown for locked techs/upgrades.
|
* This enables batch buying out techs with their prerequisites. Buy-out buttons are shown for locked techs/upgrades.
|
||||||
* Hide battle-related techs in Peace mode
|
* Hide battle-related techs in Peace mode
|
||||||
|
* Battle-related techs and their connections return when disabling the option or loading a Combat-mode save; switching saves does not require restarting the game.
|
||||||
* Unlock all techs with metadata
|
* Unlock all techs with metadata
|
||||||
* Use the config-panel button to confirm the metadata cost and buy out eligible techs in a batch; unlimited upgrade chains are excluded.
|
* Use the config-panel button to confirm the metadata cost and buy out eligible techs in a batch; unlimited upgrade chains are excluded.
|
||||||
* Combat
|
* Combat
|
||||||
@@ -221,6 +224,8 @@
|
|||||||
* 修复了`矿物利用`升级到8000级以上时弹出警告的bug
|
* 修复了`矿物利用`升级到8000级以上时弹出警告的bug
|
||||||
* 保存蓝图前对建筑进行排序,以减少生成的蓝图数据大小
|
* 保存蓝图前对建筑进行排序,以减少生成的蓝图数据大小
|
||||||
* 在蓝图浏览、复制和粘贴界面增加「自动填写说明」按钮和「增产」复选框,用蓝图每分钟的物料流量和耗电自动填写说明
|
* 在蓝图浏览、复制和粘贴界面增加「自动填写说明」按钮和「增产」复选框,用蓝图每分钟的物料流量和耗电自动填写说明
|
||||||
|
* 用满负荷运行时的物料流量替换原说明,将耗电写入「耗电」自定义字段,保留其他自定义字段。蓝图含喷涂机时默认勾选增产。填写后需手动保存蓝图。
|
||||||
|
* 较大的物料流量使用能精确表示的最大 `K`/`M`/`G` 单位,小数最多一位;无法在保留显示精度的前提下缩写时,保留普通数字格式。整数部分达到四位的数字用逗号每三位分隔,带单位时也适用,例如 `12,345` 和 `1,234.5K`。
|
||||||
* 将元数据提取的最大数量增加到20000(原来为2000)
|
* 将元数据提取的最大数量增加到20000(原来为2000)
|
||||||
* 将玩家指令队列的容量增加到128(原来为16)
|
* 将玩家指令队列的容量增加到128(原来为16)
|
||||||
* 在星图视图中启用 `隐藏 UI` 功能(默认按键为 `F11`),同时隐藏 UI 和场景中的其他元素
|
* 在星图视图中启用 `隐藏 UI` 功能(默认按键为 `F11`),同时隐藏 UI 和场景中的其他元素
|
||||||
@@ -288,13 +293,13 @@
|
|||||||
* 快速建造轨道采集器
|
* 快速建造轨道采集器
|
||||||
* 可设置单次建造数量上限;设为 0 时尽可能多地建造
|
* 可设置单次建造数量上限;设为 0 时尽可能多地建造
|
||||||
* 快速铺设采矿机
|
* 快速铺设采矿机
|
||||||
* 点击「工厂」页中轨道采集器按钮附近的按钮,在最近的固体矿脉生成完整的普通采矿机布局,数量不受库存限制。有采矿机时正常消耗背包和手持物品,不足的位置保留待建造虚影,等待补充材料。所有计划掩埋完成后,每台矿机仍须覆盖至少 3 个矿点;少于 3 个的视为无效,不予铺设。
|
* 点击「工厂」页中轨道采集器按钮附近的按钮,在最近的固体矿脉生成完整的普通采矿机布局,数量不受库存限制。仅开采选中的矿脉,即使附近有同种资源的其他矿脉也不会混入。有采矿机时正常消耗背包和手持物品,不足的位置保留待建造虚影,等待补充材料。所有计划掩埋完成后,每台矿机仍须覆盖选中矿脉的至少 3 个矿点;少于 3 个的视为无效,不予铺设。
|
||||||
* 「允许恢复/掩埋矿物」默认关闭。关闭时仅使用可见矿点,跳过所有恢复和掩埋计算;开启后,先恢复未被建筑阻挡且不在黑雾行星基地附近的掩埋矿点。选项变更从下次计算生效。按原版独立碰撞体搜索布局,保留游戏允许的矿机脚部交叉空间。
|
* 「允许恢复/掩埋矿物」默认关闭。关闭时仅使用可见矿点,跳过所有恢复和掩埋计算;开启后,先恢复未被建筑阻挡且不在黑雾行星基地附近的掩埋矿点。选项变更从下次计算生效。按原版独立碰撞体搜索布局,保留游戏允许的矿机脚部交叉空间。
|
||||||
* 比较多种铺设顺序,同时按候选序号及位置朝向探索不同布局,细调位置和朝向,按机身宽度补充紧邻候选,并允许邻近的两三台矿机一起重新布局,尽量提高各台矿机覆盖矿点数之和。结束前再扫描全部候选,继续补入能提高总覆盖数、且不破坏每台至少覆盖 3 点要求的矿机。同一矿点被多台矿机覆盖时重复计数。计算有界,不保证全局最优。
|
* 比较多种铺设顺序,同时按候选序号及位置朝向探索不同布局,细调位置和朝向,按机身宽度补充紧邻候选,并允许邻近的两三台矿机一起重新布局,尽量提高各台矿机覆盖矿点数之和。结束前再扫描全部候选,继续补入能提高总覆盖数、且不破坏每台至少覆盖 3 点要求的矿机。同一矿点被多台矿机覆盖时重复计数。计算有界,不保证全局最优。
|
||||||
* 复用碰撞检查结果,使用最多 4 个后台线程并行搜索独立布局,线程数不超过可用逻辑线程数的一半。单逻辑线程系统继续在主线程按每帧预算计算。原生地形检查和实际铺设保留在主线程;并行调度与顺序搜索生成相同布局。
|
* 复用碰撞检查结果,使用最多 4 个后台线程并行搜索独立布局,线程数不超过可用逻辑线程数的一半。单逻辑线程系统继续在主线程按每帧预算计算。原生地形检查和实际铺设保留在主线程;并行调度与顺序搜索生成相同布局。
|
||||||
* 开启「允许恢复/掩埋矿物」后,允许掩埋未被使用的矿点来提高总覆盖数;保护已有矿机及待建造矿机使用的矿点。仍需满足地面、水面、现有建筑、建造范围及游戏的其他放置间距要求。
|
* 开启「允许恢复/掩埋矿物」后,允许掩埋未被使用的矿点来提高总覆盖数;保护已有矿机及待建造矿机使用的矿点。仍需满足地面、水面、现有建筑、建造范围及游戏的其他放置间距要求。
|
||||||
* 计算期间再次点击可取消,切换行星或退出游戏自动取消。待建造对象由建设机器人完成,不自动铺设传送带和电力设施。
|
* 计算期间再次点击可取消,切换行星或退出游戏自动取消。待建造对象由建设机器人完成,不自动铺设传送带和电力设施。
|
||||||
* 功能调试期间,每次计算都会在当前游戏配置目录的 `BepInEx/debug/UXAssist/QuickMiner/` 下写入带时间戳的 JSON 文件,记录恢复/掩埋选项、矿点、原生碰撞体、有效候选、搜索阶段及其搜索耗时、逻辑线程数和工作线程数、现有矿机和原生铺设校验结果。完成提示保留约 8 秒,日志也会记录结果摘要和文件的完整路径。在仓库根目录运行 `powershell -File tools/tests/Test-QuickMinerPlacement.ps1 -Snapshot <file.json>`,即可离线重放并比较顺序与并行搜索结果,无需读取存档。总覆盖数低于记录结果时,重放检查会失败;可追加 `-MinimumTotalCoverage <数量>`,要求达到更高的总覆盖数。
|
* 仅 Debug 版本会为每次计算采集带时间戳的 JSON 快照,并导出到当前游戏配置目录的 `BepInEx/debug/UXAssist/QuickMiner/`,记录恢复/掩埋选项、矿点、原生碰撞体、有效候选、搜索阶段及其搜索耗时、逻辑线程数和工作线程数、现有矿机和原生铺设校验结果。结果摘要和文件完整路径的日志也仅在 Debug 版本中输出;Release 版本不编译这些调试功能。两个版本的完成提示均保留约 8 秒。在仓库根目录运行 `powershell -File tools/tests/Test-QuickMinerPlacement.ps1 -Snapshot <file.json>`,即可离线重放并比较顺序与并行搜索结果,无需读取存档。总覆盖数低于记录结果时,重放检查会失败;可追加 `-MinimumTotalCoverage <数量>`,要求达到更高的总覆盖数。
|
||||||
* 用于自动购买黑雾物品的传送带信号
|
* 用于自动购买黑雾物品的传送带信号
|
||||||
* 在信号面板上添加了6个传送带信号,可以用于自动购买黑雾道具。
|
* 在信号面板上添加了6个传送带信号,可以用于自动购买黑雾道具。
|
||||||
* 生成的物品堆叠数为4。
|
* 生成的物品堆叠数为4。
|
||||||
@@ -370,6 +375,7 @@
|
|||||||
* 买断科技也同时买断所有前置科技
|
* 买断科技也同时买断所有前置科技
|
||||||
* 可批量买断科技及其前置科技,未解锁的科技和升级会显示买断按钮。
|
* 可批量买断科技及其前置科技,未解锁的科技和升级会显示买断按钮。
|
||||||
* 在和平模式下隐藏战斗相关科技
|
* 在和平模式下隐藏战斗相关科技
|
||||||
|
* 关闭选项或加载战斗模式存档后恢复相关科技及连线,切换存档无需重启游戏。
|
||||||
* 使用元数据解锁所有科技
|
* 使用元数据解锁所有科技
|
||||||
* 在配置面板点击按钮并确认元数据消耗,批量买断符合条件的科技;不包含无限升级科技链。
|
* 在配置面板点击按钮并确认元数据消耗,批量买断符合条件的科技;不包含无限升级科技链。
|
||||||
* 战斗
|
* 战斗
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
|
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
|
||||||
<Description>DSP MOD - UXAssist</Description>
|
<Description>DSP MOD - UXAssist</Description>
|
||||||
<Version>1.6.3</Version>
|
<Version>1.6.4</Version>
|
||||||
<PackageId>UXAssist</PackageId>
|
<PackageId>UXAssist</PackageId>
|
||||||
<RootNamespace>UXAssist</RootNamespace>
|
<RootNamespace>UXAssist</RootNamespace>
|
||||||
<PackHasChangelog>true</PackHasChangelog>
|
<PackHasChangelog>true</PackHasChangelog>
|
||||||
@@ -11,7 +11,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="tools/**/*.cs" />
|
<Compile Remove="tools/**/*.cs" />
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
<Compile Remove="Functions/Factory/MinerPlacementDebug.cs" Condition="'$(Configuration)' != 'Debug'" />
|
||||||
|
<Reference Include="System.Runtime.Serialization" Condition="'$(Configuration)' == 'Debug'" />
|
||||||
<PackageReference Include="DysonSphereProgram.Modding.CommonAPI" Version="1.*" />
|
<PackageReference Include="DysonSphereProgram.Modding.CommonAPI" Version="1.*" />
|
||||||
<PackageReference Include="DysonSphereProgram.Modding.DSPModSave" Version="1.*" />
|
<PackageReference Include="DysonSphereProgram.Modding.DSPModSave" Version="1.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ Native research uses the current lab technology's matrix point requirements, wit
|
|||||||
|
|
||||||
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.
|
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.
|
`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. Large displayed rates use the largest exact K/M/G suffix with at most one decimal place (for example, 1,234,000 becomes 1,234K); if no suffix preserves that display precision, keep the ordinary number. Numbers with four or more integer digits use comma thousands separators, including coefficients before material or power units. Rates are 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. Native `Refresh` recalculates the later groups' positions and the scroll height but not the first group's position, and `Refresh(forModify: true)` does not reload `descTextInput`, so assign it explicitly. `BlueprintData.Validate` strips newlines from custom fields, so multiline text belongs only in the main description. Recheck these inspector behaviors against the original DLL after game updates. The formatting and field updater remain pure-managed so `ProductionCheck` can verify them without loading Unity.
|
`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. Native `Refresh` recalculates the later groups' positions and the scroll height but not the first group's position, and `Refresh(forModify: true)` does not reload `descTextInput`, so assign it explicitly. `BlueprintData.Validate` strips newlines from custom fields, so multiline text belongs only in the main description. Recheck these inspector behaviors against the original DLL after game updates. The formatting and field updater remain pure-managed so `ProductionCheck` can verify them without loading Unity.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "UXAssist",
|
"name": "UXAssist",
|
||||||
"version_number": "1.6.3",
|
"version_number": "1.6.4",
|
||||||
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
|
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
|
||||||
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
|
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
|||||||
@@ -1037,35 +1037,35 @@ internal static class Program
|
|||||||
{
|
{
|
||||||
new ProductionItem(ItemIds.Water, 0, true, false, 0, 0),
|
new ProductionItem(ItemIds.Water, 0, true, false, 0, 0),
|
||||||
new ProductionItem(ItemIds.ProliferatorMkIII, 201, false, false, 4, 75),
|
new ProductionItem(ItemIds.ProliferatorMkIII, 201, false, false, 4, 75),
|
||||||
new ProductionItem(ItemIds.Steel, 202, false, false, 0, 0),
|
new ProductionItem(ItemIds.TitaniumAlloy, 202, false, false, 0, 0),
|
||||||
new ProductionItem(ItemIds.SpaceWarper, 203, false, false, 0, 0),
|
new ProductionItem(ItemIds.CasimirCrystal, 203, false, false, 0, 0),
|
||||||
new ProductionItem(ItemIds.TitaniumGlass, 204, false, false, 0, 0)
|
new ProductionItem(ItemIds.Prism, 204, false, false, 0, 0)
|
||||||
};
|
};
|
||||||
var recipes = new[]
|
var recipes = new[]
|
||||||
{
|
{
|
||||||
Recipe(201, new[] { (ItemIds.Water, 1.0) },
|
Recipe(201, new[] { (ItemIds.Water, 1.0) },
|
||||||
new[] { (ItemIds.ProliferatorMkIII, 1.0) }),
|
new[] { (ItemIds.ProliferatorMkIII, 1.0) }),
|
||||||
Recipe(202, new[] { (ItemIds.Water, 1.0) }, new[] { (ItemIds.Steel, 1.0) }),
|
Recipe(202, new[] { (ItemIds.Water, 1.0) }, new[] { (ItemIds.TitaniumAlloy, 1.0) }),
|
||||||
Recipe(203, new[] { (ItemIds.Water, 1.0) }, new[] { (ItemIds.SpaceWarper, 1.0) }),
|
Recipe(203, new[] { (ItemIds.Water, 1.0) }, new[] { (ItemIds.CasimirCrystal, 1.0) }),
|
||||||
Recipe(204, new[] { (ItemIds.Water, 1.0) }, new[] { (ItemIds.TitaniumGlass, 1.0) },
|
Recipe(204, new[] { (ItemIds.Water, 1.0) }, new[] { (ItemIds.Prism, 1.0) },
|
||||||
productive: false)
|
productive: false)
|
||||||
};
|
};
|
||||||
var catalog = new ProductionCatalog(items, recipes, Array.Empty<ProductionBuilding>(),
|
var catalog = new ProductionCatalog(items, recipes, Array.Empty<ProductionBuilding>(),
|
||||||
new[] { 0.0, 0.25, 0.5, 0.75, 1.0 },
|
new[] { 0.0, 0.25, 0.5, 0.75, 1.0 },
|
||||||
new[] { 0.0, 0.125, 0.2, 0.225, 0.25 },
|
new[] { 0.0, 0.125, 0.2, 0.225, 0.25 },
|
||||||
new[] { 1.0, 1.3, 1.7, 2.1, 2.5 });
|
new[] { 1.0, 1.3, 1.7, 2.1, 2.5 });
|
||||||
var request = BeltSignalSourcePreset.Create(catalog, ItemIds.Steel, true, true);
|
var request = BeltSignalSourcePreset.Create(catalog, ItemIds.TitaniumAlloy, true, true);
|
||||||
Check(request.ExternalMaterials.SetEquals(new[] { ItemIds.Water }),
|
Check(request.ExternalMaterials.SetEquals(new[] { ItemIds.Water }),
|
||||||
"only known natural belt source IDs become external materials");
|
"only known natural belt source IDs become external materials");
|
||||||
Equal(ItemIds.ProliferatorMkIII, request.ProliferatorItemId,
|
Equal(ItemIds.ProliferatorMkIII, request.ProliferatorItemId,
|
||||||
"belt policy uses the available proliferator item");
|
"belt policy uses the available proliferator item");
|
||||||
Check(request.SelfSprayProliferator && request.SprayDeliveredItems.Contains(ItemIds.Steel),
|
Check(request.SelfSprayProliferator && request.SprayDeliveredItems.Contains(ItemIds.TitaniumAlloy),
|
||||||
"self-spray and delivered-item spraying are request settings");
|
"self-spray and delivered-item spraying are request settings");
|
||||||
Check(request.ProliferationModeByItem[ItemIds.Steel] == ProliferationMode.ExtraProducts,
|
Check(request.ProliferationModeByItem[ItemIds.TitaniumAlloy] == ProliferationMode.ExtraProducts,
|
||||||
"productive legacy extra-products choice maps to a native mode");
|
"productive legacy extra-products choice maps to a native mode");
|
||||||
Check(request.ProliferationModeByItem[ItemIds.SpaceWarper] == ProliferationMode.None,
|
Check(request.ProliferationModeByItem[ItemIds.CasimirCrystal] == ProliferationMode.None,
|
||||||
"legacy disabled item keeps its no-proliferation preset");
|
"legacy disabled item keeps its no-proliferation preset");
|
||||||
Check(request.ProliferationModeByItem[ItemIds.TitaniumGlass] == ProliferationMode.Speedup,
|
Check(request.ProliferationModeByItem[ItemIds.Prism] == ProliferationMode.Speedup,
|
||||||
"unsupported extra-products choice falls back to native speedup");
|
"unsupported extra-products choice falls back to native speedup");
|
||||||
var report = new ProductionPlanner(catalog).Calculate(request);
|
var report = new ProductionPlanner(catalog).Calculate(request);
|
||||||
Check(report.MaterialComplete, "belt preset resolves the proliferator's recipe and raw materials");
|
Check(report.MaterialComplete, "belt preset resolves the proliferator's recipe and raw materials");
|
||||||
@@ -1084,7 +1084,7 @@ internal static class Program
|
|||||||
Array.Empty<ProductionBuilding>(), new[] { 0.0, 0.25, 0.5, 0.75, 1.0 },
|
Array.Empty<ProductionBuilding>(), new[] { 0.0, 0.25, 0.5, 0.75, 1.0 },
|
||||||
new[] { 0.0, 0.125, 0.2, 0.225, 0.25 },
|
new[] { 0.0, 0.125, 0.2, 0.225, 0.25 },
|
||||||
new[] { 1.0, 1.3, 1.7, 2.1, 2.5 });
|
new[] { 1.0, 1.3, 1.7, 2.1, 2.5 });
|
||||||
var updated = BeltSignalSourcePreset.Create(updatedCatalog, ItemIds.Steel, true, false);
|
var updated = BeltSignalSourcePreset.Create(updatedCatalog, ItemIds.TitaniumAlloy, true, false);
|
||||||
Equal(9999, updated.ProliferatorItemId, "updated game data selects a valid proliferator instead of a stale ID");
|
Equal(9999, updated.ProliferatorItemId, "updated game data selects a valid proliferator instead of a stale ID");
|
||||||
|
|
||||||
var alternativeCatalog = new ProductionCatalog(new[]
|
var alternativeCatalog = new ProductionCatalog(new[]
|
||||||
@@ -2074,7 +2074,11 @@ internal static class Program
|
|||||||
"gigawatt and megawatt display matches the native Chinese field example");
|
"gigawatt and megawatt display matches the native Chinese field example");
|
||||||
Check(large.Input == "" && large.Output == "" && large.Description == "",
|
Check(large.Input == "" && large.Output == "" && large.Description == "",
|
||||||
"empty material categories add no description lines");
|
"empty material categories add no description lines");
|
||||||
foreach (var (watts, expected) in new[] { (999.999, "1kW"), (999999.0, "1MW"), (999.994, "999.99W") })
|
foreach (var (watts, expected) in new[]
|
||||||
|
{
|
||||||
|
(999.999, "1kW"), (999999.0, "1MW"), (999.994, "999.99W"),
|
||||||
|
(1234567890000000.0, "1,234.57TW")
|
||||||
|
})
|
||||||
{
|
{
|
||||||
var boundary = new ProductionReport(ProductionStatus.Complete, true, true,
|
var boundary = new ProductionReport(ProductionStatus.Complete, true, true,
|
||||||
Array.Empty<ProductionItemFlow>(), Array.Empty<ProductionGroupFlow>(),
|
Array.Empty<ProductionItemFlow>(), Array.Empty<ProductionGroupFlow>(),
|
||||||
@@ -2157,6 +2161,44 @@ internal static class Program
|
|||||||
rounded.Description == "输出:" + rounded.Output,
|
rounded.Description == "输出:" + rounded.Output,
|
||||||
"no consumers means no power field and an output-only report has one line");
|
"no consumers means no power field and an output-only report has one line");
|
||||||
|
|
||||||
|
foreach (var (rate, expected) in new[]
|
||||||
|
{
|
||||||
|
(1000.0, "1K"), (1200.0, "1.2K"), (1200.0000000001, "1.2K"),
|
||||||
|
(1000000.0, "1M"), (1200000.0, "1.2M"),
|
||||||
|
(1000000000.0, "1G"), (1200000000.0, "1.2G"),
|
||||||
|
(1234000.0, "1,234K"), (1234500.0, "1,234.5K"), (1230000000.0, "1,230M"),
|
||||||
|
(12345.0, "12,345"), (1200.01, "1,200.01"),
|
||||||
|
(999.99, "999.99"), (1000.01, "1,000.01"),
|
||||||
|
(999999.0, "999,999"), (999999.99, "999,999.99"),
|
||||||
|
(1234567890123.0, "1,234,567,890,123"), (1234000000000.0, "1,234G"),
|
||||||
|
(0.125, "0.125"), (0.00001, "0.00001"), (0.0000001, "1E-7")
|
||||||
|
})
|
||||||
|
{
|
||||||
|
var materialReport = new ProductionReport(ProductionStatus.Complete, true, true,
|
||||||
|
new[]
|
||||||
|
{
|
||||||
|
new ProductionItemFlow(61, 0, rate, 0, 0, 0, 0, rate,
|
||||||
|
false, Array.Empty<int>(), Array.Empty<int>(), intermediateShortage: rate),
|
||||||
|
new ProductionItemFlow(62, rate, 0, 0, 0, 0, rate, 0,
|
||||||
|
false, Array.Empty<int>(), Array.Empty<int>(), overbuildSurplus: rate),
|
||||||
|
new ProductionItemFlow(63, 0, rate, 0, 0, 0, 0, rate,
|
||||||
|
false, Array.Empty<int>(), Array.Empty<int>()),
|
||||||
|
new ProductionItemFlow(64, rate, 0, 0, 0, 0, rate, 0,
|
||||||
|
true, Array.Empty<int>(), Array.Empty<int>()),
|
||||||
|
new ProductionItemFlow(65, rate, 0, 0, 0, 0, rate, 0,
|
||||||
|
true, Array.Empty<int>(), Array.Empty<int>(), isResearchProduct: true)
|
||||||
|
}, Array.Empty<ProductionGroupFlow>(), Array.Empty<ProductionDiagnostic>(),
|
||||||
|
new ProductionPower(0, 0, 0, 0, 0, 0, ProductionPowerScope.SelectedFacilities),
|
||||||
|
new ProductionPowerBreakdown(0, 0, true, true));
|
||||||
|
var materialText = BlueprintDescriptionFormatter.Format(materialReport, TestItemTag, labels);
|
||||||
|
Check(materialText.Warnings == "缺少:" + TestItemTag(61) + " x" + expected +
|
||||||
|
"\n多余:" + TestItemTag(62) + " x" + expected &&
|
||||||
|
materialText.Input == TestItemTag(63) + " x" + expected &&
|
||||||
|
materialText.Output == TestItemTag(64) + " x" + expected &&
|
||||||
|
materialText.Research == TestItemTag(65) + " x" + expected,
|
||||||
|
$"all material categories abbreviate {rate} without additional display rounding");
|
||||||
|
}
|
||||||
|
|
||||||
var inputOnlyReport = new ProductionReport(ProductionStatus.Complete, true, true,
|
var inputOnlyReport = new ProductionReport(ProductionStatus.Complete, true, true,
|
||||||
new[] { new ProductionItemFlow(51, 0, 3, 0, 0, 0, 0, 3,
|
new[] { new ProductionItemFlow(51, 0, 3, 0, 0, 0, 0, 3,
|
||||||
false, Array.Empty<int>(), Array.Empty<int>()) },
|
false, Array.Empty<int>(), Array.Empty<int>()) },
|
||||||
|
|||||||
@@ -381,6 +381,15 @@ internal static class QuickMinerPlacementTests
|
|||||||
Check(snapshot.schema is 1 or 2 or 3 or 4, "Unsupported debug snapshot schema.");
|
Check(snapshot.schema is 1 or 2 or 3 or 4, "Unsupported debug snapshot schema.");
|
||||||
Check(snapshot.nodes != null && snapshot.candidates != null && snapshot.buildColliders != null && snapshot.minerColliders != null && snapshot.phases != null,
|
Check(snapshot.nodes != null && snapshot.candidates != null && snapshot.buildColliders != null && snapshot.minerColliders != null && snapshot.phases != null,
|
||||||
"This snapshot contains summary data only and cannot be replayed. Run quick miner placement again with the updated build.");
|
"This snapshot contains summary data only and cannot be replayed. Run quick miner placement again with the updated build.");
|
||||||
|
if (snapshot.algorithm?.EndsWith("-target-group", StringComparison.Ordinal) == true)
|
||||||
|
{
|
||||||
|
var targetIds = snapshot.nodes.Where(node => node.target).Select(node => node.id).ToHashSet();
|
||||||
|
Check(snapshot.candidates.All(candidate => candidate.covered.All(index => snapshot.nodes[index].target)),
|
||||||
|
"Candidate coverage must exclude neighboring vein groups, including those of the same type.");
|
||||||
|
Check((snapshot.placements ?? []).All(placement =>
|
||||||
|
(placement.plannedVeins ?? []).Concat(placement.finalVeins ?? []).All(targetIds.Contains)),
|
||||||
|
"Planned and final miner parameters must contain only nodes from the selected vein group.");
|
||||||
|
}
|
||||||
Console.WriteLine($"Snapshot: outcome={snapshot.outcome}, nodes={snapshot.nodes.Length}, candidates={snapshot.candidates.Length}, placed={snapshot.placedCount}, actual coverage={snapshot.totalCoverage}");
|
Console.WriteLine($"Snapshot: outcome={snapshot.outcome}, nodes={snapshot.nodes.Length}, candidates={snapshot.candidates.Length}, placed={snapshot.placedCount}, actual coverage={snapshot.totalCoverage}");
|
||||||
foreach (var failure in (snapshot.placements ?? []).Where(p => p.outcome != "placed").GroupBy(p => (p.outcome, p.nativeCondition)))
|
foreach (var failure in (snapshot.placements ?? []).Where(p => p.outcome != "placed").GroupBy(p => (p.outcome, p.nativeCondition)))
|
||||||
Console.WriteLine($"Placement {failure.Key.outcome}: native={failure.Key.nativeCondition}, count={failure.Count()}");
|
Console.WriteLine($"Placement {failure.Key.outcome}: native={failure.Key.nativeCondition}, count={failure.Count()}");
|
||||||
|
|||||||
Reference in new issue
Block a user