问题所在
每个已加载的模拟机械结构,无论是否正在运作,都会消耗服务器刻时间。
子层级(sub-level)在每个游戏刻内会被物理管道多次步进;其内部的实体在每次子步进时都会被推进,且其中的每一个方块实体都会像它是世界的一部分那样被服务器精确地 ticking——因为它确实就是世界的一部分。一艘停泊的飞艇、一艘靠岸的驳船、一堆货运箱以及基地角落中未完工的建筑,都在永久地以全额速率支付这一成本。
这种开销呈线性增长。十个机械结构带来的负担是单个结构的十倍。在一个围绕 Create Aeronautics 构建的世界中,实际处于活跃使用状态的机械结构通常只占存在总数的一小部分,而其余部分则在默默消耗刻预算,直到每秒刻数(TPS)开始下降。
本模组的作用
Create Aeronautics Freeze Staff 添加了一种工具,可以将一个机械结构完全移出模拟计算,同时让它保持原地不动。
冻结后的机械结构保留其方块、位置和外观。它不再产生的开销是每个刻的模拟成本。
冻结移除了什么
对于冻结的机械结构,以下工作在源头被抑制:
| 移除的工作 |
频率(每结构) |
| 物理力应用 — 电机、螺旋桨、推进器 |
80 / 秒 |
| 每子步进实体逻辑 — 螺旋桨、反作用轮、提供 RPM 的 Create 电机 |
80 / 秒 |
| 子层级实体刻 |
20 / 秒 |
| 结构分割泛洪填充 |
20 / 秒 |
| 原版方块实体刻 |
20 / 秒,每个方块实体 |
Create SmartBlockEntity 刻 |
20 / 秒,每个方块实体 |
| 随机区块刻 — 生长、扩散、衰变 |
每个区块 |
| 计划内的方块和流体刻 — 中继器、比较器、侦测器 |
按计划执行 |
上述频率假设默认设置为每个游戏刻包含四个物理子步进。
刚体本身通过固定约束被锁定并允许进入休眠状态,因此不再进行求解或移动。其网络位置保持不变,所以客户端仍能正确看到它。
方块实体的 ticking 在三个独立的路径上被拦截,因为 Sable 子层级区块存在于父级世界中,既可以通过原版区块迭代访问,也可以通过子层级管道访问。如果仅抑制物理阶段,大部分成本仍将存在。
冻结并非破坏性操作
冻结的机械结构只是暂停,而非拆解或未加载。
冻结期间被抑制的计划内方块和流体刻会被记录并在解冻时重放:受影响的方块会重新调度,其邻居方块会被强制重新评估,从而使红石信号强度和流体流动恢复正常状态,而不是停留在过时的状态。
冻结状态是记录在机械结构自身的身份标识上的,而非其位置,因此它能承受区块卸载、世界重载和服务器重启。重载后,冻结的机械结构会恢复到冻结时的确切姿态——在无人观察时,它不会漂移、沉降或滑出对齐状态。
冻结期间,其方块不能被破坏、放置物品或交互。被阻止的操作会在动作栏中显示原因,而不是静默失败。
用法
| 输入 |
结果 |
| 右键点击一个机械结构 |
冻结该结构及其所有连接的部分 |
| 右键点击一个已冻结的机械结构 |
解冻该结构及其所属的其余冻结组 |
| 潜行 + 右键点击一个机械结构 |
仅影响目标机械结构 |
| 潜行 + 右键点击其他任意物体 |
在地形中显示冻结的机械结构,持续 3 秒 |
连接冻结
冻结沿两种独立的关系传播,两者默认启用且均可配置:
- 接触 — 边界与已冻结结构接触的机械结构,容差可配置。
- 绳索 — 连接到同一根绳索的机械结构。
传播具有传递性。冻结堆叠中最底部的箱子将冻结整个堆叠;冻结绳索链的一端将冻结整条链。这对性能和物理都很重要:靠岸的组装件通常是你要停放的对象,如果逐个部件冻结,大部分成本仍会残留。
释放也以相同方式工作,并且仅限于实际处于冻结状态的机械结构,因此无法超出群组影响到无关的结构。潜行可以抑制双向传播,仅针对单次交互。
配置
config/freeze_staff-common.toml
| 选项 |
类型 |
默认值 |
描述 |
freezeNearbySubmodules |
boolean |
true |
将冻结传播到与目标接触的机械结构 |
nearbyFreezeMargin |
double |
0.05 |
接触容差(方块单位),超出机械结构自身边界 |
freezeRopeConnectedSubmodules |
boolean |
true |
沿绳索连接传播冻结 |
命令
均需要权限等级 2。
| 命令 |
描述 |
/freezestaff status |
统计总数:已冻结、当前已加载、当前已锁定 |
/freezestaff list |
每行显示一个冻结的机械结构,包含维度信息和姿态 |
The problem
Every loaded Simulated contraption costs server tick time whether or not it is doing anything.
A sub-level is stepped by the physics pipeline several times per game tick, its actors are advanced on every substep, and every block entity inside it is ticked by the server exactly as if it were part of the world — because it is. A parked airship, a docked barge, a stack of freight crates and a half-finished build in the corner of the base all keep paying that cost, permanently, at full rate.
This scales linearly. Ten contraptions cost ten times one. On a world built around Create Aeronautics, the contraptions that are actively in use are usually a small fraction of the contraptions that exist, and the rest quietly consume the tick budget until TPS starts falling.
What this mod does
Create Aeronautics Freeze Staff adds one tool that takes a contraption out of the simulation entirely while leaving it standing exactly where it is.
A frozen contraption keeps its blocks, its position and its appearance. What it stops having is a per-tick cost.
What freezing removes
For a frozen contraption, the following work is suppressed at its source:
| Work removed |
Rate, per contraption |
| Physics force application — motors, propellers, thrusters |
80 / second |
| Per-substep actor logic — propellers, reaction wheels, Create motors feeding RPM |
80 / second |
| Sub-level actor ticks |
20 / second |
| Structure-splitting flood fill |
20 / second |
| Vanilla block entity ticks |
20 / second, per block entity |
Create SmartBlockEntity ticks |
20 / second, per block entity |
| Random chunk ticks — growth, spreading, decay |
per chunk |
| Scheduled block and fluid ticks — repeaters, comparators, observers |
as scheduled |
Rates assume the default of four physics substeps per game tick.
The rigid body itself is pinned by a fixed constraint and allowed to sleep, so it is no longer being solved or moved. Its network position stays intact, so clients continue to see it correctly.
Block entity ticking is intercepted on three separate paths, because Sable sub-level chunks live in the parent world and are reached by vanilla chunk iteration as well as by the sub-level pipeline. Suppressing only the physics phase would leave most of the cost in place.
Freezing is not destructive
A frozen contraption is paused, not disassembled or unloaded.
Scheduled block and fluid ticks that were suppressed while frozen are recorded and replayed on release: the affected blocks are rescheduled and their neighbours forced to re-evaluate, so redstone signal strength and fluid flow resume consistently instead of latching in a stale state.
The freeze is recorded against the contraption's own identity rather than its position, so it survives chunk unloads, world reloads and server restarts. On reload, a frozen contraption is restored to the exact pose it was frozen at — it does not drift, settle or slide out of alignment while nobody is watching.
While frozen, its blocks cannot be broken, placed into or interacted with. Blocked attempts report the reason on the action bar rather than failing silently.
Usage
| Input |
Result |
| Right-click a contraption |
Freezes it and everything connected to it |
| Right-click a frozen contraption |
Releases it and the rest of its frozen group |
| Sneak + right-click a contraption |
Affects only the targeted contraption |
| Sneak + right-click anything else |
Reveals frozen contraptions through terrain for 3 seconds |
Connected freezing
Freezing propagates along two independent relations, both enabled by default and both configurable:
- Contact — contraptions whose bounds touch the frozen one, within a configurable tolerance.
- Ropes — contraptions attached to the same rope.
Propagation is transitive. Freezing the lowest crate in a stack freezes the entire stack; freezing one end of a rope chain freezes the chain. This matters for performance as much as for physics: a docked assembly is usually the unit you want to park, and freezing it one piece at a time would leave most of its cost behind.
Releasing works the same way and is confined to contraptions that are actually frozen, so it cannot reach past the group into unrelated structures. Sneaking suppresses propagation in both directions for a single interaction.
Configuration
config/freeze_staff-common.toml
| Option |
Type |
Default |
Description |
freezeNearbySubmodules |
boolean |
true |
Propagate the freeze to contraptions in contact with the target |
nearbyFreezeMargin |
double |
0.05 |
Contact tolerance in blocks, beyond a contraption's own bounds |
freezeRopeConnectedSubmodules |
boolean |
true |
Propagate the freeze along rope connections |
Commands
Both require permission level 2.
| Command |
Description |
/freezestaff status |
Totals: frozen, currently loaded, currently pinned |
/freezestaff list |
One line per frozen contraption, with dimension and pose |
评论 0
登录后参与评分
还没有评论,来抢沙发吧