SampleAndHoldSim
Alter how game simulation works to reduce calculation (see README). 模拟星球工厂的输入输出以减少运算。
| Date uploaded | 3 years ago |
| Version | 0.4.2 |
| Download link | starfi5h-SampleAndHoldSim-0.4.2.zip |
| Downloads | 2391 |
| Dependency string | starfi5h-SampleAndHoldSim-0.4.2 |
This mod requires the following mods to function
README
Sample and Hold Simulation

Change how many planet factories run per tick, simulating idle factories input and output using values from last tick.
The factories tick less but still make the same amount of items in ILS with larger gap in time.
Recommend to set focus local factory = true and not set cycle time too high (<20) to have a better experience.
Warning: Because this mod manipulate stats data, if it does not work as intend, it may diable Milkyway upload.

Additional UI for displaying change rate of resources. Configurable in options.
How does it work

User can set how many planet factories can work during a game tick, the rest will be put into the idle state. For working factories, the factories will run as normal. For idle factories, simulate the input/output by value changes of the last active tick.
In the example chart, the upper one is the original game which runs 3 factories per tick, and their factory cycles are 4/3/2. The lower one set cycle time = 3 ticks so there is only 1 factory run per tick, and it now takes 3 times to complete a full factory cycle.
Factory Input:
- Mineral amount decrease in veins
- Logistic stations storage decrease by belt output ports
Factory Output:
- Logistic stations storage increase by belt input ports
- Research hash upload
- Statistics data (production, power)
- Ejector bullets & silo rockets

Simulation in action. Above: vanilla game, cycle = 1. Below: mod enable, cycle = 2.
In the gif, both vein amount go from 100 to 90, and station storage go from 55 to 65.

The production throughput will catch up with original one in long term if it is stable. In short term there are some differences, for example statistic data will be more sparse. Also local conponents inside the factory will be slower, so storage boxes or tanks will have fewer items than vanilla.
Configuration
Run the game one time to generate com.starfi5h.plugin.SampleAndHoldSim.cfg file.
-
MaxFactoryCount(Default:100)
Maximum number of factories allow to active and run per tick. -
EnableStationStorageUI(Default:600)
Display item count change rate in station storages in x ticks. 0 = no display -
EnableVeinConsumptionUI(Default:1800)
Display mineral consumption rate of mineral in x ticks. 0 = no display -
UnitPerMinute(Default:false)
If true, show rate in unit per minute. otherwise show rate in unit per second.
Compatibility
(✅) CommonAPI
(✅) DSPOptimizations
(✅) NebulaMultiplayer - This mod will diable itself in client mode. Only host can use it.
(⚠️) Blackbox - Conflicts: The production stats of blackbox will be multiplied. Analysis won't start.
(⚠️) Auxilaryfunction - Conflicts with stop factories and stop dyson spheres functions. Will tempoary disable them.
戴森球mod - 修改游戏运算方式,提升逻辑帧率
尝试减缓运算速度并增加每次运算的产物来提升逻辑帧率。
使用者可以在性能测试面板设定每个逻辑祯可以使多少星球运行,闲置的星球将会用上一个帧的值来模拟工厂的输入和输出。
建议勾选Focus Local让本地工厂保持运行来维持游戏体验,运行工厂数调低到能让UPS>60就好。
警告: 此mod会改动统计资料。虽然目的是为了近似原本游戏的数据,但是出错时可能会让存档无法上传银河系。
运作原理

此图中有三个星球工厂,星球A的工厂的物品数量变化是+2/+1/+0/-1,经过一个完整生产周期后最终会有2个物品。其余工厂同理。
上方为原本游戏运行方式,每一祯有3个工厂运作,完整周期分别是4/3/2。
下方为Mod改变之后的运作方式,每一祯有1个工厂运作,在闲置的期间(浅色格)会让数值套用上一次工作的变化,完整周期变为3倍-12/9/6。
套用变化的只有工厂的输入和输出,工厂的内部元件会以低速运行。而戴森球系统和物流塔系统则继续每祯都运行。
工厂输入互动
- 矿脉的矿物消耗
- 物流塔流出减少的货物量
工厂输出互动
- 物流塔流入增加的货物量
- 研究的哈希块上传量
- 产物统计和电力统计
- 射出的太阳帆和火箭

实际演示,上图为正常游戏cycle=1,下图为设置cycle=2。
下图的内部元件速率只有上图的1/2,但是一次发射火箭的数量和一次出塔数量皆为上图的2倍,因此最终两者有一致的输入输出速率:同样12秒间,两者皆发射了2枚火箭,物流塔火箭储量皆从12减少至10。
如果工厂是稳定的,长期下来模拟的产量和真实的产量会相近。短期上统计的数据可能会变得稀疏,工厂内部元件(仓储,运输带)中货物的增减速率也会比原本的少。
設置
.cfg文件需要先运行过游戏一次才会出现,修改后要重启游戏才会生效。
管理器安装: 左边选项Config editor -> 找到starfi5h.plugin.SampleAndHoldSim -> Edit Config
手动安装: 更改BepInEx\config\com.starfi5h.plugin.SampleAndHoldSim.cfg文件
-
MaxFactoryCount(Default:100)
每个逻辑帧所能运行的最大工厂数量 -
EnableStationStorageUI(Default:600)
显示过去x帧内物流塔货物的流入或流出速率, 0 = 不显示 -
EnableVeinConsumptionUI(Default:1800)
显示过去x帧内矿脉的矿物消耗速率, 0 = 不显示 -
UnitPerMinute(Default:false)
true: 显示单位设为每分钟速率 false: 显示每秒速率
MOD相容性:
- DSPOptimizations(优化mod) - 相容
- Blackbox(黑盒化mod) - 低速下产物统计会倍增
- NebulaMultiplayer(联机mod) - 只有主机可使用, 客户端会自动停用并关闭介面
- 深空来敌(战斗mod) - 低速下炮塔和发射井的射速会降低
- 多功能辅助mod - 和停止工厂/戴森球冲突, 在同时安装时会暂时关闭这两项功能
Changelog
v0.4.2
- Fix error when NebulaAPI is not enabled.
v0.4.1
- Fix vein UI errors cause by vein manipulation.
- Improve compatible with Nebula.
v0.4.0
- Fix ship delivery from other stations sometimes gets multiplied.
- Change UI settings to let users customize monitor time.
v0.3.3
- Fix compatibility for game version 0.9.26.13026
- Fix Advance Miner mining amount.
v0.3.2
- Fix compatibility for game version 0.9.26.12900
v0.3.1
- Fix warper consume stat.
- Fix vein amount decrease in InfiniteResource.
- Copied rockets now find new target when the node is full.
v0.3.0
- Add a config option to switch display unit (/s or /min) - Fix game crash when unlocking tech background.
v0.2.1
- Fix a bug that sometimes switching game with veinUI enable will get errors.
v0.2.0
- Add EnableVeinConsumptionUI option.
- Fix error when removing stations.
v0.1.1
- Fix veinGroup value changes.
v0.1.0
- Initial release.
Acknowledgements
All trademarks, copyright, and resources related to Dyson Sphere Project itself, remain the property of Gamera Game and Youthcat Studio as applicable according to the license agreement distributed with Dyson Sphere Program.
CHANGELOG
Changelog
v0.7.7
- Fix errors in game main menu.
v0.7.6 (DSP-0.10.34.28396)
Thanks FyisFe for the following fixes:
- Fix lab tower produce / consume rates drop on focus local planet.
- Fix ray recivers don't receive lens on focus local planet.
v0.7.5 (DSP-0.10.34.28326)
- Fix UI in new game version.
v0.7.4
- Fix solar sails disappear.
- Fix ILS import and export stats.
- Fix attack drone doesn't attack enemies.
- Known issue: Patrolling Dark Fog ground units animation is discontinuous.
v0.7.3
- Fix space warper count change abnormal in stations.
v0.7.2
- Fix error when building new stations.
- Add GenesisBook compat v3.1.4 for dyson sail ejectors.
v0.7.1
- Fix a bug that sails cannot be absorbed.
v0.7.0 (DSP-0.10.33.27026)
- Adapt to game new multithreading system version.
Previous Changelog
v0.6.21
- Fix Advance Miner sometimes buffer overflow when cargo is exceed the limit.
- The miner will have buffer item set to normal range (0-50) when the game loads.
v0.6.20
- Update CheatEnabler compat to v2.3.31
v0.6.19
- Fix that Advance Miners sometimes have negative number in temp storage.
v0.6.18
- Fix Weaver warning detection.
v0.6.17
- Add config EnableKillStatsFuzze to switch kill count algorithm.
- Add Weaver incompatible warning.
v0.6.16
- Scale Dark Fog drop lifetime on remote planets in order to fix Dark Fog farm production lower issue.
v0.6.15
- Fix ejectors don't auto retarget orbit on remote plaents.
v0.6.14
- Update PlanetMiner compat to v3.1.1
v0.6.13
- Adapt item transition across levels in stacked Labs changes for DSP-0.10.31.24646
v0.6.12
- Update CheatEnabler compat to v2.3.36
v0.6.11
- Scale kill stats for remote slowed planets.
v0.6.10
- Fix UI change for DSP-0.10.30.23430
v0.6.9
- Update for DSP-0.10.30.23292
- Remove Multfuntion_mod compat as the compat patch is outdated.
v0.6.8
- Fix IndexOutOfRangeException in PowerExchangerComponent.CalculateActualEnergyPerTick.
v0.6.7
- Add config Combat - EnableRelayLanding to enable/disable Dark Fog relay from landing.
- Add Auxilaryfunction compat for its stop factory feature.
v0.6.6
- Fix IndexOutOfRangeException in FactoryManager.SetMineral.
v0.6.5
- Add config UI:WarnIncompat to stop mod incompatibility warning showing up in the future.
v0.6.4
- Missiles and plasma cannons now have damage sclae up on remote planets.
- Relay will not land on planets with shield on remote star systems.
v0.6.3
- Discard the change to hives ticks. Now all space hives will not be affected and run in normal speed.
- Remote systems now have Lancers damage scale down to the ratio.
v0.6.2
- Bugfixes for index out of range error in UpdateHives and MainManager.TryGet.
v0.6.1
- Focus local now will focus on local star system, including every hives and planets in the system.
- Player space fleet now always run in normal speed.
- Fix time value error in enemy tick logic take make enemy behave abnormally.
v0.6.0 (DSP-0.10.28.21014)
- Adapt to game Dark Fog version. (The battle part still needs testing)
- UpdatePeriod default value is not set to 5.
- Remove TCFV and Multfuntion compat support.
v0.5.7
- Remove vein logic.
- Update CheatEnabler compat to v2.3.1
- Update Multfuntion mod compat to v2.8.6
v0.5.6
- Add CheatEnabler 2.2.0 compat.
- Fix PlanetMiner 3.0.7 compat.
v0.5.5
- Fix stats incorrect for Multfuntion mod planet miners.
v0.5.4
- Fix len consumption rate abnormal on idle factories.
- Fix IsNextIdle value of focus factories.
- Add PlanetMiner 3.0.7 compat.
v0.5.3
- Fix TCFV compat: fix that sheild doesn't regenerate on some planets.
v0.5.2
- Add Blackbox compat
- Hide station UI when flow rate = 0.
v0.5.1
- Fix error when player land on an unexplored planet.
- Reduce memory allocation to fix stuttering.
v0.5.0 (DSP-0.9.27.15466)
- Rework: Change logic from MaxFactoryCount to UpdatePeriod, add related config.
- Remove vein comsumption rate UI.
- Enable station storage to have negative values to prevent generating extra item.
- Fix compat with Auxilaryfunction. Add guard to prevent all vein disappear.
- Add compat with Multfuntion mod, TheyComeFromVoid.
v0.4.2
- Fix error when NebulaAPI is not enabled.
v0.4.1
- Fix vein UI errors cause by vein manipulation.
- Improve compatible with Nebula.
v0.4.0
- Fix ship delivery from other stations sometimes gets multiplied.
- Change UI settings to let users customize monitor time.
v0.3.3
- Fix compatibility for game version 0.9.26.13026
- Fix Advance Miner mining amount.
v0.3.2
- Fix compatibility for game version 0.9.26.12900
v0.3.1
- Fix warper consume stat.
- Fix vein amount decrease in InfiniteResource.
- Copied rockets now find new target when the node is full.
v0.3.0
- Add a config option to switch display unit (/s or /min) - Fix game crash when unlocking tech background.
v0.2.1
- Fix a bug that sometimes switching game with veinUI enable will get errors.
v0.2.0
- Add EnableVeinConsumptionUI option.
- Fix error when removing stations.
v0.1.1
- Fix veinGroup value changes.
v0.1.0
- Initial release.